nvim-neorocks / rocks-treesitter.nvim

A "just works" tree-sitter setup for rocks.nvim!
GNU General Public License v3.0
36 stars 4 forks source link

Could not load Rockspec file error when trying to active parsers #26

Closed alexanderjeurissen closed 2 months ago

alexanderjeurissen commented 3 months ago

Recently I've been running into issues where the highlighting does no trigger. Sometimes reloading the file with :edit works but sometimes it doesnt.

Rocks log shows the following output:

[START][2024-08-09 10:10:54] rocks.nvim logging initiated
ERROR | 2024-08-09 10:11:36 | ....local/share/nvim/rocks/rocks_rtp/lua/rocks/luarocks.lua:65 | luarocks CLI FAILED
ERROR | 2024-08-09 10:11:36 | ....local/share/nvim/rocks/rocks_rtp/lua/rocks/luarocks.lua:66 | 
Error: Could not load rockspec file /Users/alexander/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/tree-sitter-ecma/0.0.2-1/tree-sitter-ecma-0.0.2-1.rockspec (/Users/alexander/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/tree-sitter-ecma/0.0.2-1/tree-sitter-ecma-0.0.2-1.rockspec: No such file or directory)

ERROR | 2024-08-09 10:11:36 | ...er/.local/share/nvim/rocks/rocks_rtp/lua/rocks/state.lua:106 | Could not get dependencies for rock tree-sitter-ecma: 
Error: Could not load rockspec file /Users/alexander/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/tree-sitter-ecma/0.0.2-1/tree-sitter-ecma-0.0.2-1.rockspec (/Users/alexander/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/tree-sitter-ecma/0.0.2-1/tree-sitter-ecma-0.0.2-1.rockspec: No such file or directory)

ERROR | 2024-08-09 10:11:36 | ...er/.local/share/nvim/rocks/rocks_rtp/lua/rocks/state.lua:115 | ...er/.local/share/nvim/rocks/share/lua/5.1/nio/control.lua:145: Could not get dependencies for rock tree-sitter-ecma: 
Error: Could not load rockspec file /Users/alexander/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/tree-sitter-ecma/0.0.2-1/tree-sitter-ecma-0.0.2-1.rockspec (/Users/alexander/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/tree-sitter-ecma/0.0.2-1/tree-sitter-ecma-0.0.2-1.rockspec: No such file or directory)

ERROR | 2024-08-09 10:11:42 | ....local/share/nvim/rocks/rocks_rtp/lua/rocks/luarocks.lua:65 | luarocks CLI FAILED
ERROR | 2024-08-09 10:11:42 | ....local/share/nvim/rocks/rocks_rtp/lua/rocks/luarocks.lua:66 | 
Error: Could not load rockspec file /Users/alexander/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/tree-sitter-jsx/0.0.2-1/tree-sitter-jsx-0.0.2-1.rockspec (/Users/alexander/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/tree-sitter-jsx/0.0.2-1/tree-sitter-jsx-0.0.2-1.rockspec: No such file or directory)

ERROR | 2024-08-09 10:11:42 | ...er/.local/share/nvim/rocks/rocks_rtp/lua/rocks/state.lua:106 | Could not get dependencies for rock tree-sitter-jsx: 
Error: Could not load rockspec file /Users/alexander/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/tree-sitter-jsx/0.0.2-1/tree-sitter-jsx-0.0.2-1.rockspec (/Users/alexander/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/tree-sitter-jsx/0.0.2-1/tree-sitter-jsx-0.0.2-1.rockspec: No such file or directory)

ERROR | 2024-08-09 10:11:42 | ...er/.local/share/nvim/rocks/rocks_rtp/lua/rocks/state.lua:115 | ...er/.local/share/nvim/rocks/share/lua/5.1/nio/control.lua:145: Could not get dependencies for rock tree-sitter-jsx: 
Error: Could not load rockspec file /Users/alexander/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/tree-sitter-jsx/0.0.2-1/tree-sitter-jsx-0.0.2-1.rockspec (/Users/alexander/.local/share/nvim/rocks/lib/luarocks/rocks-5.1/tree-sitter-jsx/0.0.2-1/tree-sitter-jsx-0.0.2-1.rockspec: No such file or directory)
mrcjkb commented 3 months ago

Hey 👋 Have you tried reinstalling the parsers?

alexanderjeurissen commented 3 months ago

I did, and it somehow did not fix the issue.

Then I tried installing the jsx, ecma and javascript parsers as well and that seemed to work. It might be because somehow my .tsx files get the filetype: typescriptreact

Even when using the mapping and strictly setting it to tsx in rocks.toml did not fix it, but installing all of the aforementioned additional parsers did.

🤔

mrcjkb commented 3 months ago

So this only affects .tsx files?

alexanderjeurissen commented 2 months ago

It seems so yes, not sure what is happening here. It looks to me that some of these other parers might be dependencies for one another 🤔

Regardless the issue is solved now on my end so I think we can close this issue.