Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in decoration provider treesitter/highlighter.line: #46

Closed
AlexSWall opened this issue Jan 28, 2024 · 12 comments
Closed

Error in decoration provider treesitter/highlighter.line: #46

AlexSWall opened this issue Jan 28, 2024 · 12 comments

Comments

@AlexSWall
Copy link

Opening the latest Neovim to various files (e.g. lua, fish, etc.) results in the following error, and disabling neodim fixes it.

Error in decoration provider treesitter/highlighter.line:
Error executing lua: ....local/share/nvim/lazy/neodim/lua/neodim/ts_override.lua:20: attempt to call method 'get_highlight_state' (a nil value)
stack traceback:
        ....local/share/nvim/lazy/neodim/lua/neodim/ts_override.lua:20: in function 'fn'
        ...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:489: in function 'for_each_tree'
        ....local/share/nvim/lazy/neodim/lua/neodim/ts_override.lua:14: in function 'on_line_impl'
        ....local/share/nvim/lazy/neodim/lua/neodim/ts_override.lua:95: in function <....local/share/nvim/lazy/neodim/lua/neodim/ts_override.lua:89>
@mxf13
Copy link

mxf13 commented Feb 6, 2024

Maybe you should care about the version

@carmarfee
Copy link

I am having the same question:(

@futsuuu
Copy link
Collaborator

futsuuu commented Apr 5, 2024

@carmarfee
Can you show me the error message and the output of nvim --version?

@carmarfee
Copy link

carmarfee commented Apr 5, 2024

@futsuuu
nvim0.9.5
sorry,i don't know how to show the entire error message,but it shows the same error as the man
Screenshot 2024-04-05 210403
image

@carmarfee
Copy link

carmarfee commented Apr 5, 2024

@futsuuu
okay,i have tried my best and it does bother me a lot ,it seems that i can't find where the function"highlighter:for_each_highlight_state" is, and is that the problem?

@futsuuu
Copy link
Collaborator

futsuuu commented Apr 6, 2024

@carmarfee
This plugin requires Neovim v0.10.0. Please use nightly version.

@carmarfee
Copy link

carmarfee commented Apr 6, 2024

@futsuuu
emm...,this was so annoying that i deleted your plugin,but now i'll think about downloading it back,anyway,thanks for your kindness!

@zbirenbaum
Copy link
Owner

Keep in mind this plugin was made back when LSP support for unused variables was nowhere near what it is now. This plugin is likely not super useful for most languages anymore due to semantic tokens and is probably due to be archived soon.

I'm happy to keep it around if you think that it still has a use case @futsuuu but figured I'd let my thoughts be known

@AlexSWall
Copy link
Author

AlexSWall commented Apr 6, 2024

Neovim v0.10 hasn't even been released, so making it a dependency of neodim's master feels premature.

It's probably worth putting into the README the tag, commit, etc. to use for those on the latest released version (v0.9.5).

@Dav1nGen
Copy link

Dav1nGen commented May 27, 2024

@futsuuu nvim0.9.5 sorry,i don't know how to show the entire error message,but it shows the same error as the man Screenshot 2024-04-05 210403 image

@carmarfee
I had the same problem as you, and I just successfully solved it

Different from yours, my neovim version is 0.10.0. I found out that the reason why I had this bug was that my lazy pulled a non-latest version of neodim. So the problem is most likely caused by the version matching between neovim and neodim.

Considering that your neovim version is 0.9, I guess it is because you pulled the latest version of neodim that caused your problem. My suggestion is that you can delete ~/.local/share/nvim/site/lazy/neodim manually pull the old version of neodim

@yinghaoyu
Copy link

My neovim version is 0.10, I had the same problem:

Error in decoration provider treesitter/highlighter.line:
Error executing lua: ...l/share/nvim/site/lazy/neodim/lua/neodim/ts_override.lua:21: attempt to cal
l method 'get_highlight_state' (a nil value)
stack traceback:
        ...l/share/nvim/site/lazy/neodim/lua/neodim/ts_override.lua:21: in function 'fn'
        ...r/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:491: in function 'for_each_tree
'
        ...l/share/nvim/site/lazy/neodim/lua/neodim/ts_override.lua:15: in function 'on_line_impl'
        ...l/share/nvim/site/lazy/neodim/lua/neodim/ts_override.lua:96: in function <...l/share/nvi
m/site/lazy/neodim/lua/neodim/ts_override.lua:90>

@futsuuu
Copy link
Collaborator

futsuuu commented Jun 26, 2024

@yinghaoyu Please update neodim.

@futsuuu futsuuu closed this as completed Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants