malaperle added inline comments.
================ Comment at: clangd/ClangdLSPServer.cpp:246 + + C.reply(json::ary(Highlights->Value)); +} ---------------- malaperle wrote: > 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; > } Just to be clear, the error I see in the output is: Expected<T> must be checked before access or destruction. Expected<T> value was in success state. (Note: Expected<T> values in success mode must still be checked prior to being destroyed). It asserts when in ClangdLSPServer::onDocumentHighlight, referencing Highlights->Value Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D38425 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits