Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(coc.nvim + clangd) Semantic highlighting seems to cut off when entering insert mode in NeoVim #20

Closed
RMichelsen opened this issue Apr 13, 2020 · 4 comments

Comments

@RMichelsen
Copy link

RMichelsen commented Apr 13, 2020

Describe the bug
Im experiencing some weird behaviour with the highlighting, whenever I enter
insert mode, the semantic highlighting disappears for all text above the cursor.

To Reproduce
Open any .cpp file with coc.nvim/clangd + vim-lsp-cxx-highlight.
Observe that semantic highlighting works properly, then enter
insert mode.

Screenshots

Configuration (Fill this out):

  • Neovim NVIM v0.5.0-372-ge63b25eb2
  • coc.nvim + clangd (10.0.0) Windows 10 binaries

Log File:

4/13/2020 4:14:06 AM: lsp_cxx_hl beginning initialization...
4/13/2020 4:14:06 AM: vim-lsp not detected
4/13/2020 4:14:06 AM: LanguageClient-neovim not detected
4/13/2020 4:14:06 AM: coc.nvim successfully registered
4/13/2020 4:14:06 AM: nvim-lsp successfully registered
4/13/2020 4:14:07 AM: textprop nvim notify symbols for .\AppEditorLogic.cpp
4/13/2020 4:14:07 AM: hl_symbols (textprop nvim) highlighted 18 symbols in file .\AppEditorLogic.cpp
4/13/2020 4:14:07 AM: operation hl_symbols (textprop nvim) .\AppEditorLogic.cpp took   0.002619s to complete
4/13/2020 4:14:10 AM: textprop nvim notify symbols for .\AppEditorLogic.cpp
4/13/2020 4:14:10 AM: hl_symbols (textprop nvim) highlighted 12 symbols in file .\AppEditorLogic.cpp
4/13/2020 4:14:10 AM: operation hl_symbols (textprop nvim) .\AppEditorLogic.cpp took   0.001566s to complete
@jackguo380
Copy link
Owner

Hi R-Michelsen,

Thanks for reporting this. I just tested out NVIM v0.5.0-429-g13b4a6fd4 with clangd 11 and am seeing a similar issue. The highlighting will disappear from the buffer after entering insert mode and typing anything.

I suspect the cause is related to my comment on coc-clangd about incremental highlighting. @fannheyward Maybe having coc-clangd cache previous highlighting messages then calling lsp_cxx_hl#hl#notify_symbols would fix this issue. What do you think?

For now if you want something that works clangd 9.0.0 shouldn't have this problem as long as you are willing to downgrade to it.

@sam-mccall
Copy link
Contributor

Maybe having coc-clangd cache previous highlighting messages then calling lsp_cxx_hl#hl#notify_symbols would fix this issue. What do you think?

Indeed, fixed in clangd/coc-clangd@008da37 and it seems to work well.
We need a new release of coc-clangd though, hopefully soon.

@fannheyward
Copy link

coc-clangd has released a new version with this fix.

@jackguo380
Copy link
Owner

Just tested it out as well, looks like it is fixed.

Thanks @sam-mccall @fannheyward

@R-Michelsen if updating to the latest coc-clangd fixes it for you please close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants