Closed koaledu closed 6 months ago
Does this happen after updating the plugin?
I updated the plugin as you said, and still get the second error message but after skipping it the syntax highlighting works fine.
The error message means that the parser was installed successfully, but that there are incompatible textobjects. Could you open https://github.com/nvim-treesitter/nvim-treesitter-textobjects/blob/ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a/queries/nim/textobjects.scm#L481 locally and let Neovim query linter show you what query in considers invalid.
:echo nvim_get_runtime_file('queries/nim/textobjects.scm', v:true)
and
:echo nvim_get_runtime_file('parser/nim.so', v:true)
might help you to see where the nim parser and the nim textobject queries are installed.
This appears to be an AstroNvim problem. I spun up a fresh copy of nvim with AstroNvim and noticed that the nvim-treesitter-textobjects
used was ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a, which does not have the updated nim queries.
The error message means that the parser was installed successfully, but that there are incompatible textobjects. Could you open
https://github.com/nvim-treesitter/nvim-treesitter-textobjects/blob/ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a/queries/nim/textobjects.scm#L481 locally and let Neovim query linter show you what query in considers invalid.
:echo nvim_get_runtime_file('queries/nim/textobjects.scm', v:true)
and
:echo nvim_get_runtime_file('parser/nim.so', v:true)
might help you to see where the nim parser and the nim textobject queries are installed.
I got this
['/home/mduardo/.local/share/nvim/lazy/nvim-treesitter-textobjects/queries/nim/textobjects.scm']
and
['/home/mduardo/.local/share/nvim/lazy/nvim-treesitter/parser/nim.so']
AstroNvim has finally updated their textobjects commit which should solve this problem, please test again.
Works flawlessly Thank y'all!
Describe the bug
Apparently the parser for the Nim programming language fails to compile, and produces unexpected behavior like an error message when opening a
.nim
file and unreliable syntax highlighting; sometimes it works and sometimes it doesn't, but the error message is always there.I'm not sure if it's a problem with the Neovim distro I'm using (AstroNvim) but I don't think it is, I installed other parsers and they installed perfectly and work flawlessly.
To Reproduce
Execute Neovim typing
nvim
on the terminalCreate or open a file with the
.nim
extensionType
:TSInstall nim
Get an error message
Exit Neovim pressing
:q!
Reopen the
.nim
file. The file sometimes has syntax highlighting, sometimes notGet an error message
Expected behavior
Expected
[nvim-treesitter] [1/1] Treesitter parser for nim has been installed
after completing step 3Complete syntax highlighting 100% of the times in step 6
Output of
:checkhealth nvim-treesitter
Output of
nvim --version
Additional context
My Neovim setup is AstroNvim.
This bug report was originally reported over here.