Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang-tools-extra/clangd/TUScheduler.h | ||
---|---|---|
157 ↗ | (On Diff #206661) | Can we avoid updating TUScheduler, ParsingCallbacks and compute the highlights inside onMainAST? |
clang-tools-extra/clangd/ClangdServer.h | ||
---|---|---|
60 ↗ | (On Diff #206661) | Probably want to rename DiagnosticsConsumer as well, can't come up with a good name though. Any suggestions? |
clang-tools-extra/clangd/ClangdServer.h | ||
---|---|---|
60 ↗ | (On Diff #206661) | One could summarize diagnostics and highlightings as annotations, so maybe FileAnnotationsConsumer or DocumentAnnotationsConsumer? Not sure how onFileUpdated() fits into this... |
thanks, it is much clearer now.
Could you please make the commit message be more specific what this patch does? C++ APIs is too generous, (we already have C++ APIs and data structures for semantic highlightings which are in SemanticHighlighting.h).
clang-tools-extra/clangd/ClangdLSPServer.h | ||
---|---|---|
60 ↗ | (On Diff #206792) | clang-format: intention is not correct. |
clang-tools-extra/clangd/ClangdServer.h | ||
54 ↗ | (On Diff #206792) | nit: triple / here. |
56 ↗ | (On Diff #206792) | just provide an empty implementation (like onFileUpdated), and you don't need to update all the subclasses. |
140 ↗ | (On Diff #206792) | just: Enable semantic highlighting features, and name it bool SemanticHighlighting. |
160 ↗ | (On Diff #206792) | not sure whether we need this comment, because the intention is not obvious in code here (the flag is hidden in Opts), it might be more sensible to move it to Options::SemanticHighlighting. And the comment is not precise in the new code now (we collect the highlighting tokens in the DiagConsumer now). |
320 ↗ | (On Diff #206792) | We don't need to store it as a class member, we only pass this value to ParsingCallBack in the constructor. |
60 ↗ | (On Diff #206661) | There is a FIXME on Line 43. I'd keep it unchanged now (I don't have a good name either). |
clang-tools-extra/clangd/SemanticHighlighting.h | ||
35 ↗ | (On Diff #206792) | I think it is unrelated to this patch, we should include this when we implements the LSP part. |
clang-tools-extra/clangd/unittests/ClangdTests.cpp | ||
863 ↗ | (On Diff #206792) | We should keep the test isolated, this test is for diagnostics, please add a new TEST_F for merely testing the highlightings. |
clang-tools-extra/clangd/ClangdLSPServer.h | ||
---|---|---|
60 ↗ | (On Diff #206832) | nit: you can remove this override, since we have provided an empty default implementation. |
clang-tools-extra/clangd/unittests/ClangdTests.cpp | ||
881 ↗ | (On Diff #206832) | 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. Server.addDocument(FooCpp, "int a;"); ASSERT_TRUE(Server.blockUntilIdleForTest()) << "Waiting for server"; ASSERT_EQ(DiagConsumer.Count, 1); |
clang-tools-extra/clangd/ClangdLSPServer.h | ||
---|---|---|
60 ↗ | (On Diff #206832) | I get an -Winconsistent-missing-override warnings without the override. |
clang-tools-extra/clangd/ClangdLSPServer.h | ||
---|---|---|
60 ↗ | (On Diff #206832) | sorry for the confusion, I meant we remove onHighlightingsReady, not the override keyword. |
clang-tools-extra/clangd/unittests/ClangdTests.cpp | ||
864 ↗ | (On Diff #206841) | this is not safe, we need to wait until the server finishes building AST. add ASSERT_TRUE(Server.blockUntilIdleForTest()) << "Waiting for server"; |
Let's rephrase the commit message, I think this patch is just to "emit the semantic highlighting tokens when the main AST is built".
clang-tools-extra/clangd/unittests/ClangdTests.cpp | ||
---|---|---|
844 ↗ | (On Diff #206854) | maybe move this test to SemanticHighlightingTests. |