nvim-lua / kickstart.nvim

A launch point for your personal nvim configuration
MIT License
20.06k stars 24.42k forks source link

Error in `treesitter/query.lua` on fresh macOSX install #1074

Closed Iddodo closed 2 months ago

Iddodo commented 3 months ago

Describe the bug

Greeted with the following error as soon as I open a Lua file with neovim:

Error detected while processing BufReadPost Autocommands for "*":                                                                 
Error executing lua callback: ...rew/Cellar/neovim/0.10.1/share/nvim/runtime/filetype.lua:35: Error executing lua: ...rew/Cellar/n
eovim/0.10.1/share/nvim/runtime/filetype.lua:36: BufReadPost Autocommands for "*"..FileType Autocommands for "*"..function <SNR>1_
LoadFTPlugin[20]..script /opt/homebrew/Cellar/neovim/0.10.1/share/nvim/runtime/ftplugin/lua.lua: Vim(runtime):E5113: Error while c
alling lua chunk: ...m/0.10.1/share/nvim/runtime/lua/vim/treesitter/query.lua:252: Query error at 51:17. Invalid node type "string
_content":                                                                                                                        
      content: (string_content) @injection.content)))                                                                             
                ^                                                                                                                 

stack traceback:                                                                                                                  
        [C]: in function '_ts_parse_query'                                                                                        
        ...m/0.10.1/share/nvim/runtime/lua/vim/treesitter/query.lua:252: in function 'fn'                                         
        ...ovim/0.10.1/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'fn'                                          
        ...ovim/0.10.1/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'get'                                         
        ...1/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:128: in function 'new'                                        
        .../neovim/0.10.1/share/nvim/runtime/lua/vim/treesitter.lua:41: in function '_create_parser'                              
        .../neovim/0.10.1/share/nvim/runtime/lua/vim/treesitter.lua:108: in function 'get_parser'                                 
        .../neovim/0.10.1/share/nvim/runtime/lua/vim/treesitter.lua:416: in function 'start'                                      
        ...Cellar/neovim/0.10.1/share/nvim/runtime/ftplugin/lua.lua:2: in main chunk                                              
        [C]: in function 'nvim_cmd'                                                                                               
        ...rew/Cellar/neovim/0.10.1/share/nvim/runtime/filetype.lua:36: in function <...rew/Cellar/neovim/0.10.1/share/nvim/runtim
e/filetype.lua:35>                                                                                                                
        [C]: in function 'nvim_buf_call'                                                                                          
        ...rew/Cellar/neovim/0.10.1/share/nvim/runtime/filetype.lua:35: in function <...rew/Cellar/neovim/0.10.1/share/nvim/runtim
e/filetype.lua:10>                                                                                                                
stack traceback:                                                                                                                  
        [C]: in function 'nvim_cmd'                                                                                               
        ...rew/Cellar/neovim/0.10.1/share/nvim/runtime/filetype.lua:36: in function <...rew/Cellar/neovim/0.10.1/share/nvim/runtim
e/filetype.lua:35>                                                                                                                
        [C]: in function 'nvim_buf_call'                                                                                          
        ...rew/Cellar/neovim/0.10.1/share/nvim/runtime/filetype.lua:35: in function <...rew/Cellar/neovim/0.10.1/share/nvim/runtim
e/filetype.lua:10>                                                                                                                
stack traceback:                                                                                                                  
        [C]: in function 'nvim_buf_call'                                                                                          
        ...rew/Cellar/neovim/0.10.1/share/nvim/runtime/filetype.lua:35: in function <...rew/Cellar/neovim/0.10.1/share/nvim/runtim
e/filetype.lua:10>

Trying to open a TypeScript file, I get the following error:

Error in decoration provider treesitter/highlighter.win:                                                                          
Error executing lua: ...m/0.10.1/share/nvim/runtime/lua/vim/treesitter/query.lua:252: Query error at 52:2. Invalid node type "func
tion_expression":                                                                                                                 
(function_expression                                                                                                              
 ^                                                                                                                                

stack traceback:                                                                                                                  
        [C]: in function '_ts_parse_query'                                                                                        
        ...m/0.10.1/share/nvim/runtime/lua/vim/treesitter/query.lua:252: in function 'fn'                                         
        ...ovim/0.10.1/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'fn'                                          
        ...ovim/0.10.1/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'get'                                         
        ....1/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:28: in function 'new'                                         
        ....1/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:243: in function 'get_query'                                  
        ....1/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:191: in function 'fn'                                         
        ...1/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:491: in function 'for_each_tree'                              
        ....1/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:178: in function 'prepare_highlight_states'                   
        ....1/share/nvim/runtime/lua/vim/tree

To Reproduce

  1. Install the latest version of neovim provided by brew (0.10.1) on Sonoma 14.5
  2. install kickstart.nvim like so:
    cd ~/.config
    git clone https://github.com/nvim-lua/kickstart.nvim
    mv kickstart.nvim nvim
  3. Open some Lua file with neovim

Desktop

Neovim Version

NVIM v0.10.1                                                                                                                      
Build type: Release                                                                                                               
LuaJIT 2.1.1720049189
Efe-Torunoglu commented 3 months ago

I'm having the exact same issue

feoh commented 2 months ago

I'll try testing this on my mac later.

adrian-brady commented 2 months ago

Could this be from tsserver being deprecated (now should use ts_ls. see issue#1128)?

jrupinski commented 2 months ago

I tried reproducing it, it's fixed now it seems. I'm also on kitty. Rocking a fresh nvim and kickstart install withinit.lua that I later customized/accessed via built-in keymaps.

feoh commented 2 months ago

Same. Closing for now. Thanks for the report.