[PATCH] D63821: [clangd] Added C++ API code for semantic highlighting
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 27 05:31:02 PDT 2019
hokein added inline comments.
================
Comment at: clang-tools-extra/clangd/ClangdLSPServer.h:60
+ void
+ onHighlightingsReady(PathRef File,
+ std::vector<HighlightingToken> Highlightings) override;
----------------
nit: you can remove this override, since we have provided an empty default implementation.
================
Comment at: clang-tools-extra/clangd/unittests/ClangdTests.cpp:881
+
+ std::promise<void> StartSecondPromise;
+ std::future<void> StartSecond = StartSecondPromise.get_future();
----------------
Looks like the current test could be simplified, I think we want to test that when the AST is build/rebuild, we will emit the highlighting tokens.
Just use `Count` and check the count is to 1?
```
Server.addDocument(FooCpp, "int a;");
ASSERT_TRUE(Server.blockUntilIdleForTest()) << "Waiting for server";
ASSERT_EQ(DiagConsumer.Count, 1);
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63821/new/
https://reviews.llvm.org/D63821
More information about the cfe-commits
mailing list