This is a simpler request/response protocol.
No attempt to support incremental formatting (yet).
Paths
| Differential D76663
[clangd] Support new semanticTokens request from LSP 3.16. ClosedPublic Authored by sammccall on Mar 23 2020, 6:25 PM.
Details Summary This is a simpler request/response protocol. No attempt to support incremental formatting (yet).
Diff Detail
Event TimelineComment Actions For some context here, I was doing some digging as Heyward Fann is looking at hooking up our existing syntax highlighting to coc.nvim, and he and Jack Guo (of jackguo380/vim-lsp-cxx-highlight) were asking about the protocol. The new LSP protocol looks really solid, including better incremental highlight support than the Theia proposal, though this patch doesn't implement incremental yet. (In particular, no sending thousands of re-highlights when inserting a new line). It's also request-response rather than notification-based, which is easier to implement on the server side. Also the VSCode client-side of our highlighting feels like significant technical debt we could be rid of. So I think we should try to support the new LSP and drop the older Theia one ASAP (clangd 12?), even if semantic highlighting isn't a really high priority for us. Comment Actions
Thanks for the summary, sounds a good plan. The patch is mostly good, just a few nits. I will try to play it with VSCode.
sammccall marked 6 inline comments as done. Comment ActionsAddress review comments.
This revision is now accepted and ready to land.Mar 31 2020, 3:29 AM Closed by commit rG71177ac16801: [clangd] Support new semanticTokens request from LSP 3.16. (authored by sammccall). · Explain WhyMar 31 2020, 6:37 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 253865 clang-tools-extra/clangd/ClangdLSPServer.h
clang-tools-extra/clangd/ClangdLSPServer.cpp
clang-tools-extra/clangd/ClangdServer.h
clang-tools-extra/clangd/ClangdServer.cpp
clang-tools-extra/clangd/Protocol.h
clang-tools-extra/clangd/Protocol.cpp
clang-tools-extra/clangd/SemanticHighlighting.h
clang-tools-extra/clangd/SemanticHighlighting.cpp
clang-tools-extra/clangd/test/initialize-params.test
clang-tools-extra/clangd/test/semantic-tokens.test
clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp
|
nit: shall we explicitly set the rangeProvider to false as we don't support the semantic token range request now.