[PATCH] D38425: [clangd] Document highlights for clangd

Marc-Andre Laperle via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 27 13:34:27 PST 2017


malaperle added inline comments.


================
Comment at: clangd/ClangdLSPServer.cpp:246
+
+  C.reply(json::ary(Highlights->Value));
+}
----------------
I get a test failure here because there is an assertion that the Expected<> needs to be checked. I can't really think of any failure case right now where we wouldn't just return an empty array of highlights. But I think it's better for consistency and future-proofing to keep the Expected<>.
I think you can just do like in onRename for now
  if (!Highlights) {
    C.replyError(ErrorCode::InternalError,
                 llvm::toString(Highlights.takeError()));
    return;
  }


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D38425





More information about the cfe-commits mailing list