jackguo380 / vim-lsp-cxx-highlight

Vim plugin for C/C++/ObjC semantic highlighting using cquery, ccls, or clangd
MIT License
337 stars 26 forks source link

Semantic highlighting doesn't work with `coc-clangd` on `nvim` #69

Closed CodePurble closed 3 years ago

CodePurble commented 3 years ago

Description Semantic highlighting with coc-clangd is not working. The default nvim syntax highlighting seems to be taking over. No symbols are detected by the plugin for highlighting.

To Reproduce

Expected behavior Semantic highlighting for structs and classes

Screenshots :LspCxxHlCursorSym output: image :LspCxxHlDumpSyms output: image

Configuration

Log File:

Wed 07 Jul 2021 08:16:00 PM IST: lsp_cxx_hl beginning initialization...
Wed 07 Jul 2021 08:16:00 PM IST: vim-lsp not detected
Wed 07 Jul 2021 08:16:00 PM IST: LanguageClient-neovim not detected
Wed 07 Jul 2021 08:16:00 PM IST: coc.nvim successfully registered
Wed 07 Jul 2021 08:16:00 PM IST: nvim-lsp successfully registered

Additional context I was previously using the stock builtin LSP for nvim v0.5.0. I then switched to coc-clangd. I have used this before, and it had worked. I've also attached the coc.nvim logs for reference.

2021-07-07T20:16:01.092 WARN (pid:76886) [attach] - Plugin not ready when received "registNotification" [ 'cquery', '$cquery/publishSemanticHighlighting' ]
2021-07-07T20:16:01.094 WARN (pid:76886) [attach] - Plugin not ready when received "registNotification" [ 'cquery', '$cquery/setInactiveRegions' ]
2021-07-07T20:16:01.095 WARN (pid:76886) [attach] - Plugin not ready when received "registNotification" [ 'ccls', '$ccls/publishSemanticHighlight' ]
2021-07-07T20:16:01.095 WARN (pid:76886) [attach] - Plugin not ready when received "registNotification" [ 'ccls', '$ccls/publishSkippedRanges' ]
2021-07-07T20:16:01.227 INFO (pid:76886) [services] - registered service "clangd"
2021-07-07T20:16:01.227 INFO (pid:76886) [services] - clangd state change: stopped => starting
2021-07-07T20:16:01.231 INFO (pid:76886) [language-client-index] - Language server "clangd" started with 76913
2021-07-07T20:16:01.265 INFO (pid:76886) [services] - clangd state change: starting => running
2021-07-07T20:16:01.281 INFO (pid:76886) [services] - service clangd started
2021-07-07T20:16:01.286 INFO (pid:76886) [plugin] - coc.nvim 0.0.80-131f6b267f initialized with node: v16.4.2 after 178ms
2021-07-07T20:16:01.289 INFO (pid:76886) [attach] - receive notification: registNotification [ 'cquery', '$cquery/publishSemanticHighlighting' ]
2021-07-07T20:16:01.289 INFO (pid:76886) [attach] - receive notification: registNotification [ 'cquery', '$cquery/setInactiveRegions' ]
2021-07-07T20:16:01.289 INFO (pid:76886) [attach] - receive notification: registNotification [ 'ccls', '$ccls/publishSemanticHighlight' ]
2021-07-07T20:16:01.289 INFO (pid:76886) [attach] - receive notification: registNotification [ 'ccls', '$ccls/publishSkippedRanges' ]
2021-07-07T20:24:12.014 INFO (pid:76886) [attach] - Request action: fillDiagnostics [ 1 ]
2021-07-07T20:24:30.427 INFO (pid:76886) [attach] - receive notification: openLog []
CodePurble commented 3 years ago

Seems like nvim-lsp is overriding coc.nvim from the logs. I can also confirm that the experience is similar with nvim v0.4.4, so I'm not sure whether nvim-lsp is the culprit.

GiuseppeCesarano commented 3 years ago

It's a coc.vim / coc-clangd problem. clangd/coc-clangd#287

CodePurble commented 3 years ago

I see. I guess I'll have to roll back my coc.nvim for now. Have you found any other workaround?

CodePurble commented 3 years ago

Since this is a problem with coc-clangd, I'm closing this issue.