Closed nullromo closed 2 years ago
Hi @nullromo
if your clangd is the latest (13?), chances are it no longer supports vim-lsp-cxx-highlight. The clangd developers are moving towards semantic tokens which is the officially standardized semantic highlighting protocol.
vim-lsp-cxx-highlight implements the non-standard protocols used by cquery and ccls. clangd support was added via a compatbility shim in the coc-clangd plugin.
I have probably mentioned this on another issue but vim-lsp-cxx-highlight will never support Semantic Tokens. It's simply too difficult as a third-party plugin to implement the standard as it requires many RPC calls back and forth. As it's officially standardized, there's no reason why your LSP client wouldn't implement it in time. Please wait for that to happen or better yet, contribute code towards it.
Or you can downgrade your clangd to a compatible version, I think 11 or 12 might work.
Thank you for the response. That led me to check out coc.nvim and coc-clangd to see if they have addressed the issue of supporting semantic tokens, and I found out from this thread and this comment that I can add
"coc.preferences.semanticTokensHighlights": false
to my coc config. That makes this plugin work with coc-clangd and now I have beautiful highlighting ゚。・*.゚☆━⊂( ' ᴗ '∩)
Wow great find. I'll update the README with this.
@nullromo do you mind doing a quick check over #78 to see if my README changes reflect what you're using?
I created a PR with a clarification. See #79.
Thank you for the response. That led me to check out coc.nvim and coc-clangd to see if they have addressed the issue of supporting semantic tokens, and I found out from this thread and this comment that I can add
"coc.preferences.semanticTokensHighlights": false
to my coc config. That makes this plugin work with coc-clangd and now I have beautiful highlighting ゚。・*.゚☆━⊂( ' ᴗ '∩)
I am trying to use clangd for highlighting, but can not get it work.
this is my coc setting: cat ~/.vim/coc-settings.json
{ "clangd.semanticHighlighting": true, "coc.preferences.semanticTokensHighlights": false }
Can you share more info ? Thanks
The latest version of coc-clangd supports semantic tokens now. To enable it, you need to disable vim-lsp-cxx-highlight
and add
"semanticTokens.filetypes": ["c", "cpp"]
to your coc-settings.json
. You can also use "*"
to enable it for all files.
See this comment.
Hi @nullromo
if your clangd is the latest (13?), chances are it no longer supports vim-lsp-cxx-highlight. The clangd developers are moving towards semantic tokens which is the officially standardized semantic highlighting protocol.
vim-lsp-cxx-highlight implements the non-standard protocols used by cquery and ccls. clangd support was added via a compatbility shim in the coc-clangd plugin.
I have probably mentioned this on another issue but vim-lsp-cxx-highlight will never support Semantic Tokens. It's simply too difficult as a third-party plugin to implement the standard as it requires many RPC calls back and forth. As it's officially standardized, there's no reason why your LSP client wouldn't implement it in time. Please wait for that to happen or better yet, contribute code towards it.
Or you can downgrade your clangd to a compatible version, I think 11 or 12 might work.
tried clang 13 doesn't work this this plugin.
Describe the bug The plugin does not seem to receive anything from the language server.
To Reproduce
Plug 'jackguo380/vim-lsp-cxx-highlight'
to.vimrc
(and verify that:echo g:lsp_cxx_hl_loaded
prints1
).coc-clangd
(I have already been successfully using this for completions and error traversal, so I know the language server is running and working, at least at some level)."clangd.semanticHighlighting": true
tococ-settings.json
.LspCxxHlDumpSyms
and get the following:let g:lsp_cxx_hl_log_file = '/tmp/vim-lsp-cxx-hl.log'
andlet g:lsp_cxx_hl_verbose_log = 1
to.vimrc
and launch vim again to open a C file. The log file contains:Expected behavior I expect the highlighting to work.
Configuration (Fill this out):
Parts of your
.vimrc
:Log File:
Additional context I saw something in the other open issues about clang-format. I do use this clang-format plugin. Not sure if that matters here or not.