RRethy / vim-illuminate

illuminate.vim - (Neo)Vim plugin for automatically highlighting other uses of the word under the cursor using either LSP, Tree-sitter, or regex matching.
2.14k stars 47 forks source link

HTML / React JSX highlighting more than just the tag using LSP #97

Closed yngwi closed 2 years ago

yngwi commented 2 years ago

Describe the bug When using vim-illuminate i Neovim with LSP attached, in specific circumstances there is more than just the tag "name" highlighted, additional whitespace is highlighted. It doesn't happen for all tags, I'm not sure what the reasons are specifically, but the problem vanishes if the LSP integration is not added, then just the tag names are highlighted because (I guess) illuminate just compares strings.

Screenshots Correct: image Incorrect: image

RRethy commented 2 years ago

You need to provide more information about your configuration, this is not enough information to action on.

yngwi commented 2 years ago

Hi, sorry for not providing a minimal config earlier. I had to think on how to do it. I have now tried to create one, I have added the necessary files here:

https://gist.github.com/yngwi/fad735ec72f33fe9c378615db8c9b023

The config includes tokyo night theme, some plugins to get a typescript language server running, indentline (seems to be related to the problem) and vim-illuminate. It also includes a React file that shows the problem if positioned in a folder with a package.json so the language server gets started.

Here is a screenshot that shows the issue: image

If I remove indentline, the highlight works as intended. It also seems that if I remove vim.opt.relativenumber = true then it also works as expected. I'm not sure how to describe the issue better. Sorry. Thank you!

RRethy commented 2 years ago

That's not a minimal init.lua, and this doesn't seem like an issue with vim-illuminate. Your screenshot is showing two different highlight colours, however, vim-illuminate only uses a single highlight colour so the scope highlighting must be coming from a different plugin or part of your config. I would recommend either opening an issue in indentblankline or reducing the size of your minimal init.lua to create a useful minimal init.lua.

yngwi commented 2 years ago

OK thank you.