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

query: invalid structure at position 538 for language tsx #5171

Closed
arantebw opened this issue Jul 29, 2023 · 2 comments
Closed

query: invalid structure at position 538 for language tsx #5171

arantebw opened this issue Jul 29, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@arantebw
Copy link

Describe the bug

Error detected while processing function <SNR>52_NetrwBrowseChgDir[197]..BufReadPost Autocommands for "*":                                                                                                                                      
Error executing lua callback: ...brew/Cellar/neovim/0.9.0/share/nvim/runtime/filetype.lua:21: Error executing lua: ...brew/Cellar/neovim/0.9.0/share/nvim/runtime/filetype.lua:22: function <SNR>52_NetrwBrowseChgDir[197]..BufReadPost Autocomm
ands for "*"..FileType Autocommands for "*": Vim(append):Error executing lua callback: ...im/0.9.0/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid structure at position 538 for language tsx                               
stack traceback:                                                                                                                                                                                                                                
        [C]: in function '_ts_parse_query'                                                                                                                                                                                                      
        ...im/0.9.0/share/nvim/runtime/lua/vim/treesitter/query.lua:259: in function 'get_query'                                                                                                                                                
        ...cker/start/nvim-treesitter/lua/nvim-treesitter/query.lua:108: in function 'get_query'                                                                                                                                                
        ...m/site/pack/packer/start/nvim-ts-rainbow/lua/rainbow.lua:8: in function 'is_supported'                                                                                                                                               
        ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:387: in function 'is_enabled'                                                                                                                                               
        ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:507: in function 'attach_module'                                                                                                                                            
        ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:532: in function 'reattach_module'                                                                                                                                          
        ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:133: in function <...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:132>                                                                                          
        [C]: in function 'nvim_cmd'                                                                                                                                                                                                             
        ...brew/Cellar/neovim/0.9.0/share/nvim/runtime/filetype.lua:22: in function <...brew/Cellar/neovim/0.9.0/share/nvim/runtime/filetype.lua:21>                                                                                            
        [C]: in function 'nvim_buf_call'                                                                                                                                                                                                        
        ...brew/Cellar/neovim/0.9.0/share/nvim/runtime/filetype.lua:21: in function <...brew/Cellar/neovim/0.9.0/share/nvim/runtime/filetype.lua:10>                                                                                            
stack traceback:                                                                                                                                                                                                                                
        [C]: in function 'nvim_cmd'                                                                                                                                                                                                             
        ...brew/Cellar/neovim/0.9.0/share/nvim/runtime/filetype.lua:22: in function <...brew/Cellar/neovim/0.9.0/share/nvim/runtime/filetype.lua:21>                                                                                            
        [C]: in function 'nvim_buf_call'                                                                                                                                                                                                        
        ...brew/Cellar/neovim/0.9.0/share/nvim/runtime/filetype.lua:21: in function <...brew/Cellar/neovim/0.9.0/share/nvim/runtime/filetype.lua:10>                                                                                            
stack traceback:                                                                                                                                                                                                                                
        [C]: in function 'nvim_buf_call'                                                                                                                                                                                                        
        ...brew/Cellar/neovim/0.9.0/share/nvim/runtime/filetype.lua:21: in function <...brew/Cellar/neovim/0.9.0/share/nvim/runtime/filetype.lua:10>

Whenever I open a new *.tsx file buffer, I encounter the error above.

To Reproduce

Simply open any *.tsx file.

Expected behavior

Whenever I open a new *.tsx file, I will not encounter that error.

Output of :checkhealth nvim-treesitter

==============================================================================
nvim-treesitter: require("nvim-treesitter.health").check()

Installation ~
- OK `tree-sitter` found 0.20.8 (parser generator, only needed for :TSInstallFromGrammar)
- OK `node` found v16.20.0 (only needed for :TSInstallFromGrammar)
- OK `git` executable found.
- OK `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
  Version: Apple clang version 14.0.3 (clang-1403.0.22.14.1)
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

OS Info:
{
  machine = "arm64",
  release = "22.5.0",
  sysname = "Darwin",
  version = "Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:23 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6020"
} ~

Parser/Features         H L F I J
  - bash                ✓ ✓ ✓ . ✓
  - c                   ✓ ✓ ✓ ✓ ✓
  - css                 ✓ . ✓ ✓ ✓
  - java                ✓ ✓ ✓ ✓ ✓
  - javascript          ✓ ✓ ✓ ✓ ✓
  - json                ✓ ✓ ✓ ✓ .
  - lua                 ✓ ✓ ✓ ✓ ✓
  - markdown            ✓ . ✓ ✓ ✓
  - markdown_inline     ✓ . . . ✓
  - python              ✓ ✓ ✓ ✓ ✓
  - query               ✓ ✓ ✓ ✓ ✓
  - rust                ✓ ✓ ✓ ✓ ✓
  - tsx                 ✓ ✓ ✓ ✓ ✓
  - typescript          ✓ ✓ ✓ ✓ ✓
  - vim                 ✓ ✓ ✓ . ✓
  - vimdoc              ✓ . . . ✓
  - yaml                ✓ ✓ ✓ ✓ ✓

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang} ~


### Output of `nvim --version`

```text
NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.0/share/nvim"

Run :checkhealth for more info


### Additional context

I encountered this error after updating my plugins installed via `:Mason` and then running `:PackerSync`.
@arantebw arantebw added the bug Something isn't working label Jul 29, 2023
@clason
Copy link
Contributor

clason commented Jul 29, 2023

Duplicate of #3092

@clason clason marked this as a duplicate of #3092 Jul 29, 2023
@clason clason closed this as not planned Won't fix, can't repro, duplicate, stale Jul 29, 2023
@mgramigna
Copy link
Contributor

For me, it was actually nvim-ts-rainbow causing this error, not nvim-treesitter.

As @clason said in #5114, check out other treesitter-related plugins that might be doing some queries for tsx. Those might contain the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants