Closed wavded closed 3 years ago
Yes, something is quite wrong.
I quickly hacked together a TypeScript file with your statements and had no issue, the let
local variables were coloured white rather than faded grey.
A couple suggestions:
Install the nvim-treesitter/playground plugin and then place the cursor on top of the greyed-out variables and then do :TSHighlightCapturesUnderCursor
. Let me know what you get.
Temporarily disable COC and see what that does.
Can you provide me access that TypeScript file so I can experiment.
Strange one.
Install the nvim-treesitter/playground plugin and then place the cursor on top of the greyed-out variables and then do :TSHighlightCapturesUnderCursor. Let me know what you get.
Temporarily disable COC and see what that does.
It goes back to white
text!
Can you provide me access that TypeScript file so I can experiment.
Basically any unused variable, so a file with just this:
for (let t of ts) {
}
Would gray out the t
.
I'm going to look into coc.nvim more, seems like that did cause the issue.
Looks like its using CocUnusedHighlight:
Adding this to my init.vim
seems to fix it, doesn't seem like a great long term solution but works:
hi link CocUnusedHighlight TSVariable
Thanks for debugging this.
It is confirmed that CoC is overlaying its own highlighting over the top of Treesitter. I strongly believe this is not wanted, it does more harm than good especially since Treesitter does excellent highlighting by itself.
Quickly looking at CoC documentation lists these two options that you should experiment with:
g:coc_default_semantic_highlight_groups = 0
, this should already be defaulted to off in newer versions of CoC. Please double check at your end that symantic highlighting is disabled.
coc.preferences.colorSupport, this appears to be defaulted to true. This could be the problem. Please set this to false and try again.
Let me know which one works, I will then update the README here noting that CoC users should disable semantic highlighting or CoC color support.
Cheers.
@wavded,
Any updates on this? Did you manage to disable CoC highlighting?
Cheers.
@bluz71 I just attempted these things:
g:coc_default_semantic_highlight_groups = 0, this should already be defaulted to off in newer versions of CoC. Please double check at your end that symantic highlighting is disabled.
Setting this to 0
didn't make a difference.
coc.preferences.colorSupport, this appears to be defaulted to true. This could be the problem. Please set this to false and try again.
Setting this to false
also did not make a difference.
Seems the only thing that works so far is hi link CocUnusedHighlight TSVariable
in my init.vim.
This genuinely seems like a fault with CoC.
It should not be highlighting anything if you do not want it to. If I were you I would open up an issue at the CoC issue tracker. This is very annoying of CoC, it is doing way too much, it seems silly of them to also be doing highlighting.
But it is up to you. If you gather some information, please let me know.
Closing this since this is a CoC issue. CoC should offer a working option to completely disable their own unwanted highlighting.
Another user has reported this Coc issue.
Hence, in this colorscheme I now link CocUnusedHighlight
to White. So you shouldn't need your own link-fix anymore.
Are there any other Coc highlight issues I need to fix?
Thx for the fix @bluz71, mine works well now without the fix I did. I haven't noticed any other issues.
I'm running into this issue
Testing other languages seems to be fine in this case. I'm using coc.nvim. I am using tree-sitter and do not have any other specific syntax plugins for TypeScript. Could something be interfering?