nvim-neorocks / rocks-treesitter.nvim

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

Fails to install parser on nvim nightly #33

Closed Nsidorenco closed 2 weeks ago

Nsidorenco commented 2 weeks ago

Hi :)

When installing a new parser through the prompt the following error is thrown:

Error executing vim.schedule lua callback: .../nvim/rocks/rocks_rtp/lua/rocks_treesitter/highlight.lua:100: attempt to compare table with nil                                                               
stack traceback:                                                                                                                                                                                            
        .../nvim/rocks/rocks_rtp/lua/rocks_treesitter/highlight.lua:100: in function 'f'                                                                                                                    
        ...im-unwrapped-nightly/share/nvim/runtime/lua/vim/iter.lua:499: in function 'fold'                                                                                                                 
        .../nvim/rocks/rocks_rtp/lua/rocks_treesitter/highlight.lua:88: in function 'prompt_auto_install'                                                                                                   
        .../nvim/rocks/rocks_rtp/lua/rocks_treesitter/highlight.lua:124: in function <.../nvim/rocks/rocks_rtp/lua/rocks_treesitter/highlight.lua:123> 

This example is specifically for install the nix parser but the issues is general.

Configuration

{
  treesitter = {
    auto_highlight = "all",
    auto_install = "prompt"
  }
}

I believe this is due to [vim.version.parse returning nil on invalid inputs](https://neovim.io/doc/user/lua.html#vim.version.parse()) but the code expects it to throw an error, since it is wrapped in a pcall

mrcjkb commented 2 weeks ago

hey 👋

thanks for reporting. I'll look into this when I'm near my laptop again. I'm on vacation right now, so nightly support is not my highest priority atm.

PRs are also welcome 😀