zbirenbaum/neodim

Plugin may be obsolete since Neovim nightly highlights `DiagnosticUnnecessary`

Closed this issue · 3 comments

Gelio commented

Hey! Thanks for creating this plugin. I recently switched to it from https://github.com/0oAstro/dim.lua and it worked well for me. I appreciate your focus on performance and low overhead

Today I switched to the V2 branch (#24 ). I started debugging why unused symbols no longer have an undercurl, and after using :Inspect I noticed that they are highlighted by Neovim with the DiagnosticUnnecessary highlight group:

image

I then disabled neodim and it turns out that indeed unused symbols are still highlighted with the Comment highlight group. It seems Neovim started supporting this natively in neovim/neovim#22747

I can confirm I get unused symbols highlighted with Comment highlight group with the following language servers:

  • tsserver
  • rust_analyzer
  • lua_language_server
  • gopls

I suggest adding this information to the readme so others can choose whether to install this plugin or use default Neovim behavior.

Hi Galio, thank you for the feedback. I'll add an exclude field to the config which will allow disabling neodim for certain LSPs. Semantic tokens introduced a lot of changes and bugs which was one of the big motivations for V2.

There is a bug, in that it seems to be occurring for all diagnostics in some scenarios, I also noticed this a bit ago. It's a bit late here but I'll put out a fix for this in the morning. It seems to be happening with some LSPs and not others so it escaped my attention for a whole, sorry about that.

To be clear though, this hasn't been added to neovim core at all, it is just a feature of semantic tokens, and implemented inconsistently across LSPs even among the ones which have semantic token capabilities to my knowledge.

Gelio commented

Interesting, looks like I debugged it wrong, then. Treat this issue as a bug report for lack of undercurl, then 😅 Thanks for your attention and quick reply

just pushed an update which fixes v2 behavior as far as i can tell and adds a field for filetype based disabling of the plugin. Try it out and let me know your thoughts.