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.12k stars 44 forks source link

Support concurrent providers (tree-sitter language injection) #188

Closed JeanMertz closed 6 months ago

JeanMertz commented 6 months ago

I have a Nix document in which I have a string prefixed with a comment /* lua */, this enables Tree-sitter's language injection, which allows the string to be properly highlighted as Lua code, and also allows other Tree-sitter-enabled features (such as operating over textobjects).

If I configure vim-illuminate's providers configuration to use treesitter, this works as expected, but if I have lsp listed before it, then it will use the LSP provider in the Nix document, since I have that LSP available, but will not fall back to tree-sitter inside the injected language block.

I would appreciate it if this were possible, since disabling the LSP provider does limit the plugin's capabilities in the "main" document I'm navigating.

RRethy commented 6 months ago

I understand the use-case, but the changes required for this are too large so it's not something I would implement. If you want to open a PR, I can reopen this issue, but for now I'm going to close it as unplanned.