Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 33994 Build 33993: arc lint + arc unit
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 | ||
---|---|---|
65 | Probably want to rename DiagnosticsConsumer as well, can't come up with a good name though. Any suggestions? |
clang-tools-extra/clangd/ClangdServer.h | ||
---|---|---|
65 | 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 | clang-format: intention is not correct. | |
clang-tools-extra/clangd/ClangdServer.h | ||
54 | nit: triple / here. | |
56 | just provide an empty implementation (like onFileUpdated), and you don't need to update all the subclasses. | |
65 | There is a FIXME on Line 43. I'd keep it unchanged now (I don't have a good name either). | |
141 | just: Enable semantic highlighting features, and name it bool SemanticHighlighting. | |
160 | 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). | |
317 | We don't need to store it as a class member, we only pass this value to ParsingCallBack in the constructor. | |
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 | ||
898 | 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 | nit: you can remove this override, since we have provided an empty default implementation. | |
clang-tools-extra/clangd/unittests/ClangdTests.cpp | ||
881 | 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 | I get an -Winconsistent-missing-override warnings without the override. |
clang-tools-extra/clangd/ClangdLSPServer.h | ||
---|---|---|
60 | sorry for the confusion, I meant we remove onHighlightingsReady, not the override keyword. | |
clang-tools-extra/clangd/unittests/ClangdTests.cpp | ||
863 | 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 | maybe move this test to SemanticHighlightingTests. |
clang-format: intention is not correct.