coc-clangd: Syntax highlighting is broken with latest coc.nvim version.
vim version: NVIM v0.5.0
node version: v16.4.2
coc.nvim version: 0.0.80-aa24232066
clangd version: 12.0.1
coc-clangd extension version: 0.11.0
Operating system: ArchLinux
Hi!
I guess this issue is a continuation of #287. After upgrading Coc to the latest version syntax highlighting works as expected on fresh nvim startup, but this is what happens after performing some editing:
Log
I[13:28:54.999] clangd version 12.0.1
I[13:28:54.999] PID: 197722
I[13:28:54.999] Working directory: /home/alexey/test2
I[13:28:54.999] argv[0]: /usr/bin/clangd
I[13:28:54.999] Starting LSP over stdin/stdout
I[13:28:55.000] <-- initialize(0)
I[13:28:55.000] Client supports legacy semanticHighlights notification and standard semanticTokens request, choosing the latter (no notifications).
I[13:28:55.000] --> reply:initialize(0) 0 ms
I[13:28:55.063] <-- initialized
I[13:28:55.063] <-- textDocument/didOpen
I[13:28:55.070] Loaded compilation database from /home/alexey/test2/compile_commands.json
I[13:28:55.070] --> window/workDoneProgress/create(0)
I[13:28:55.070] Enqueueing 1 commands for indexing
I[13:28:55.071] ASTWorker building file /home/alexey/test2/test.cpp version 1 with command
[/home/alexey/test2]
/usr/bin/g++ --driver-mode=g++ -c -std=c++17 -o test test.cpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1
I[13:28:55.074] --> textDocument/clangd.fileStatus
I[13:28:55.149] <-- reply(0)
I[13:28:55.149] --> $/progress
I[13:28:55.149] --> $/progress
I[13:28:56.189] --> textDocument/publishDiagnostics
I[13:28:56.189] --> textDocument/clangd.fileStatus
I[13:28:57.017] <-- textDocument/semanticTokens/full(1)
I[13:28:57.017] --> reply:textDocument/semanticTokens/full(1) 0 ms
I[13:28:57.017] --> textDocument/clangd.fileStatus
I[13:29:00.016] --> $/progress
I[13:29:00.016] --> $/progress
I[13:30:33.554] <-- textDocument/didChange
I[13:30:33.554] --> textDocument/clangd.fileStatus
I[13:30:33.605] ASTWorker building file /home/alexey/test2/test.cpp version 2 with command
[/home/alexey/test2]
/usr/bin/g++ --driver-mode=g++ -c -std=c++17 -o test test.cpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1
I[13:30:33.627] --> textDocument/clangd.fileStatus
I[13:30:33.627] --> textDocument/clangd.fileStatus
I[13:30:35.556] <-- textDocument/semanticTokens/full/delta(2)
I[13:30:35.556] --> textDocument/clangd.fileStatus
I[13:30:35.598] --> reply:textDocument/semanticTokens/full/delta(2) 42 ms
I[13:30:35.598] --> textDocument/clangd.fileStatus
I[13:30:35.656] --> textDocument/clangd.fileStatus
I[13:30:35.675] --> textDocument/publishDiagnostics
I[13:30:35.679] --> textDocument/clangd.fileStatus
I[13:30:37.253] <-- textDocument/didChange
I[13:30:37.253] --> textDocument/clangd.fileStatus
I[13:30:37.304] ASTWorker building file /home/alexey/test2/test.cpp version 3 with command
[/home/alexey/test2]
/usr/bin/g++ --driver-mode=g++ -c -std=c++17 -o test test.cpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1
I[13:30:37.306] --> textDocument/clangd.fileStatus
I[13:30:37.314] --> textDocument/clangd.fileStatus
I[13:30:37.495] <-- textDocument/didChange
I[13:30:37.495] --> textDocument/clangd.fileStatus
I[13:30:37.545] --> textDocument/clangd.fileStatus
I[13:30:37.545] ASTWorker building file /home/alexey/test2/test.cpp version 4 with command
[/home/alexey/test2]
/usr/bin/g++ --driver-mode=g++ -c -std=c++17 -o test test.cpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1
I[13:30:37.547] --> textDocument/clangd.fileStatus
I[13:30:37.680] <-- textDocument/didChange
I[13:30:37.680] --> textDocument/clangd.fileStatus
I[13:30:37.730] --> textDocument/clangd.fileStatus
I[13:30:37.730] ASTWorker building file /home/alexey/test2/test.cpp version 5 with command
[/home/alexey/test2]
/usr/bin/g++ --driver-mode=g++ -c -std=c++17 -o test test.cpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1
I[13:30:37.732] --> textDocument/clangd.fileStatus
I[13:30:38.130] --> textDocument/clangd.fileStatus
I[13:30:38.130] --> textDocument/clangd.fileStatus
I[13:30:38.131] --> textDocument/clangd.fileStatus
I[13:30:38.151] --> textDocument/clangd.fileStatus
I[13:30:38.152] --> textDocument/publishDiagnostics
I[13:30:38.153] --> textDocument/clangd.fileStatus
I[13:30:38.960] --> textDocument/clangd.fileStatus
I[13:30:38.978] --> textDocument/publishDiagnostics
I[13:30:38.978] --> textDocument/clangd.fileStatus
I[13:30:39.680] <-- textDocument/semanticTokens/full/delta(3)
I[13:30:39.680] --> reply:textDocument/semanticTokens/full/delta(3) 0 ms
I[13:30:39.681] --> textDocument/clangd.fileStatus
I[13:30:42.054] <-- textDocument/didChange
I[13:30:42.054] --> textDocument/clangd.fileStatus
I[13:30:42.105] ASTWorker building file /home/alexey/test2/test.cpp version 6 with command
[/home/alexey/test2]
/usr/bin/g++ --driver-mode=g++ -c -std=c++17 -o test test.cpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1
I[13:30:42.107] --> textDocument/clangd.fileStatus
I[13:30:42.107] --> textDocument/clangd.fileStatus
I[13:30:42.240] <-- textDocument/didChange
I[13:30:42.240] --> textDocument/clangd.fileStatus
I[13:30:42.291] --> textDocument/clangd.fileStatus
I[13:30:42.291] ASTWorker building file /home/alexey/test2/test.cpp version 7 with command
[/home/alexey/test2]
/usr/bin/g++ --driver-mode=g++ -c -std=c++17 -o test test.cpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1
I[13:30:42.293] --> textDocument/clangd.fileStatus
I[13:30:42.417] <-- textDocument/didChange
I[13:30:42.417] --> textDocument/clangd.fileStatus
I[13:30:42.467] --> textDocument/clangd.fileStatus
I[13:30:42.467] ASTWorker building file /home/alexey/test2/test.cpp version 8 with command
[/home/alexey/test2]
/usr/bin/g++ --driver-mode=g++ -c -std=c++17 -o test test.cpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1
I[13:30:42.469] --> textDocument/clangd.fileStatus
I[13:30:42.578] <-- textDocument/didChange
I[13:30:42.578] --> textDocument/clangd.fileStatus
I[13:30:42.629] --> textDocument/clangd.fileStatus
I[13:30:42.629] ASTWorker building file /home/alexey/test2/test.cpp version 9 with command
[/home/alexey/test2]
/usr/bin/g++ --driver-mode=g++ -c -std=c++17 -o test test.cpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1
I[13:30:42.631] --> textDocument/clangd.fileStatus
I[13:30:42.917] --> textDocument/clangd.fileStatus
I[13:30:42.918] --> textDocument/clangd.fileStatus
I[13:30:42.919] --> textDocument/clangd.fileStatus
I[13:30:42.935] --> textDocument/clangd.fileStatus
I[13:30:42.938] --> textDocument/publishDiagnostics
I[13:30:42.939] --> textDocument/clangd.fileStatus
I[13:30:43.760] --> textDocument/clangd.fileStatus
I[13:30:43.778] --> textDocument/publishDiagnostics
I[13:30:43.778] --> textDocument/clangd.fileStatus
I[13:30:44.581] <-- textDocument/semanticTokens/full/delta(4)
I[13:30:44.582] --> reply:textDocument/semanticTokens/full/delta(4) 0 ms
I[13:30:44.582] --> textDocument/clangd.fileStatus
I[13:30:48.374] <-- textDocument/didChange
I[13:30:48.374] --> textDocument/clangd.fileStatus
I[13:30:48.425] ASTWorker building file /home/alexey/test2/test.cpp version 10 with command
[/home/alexey/test2]
/usr/bin/g++ --driver-mode=g++ -c -std=c++17 -o test test.cpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1
I[13:30:48.427] --> textDocument/clangd.fileStatus
I[13:30:48.427] --> textDocument/clangd.fileStatus
I[13:30:48.428] --> textDocument/clangd.fileStatus
I[13:30:48.444] --> textDocument/publishDiagnostics
I[13:30:48.445] --> textDocument/clangd.fileStatus
I[13:30:50.374] <-- textDocument/semanticTokens/full/delta(5)
I[13:30:50.375] --> reply:textDocument/semanticTokens/full/delta(5) 0 ms
I[13:30:50.375] --> textDocument/clangd.fileStatus
I[13:30:52.133] <-- textDocument/didChange
I[13:30:52.133] --> textDocument/clangd.fileStatus
I[13:30:52.184] ASTWorker building file /home/alexey/test2/test.cpp version 11 with command
[/home/alexey/test2]
/usr/bin/g++ --driver-mode=g++ -c -std=c++17 -o test test.cpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1
I[13:30:52.186] --> textDocument/clangd.fileStatus
I[13:30:52.186] --> textDocument/clangd.fileStatus
I[13:30:52.187] --> textDocument/clangd.fileStatus
I[13:30:52.204] --> textDocument/publishDiagnostics
I[13:30:52.205] --> textDocument/clangd.fileStatus
I[13:30:54.134] <-- textDocument/semanticTokens/full/delta(6)
I[13:30:54.134] --> reply:textDocument/semanticTokens/full/delta(6) 0 ms
I[13:30:54.134] --> textDocument/clangd.fileStatus
I[13:30:55.580] <-- textDocument/didChange
I[13:30:55.580] --> textDocument/clangd.fileStatus
I[13:30:55.630] ASTWorker building file /home/alexey/test2/test.cpp version 12 with command
[/home/alexey/test2]
/usr/bin/g++ --driver-mode=g++ -c -std=c++17 -o test test.cpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1
I[13:30:55.632] --> textDocument/clangd.fileStatus
I[13:30:55.632] --> textDocument/clangd.fileStatus
I[13:30:55.633] --> textDocument/clangd.fileStatus
I[13:30:55.655] --> textDocument/publishDiagnostics
I[13:30:55.655] --> textDocument/clangd.fileStatus
I[13:30:56.162] <-- textDocument/didChange
I[13:30:56.162] --> textDocument/clangd.fileStatus
I[13:30:56.213] ASTWorker building file /home/alexey/test2/test.cpp version 13 with command
[/home/alexey/test2]
/usr/bin/g++ --driver-mode=g++ -c -std=c++17 -o test test.cpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1
I[13:30:56.215] --> textDocument/clangd.fileStatus
I[13:30:56.215] --> textDocument/clangd.fileStatus
I[13:30:56.216] --> textDocument/clangd.fileStatus
I[13:30:56.246] --> textDocument/publishDiagnostics
I[13:30:56.247] --> textDocument/clangd.fileStatus
I[13:30:56.341] <-- textDocument/didChange
I[13:30:56.342] --> textDocument/clangd.fileStatus
I[13:30:56.392] ASTWorker building file /home/alexey/test2/test.cpp version 14 with command
[/home/alexey/test2]
/usr/bin/g++ --driver-mode=g++ -c -std=c++17 -o test test.cpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.1
I[13:30:56.394] --> textDocument/clangd.fileStatus
I[13:30:56.394] --> textDocument/clangd.fileStatus
I[13:30:56.395] --> textDocument/clangd.fileStatus
I[13:30:56.421] --> textDocument/publishDiagnostics
I[13:30:56.425] --> textDocument/clangd.fileStatus
I[13:30:58.342] <-- textDocument/semanticTokens/full/delta(7)
I[13:30:58.342] --> reply:textDocument/semanticTokens/full/delta(7) 0 ms
I[13:30:58.342] --> textDocument/clangd.fileStatus
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 6
- Comments: 17 (1 by maintainers)
Commits related to this issue
- fix(semanticTokens): replace instead of delete data fix https://github.com/clangd/coc-clangd/issues/298 — committed to kevinhwang91/coc.nvim by kevinhwang91 3 years ago
- fix(semanticTokens): replace data instead of delete fix https://github.com/clangd/coc-clangd/issues/298 — committed to kevinhwang91/coc.nvim by kevinhwang91 3 years ago
- fix(semanticTokens): replace data instead of delete (#3310) fix https://github.com/clangd/coc-clangd/issues/298 — committed to neoclide/coc.nvim by kevinhwang91 3 years ago
I’m using NVIM 0.5.0 with treesitter for syntax highlighting and I fixed the issue by setting:
in coc-settings.json.
Upgrade your coc to latest and set
"coc.preferences.semanticTokensHighlights": false
will disable semanticTokens to use old sematicHiglighting protocol.This simply disables the feature that this bug report is open for.
Yeah, I see, it is not needed anymore and I uninstalled it. Anyway, the issue is reproducible with
Coc + Clangd
only.This is why I enclosed the word “fixed” in quotes.
I was thinking that for some reason the default color where causing this issue so i updated coc and manually assigned my theme colors to every token, the same exact behavior happens, I would not say the issue is fixed.
I don’t work on the project, but I’m almost sure that
LspCxxHighlight
has noting more to do with syntax highlighting since now is fully handled by coc and cland. I even uninstalled the plugin considering that cland only sends semanticTokens