tree-sitter / tree-sitter-typescript

TypeScript grammar for tree-sitter
MIT License
360 stars 109 forks source link

Query: invalid node type at position 3318 #220

Closed captainko closed 2 years ago

captainko commented 2 years ago

Typescript often throws the following error:

Error executing vim.schedule lua callback:

Error detected while processing FileType Autocommands for "*":
Error executing lua callback: /usr/local/share/nvim/runtime/lua/vim/treesitter/query.lua:174: query: invalid node type at position 3318
stack traceback:
    [C]: in function '_ts_parse_query'
    /usr/local/share/nvim/runtime/lua/vim/treesitter/query.lua:174: in function 'get_query'
    ...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:36: in function 'new'
    /usr/local/share/nvim/runtime/lua/vim/treesitter.lua:46: in function '_create_parser'
    /usr/local/share/nvim/runtime/lua/vim/treesitter.lua:98: in function 'get_parser'
    .../start/nvim-treesitter/lua/nvim-treesitter/highlight.lua:155: in function 'start'
    .../start/nvim-treesitter/lua/nvim-treesitter/highlight.lua:161: in function 'attach'
    ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:477: in function 'attach_module'
    ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:500: in function 'reattach_module'
    ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:108: in function <...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:107>

Neovim version:

NVIM v0.8.0-dev-973-g253f0ffd8
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by cko@mark

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/share/nvim"

Run :checkhealth for more info
jtye-dsldhomes commented 2 years ago

I've been receiving this error for 2 days. I tried with a known working version of nvim nightly:

NVIM v0.8.0-dev-805-g512e0441f

hendrikvanantwerpen commented 2 years ago

This looks like a problem in either neovim or nvim-treesitter. The error says tree-sitter is given a query that doesn't match the grammar (because of an invalid node name). It looks like the grammar was updated but not the corresponding queries. I suggest filing a bug report in one of those projects.

catgoose commented 2 years ago

This seems to be a problem with tree-sitter-angular:

https://github.com/nvim-treesitter/nvim-treesitter-angular/issues/3