Closed Leo843 closed 3 years ago
I'm experiencing something similar to this but with not nearly as minimal a configuration. It only started happening this week for me, and what's curious is that I hadn't explicitly run PlugUpdate before it broke. Something weird is going on. It's not some change from this repo since it has been unchanged since April.
Currently am scrounging for additional debugging output from the related tools, because
let g:lsp_cxx_hl_log_file = '/tmp/vim-lsp-cxx-hl.log'
let g:lsp_cxx_hl_verbose_log = 1
is not providing any useful output for me. Is that the case for you as well?
I see you're getting those operation __ took __s to complete
in your log, but I'm not even getting that. (update: I can get that same output if I run :LspCxxHighlight
.)
OK as has been noted elsewhere, https://github.com/clangd/coc-clangd/issues/287 contains a temporary fix. This fix is to revert coc.nvim to version 0.0.80 (I just went into plugged/, git fetch --unshallow
there and checked this commit out, and I got my highlights back).
It seems like there is some general disarray around coc and clangd interoperation for semantic highlighting features being added. It seems like whatever lsp-cxx-highlight is listening for isn't being delivered by clangd when clangd detects coc supporting the new semantic highlight feature.
Luckily, for the time being, the workaround is to keep coc at the older release version for the time being and the previously working behavior continues. Hopefully soon we will get a better integrated system for this (which will work on all languages rather than using this plugin to get it just for C++).
Can confirm, highligting broke after :PlugUpdate
for me, navigating to ~/.vim/plugged/coc.nvim
and doing git checkout v0.0.80
fixed it for now.
git checkout v0.0.80
It doesn't works for me
git checkout v0.0.80
It doesn't works for me
I do not know what "doesn't work" mean.
git checkout v0.0.80
It doesn't works for me
I do not know what "doesn't work" mean.
highlight doesn't work after checkout to v0.0.80 too
Set coc.preferences.semanticTokensHighlights
to false
in your coc-settings.json to disable the new semanticTokens highlighting, to use the old semanticHighlighting protocol. You don't need to revert coc to 0.0.80.
The reason: clangd 12 supports both the two highlighting protocol, the new semanticTokens and the old semanticHighlighting. coc-clangd used the old protocol with vim-lsp-cxx-highlight to do highlighting. coc added semanticTokens support in latest, clangd will force use the new protocol, some highlighting group maybe broken. You need to disable the new protocol by coc.preferences.semanticTokensHighlights
to use the old one.
The highlighting works after setting coc.preferences.semanticTokensHighlights
to false
in coc-settings.json
.
{
"clangd.semanticHighlighting": true,
"coc.preferences.semanticTokensHighlights": false
}
Does anyone have an idea when the new approach to semantic highlighting can work for C++? What is the root cause of breakage that is leading us to have to pin our coc.nvim at 0.0.80? Although it is a working setup for now it feels very precarious. vim-lsp-cxx-highlight also has inherent problems where I regularly see comments exhibit residual messed up highlight colors within them, I expect that will be a thing of the past with the new approach.
Describe the bug I setup a container as a portable development environment, but there is no syntax highlight in cpp files.
To Reproduce Here is a simplified version of the Dockerfile.
When
sample/main.cpp
is opened with vim in the running container, no highlight appears.Expected behavior I expect symbols
main
andputs
to be highlighted (function names are highlighted by default).Screenshots From the container From the host (expected behavior)
Configuration (Fill this out):
vim --version
set nocompatible call plug#begin() Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'jackguo380/vim-lsp-cxx-highlight' call plug#end() let g:lsp_cxx_hl_verbose_log = 1 let g:lsp_cxx_hl_log_file = '/tmp/vim-lsp-cxx-hl.log'
Debug Dump Symbols End of Debug Dump Symbols
Fri Jul 2 12:02:28 2021: lsp_cxx_hl beginning initialization... Fri Jul 2 12:02:28 2021: vim-lsp not detected Fri Jul 2 12:02:28 2021: LanguageClient-neovim not detected Fri Jul 2 12:02:28 2021: coc.nvim successfully registered Fri Jul 2 12:02:28 2021: Not registering nvim-lsp as this is not Neovim Fri Jul 2 12:05:30 2021: lsp_cxx_hl beginning initialization... Fri Jul 2 12:05:30 2021: vim-lsp not detected Fri Jul 2 12:05:30 2021: LanguageClient-neovim not detected Fri Jul 2 12:05:30 2021: coc.nvim successfully registered Fri Jul 2 12:05:30 2021: Not registering nvim-lsp as this is not Neovim Fri Jul 2 12:05:33 2021: operation hl_skipped (textprop) sample/main.cpp took 0.000117s to complete Fri Jul 2 12:05:33 2021: operation hl_symbols (textprop) sample/main.cpp took 0.000137s to complete