malaperle added a comment. Can you also reformat the code too with clang-format? I think there's a few things in ClangdUnit.h/.cpp
================ Comment at: clangd/ClangdServer.cpp:521 + std::shared_ptr<CppFile> Resources = Units.getFile(File); + assert(Resources && "Calling findDocumentHighlights on non-added file"); + ---------------- We should do like findDefinitions here: ``` if (!Resources) return llvm::make_error<llvm::StringError>( "findDocumentHighlights called on non-added file", llvm::errc::invalid_argument); ``` ================ Comment at: clangd/ClangdServer.cpp:528 + if (!AST) + Err = llvm::make_error<llvm::StringError>("Invalid AST", + llvm::errc::invalid_argument); ---------------- Woops, I forgot the return here if it's an error, so it should be: ``` if (!AST) { Err = llvm::make_error<llvm::StringError>("Invalid AST", llvm::errc::invalid_argument); return; } ``` 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