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.23k stars 53 forks source link

Do not rely on nvim-treesitter module system #201

Open ofseed opened 5 months ago

ofseed commented 5 months ago

The nvim-treesitter has an experimental main branch, which will be the default in the future. It dropped the module system, so the following code https://github.com/RRethy/vim-illuminate/blob/82aae86241aee16812741f2f4bf0dbd124c01de2/plugin/illuminate.vim#L15-L22 will not be valid anymore.

Some APIs were built-in by vim.treesitter and will be removed from the main branch of nvim-treesitter, so the following API https://github.com/RRethy/vim-illuminate/blob/5eeb7951fc630682c322e88a9bbdae5c224ff0aa/lua/illuminate/providers/treesitter.lua#L1-L1 https://github.com/RRethy/vim-illuminate/blob/5eeb7951fc630682c322e88a9bbdae5c224ff0aa/lua/illuminate/providers/treesitter.lua#L9-L9 has an equivalent API, vim.treesitter.get_node().

Many plugins already support the nvim-treesitter main branch because it could be compatible with the mainstream master branch, and I noticed that it should not need much work for this plugin to be compatible with the main branch. Since the main branch will be the default in the future, it would be better if this plugin supports it faster.

RRethy commented 5 months ago

Yea, I've been aware of this for some time I just haven't found the time to implement it. I'm open to PRs which fix this if you have time to spare. Eventually I'll get to it, just not sure when.