question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Syntax highlighting is broken with latest coc.nvim version.

See original GitHub issue

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: Peek 2021-07-10 13-31

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
kostiskalkounoscommented, Jul 10, 2021

I’m using NVIM 0.5.0 with treesitter for syntax highlighting and I fixed the issue by setting:

"coc.preferences.semanticTokensHighlights": false 

in coc-settings.json.

9reactions
fannheywardcommented, Aug 12, 2021

Upgrade your coc to latest and set"coc.preferences.semanticTokensHighlights": false will disable semanticTokens to use old sematicHiglighting protocol.

Read more comments on GitHub >

github_iconTop Results From Across the Web

neoclide/coc.nvim - Gitter
Hi I am having trouble with Coc go-to-definition. Syntax highlighting breaks in the new pane, and in the case of it being one...
Read more >
NeoVim: Broken Syntax Highlighting after heredoc "lua ...
I'm facing the problem that my init.vim becomes not highlighted properly after the line with lua << EOF in NeoVim. The weird behaviour...
Read more >
User Manual - rust-analyzer
At its core, rust-analyzer is a library for semantic analysis of Rust code as it changes over time. This manual focuses on a...
Read more >
coc-highlight - Vim Awesome
Q: Why color highlight is not shown on my vim? A: First, make sure "coc.preferences.colorSupport" is not false in your coc-settings.json ...
Read more >
[vim/vim] [proposal] Can we introduce TextMate grammar ...
The current syntax highlighting system is very slow, and there are ... source code in two processes (vim/treesitter) are the same, coc/nvim-treesitter sends ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found