You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: this is a pinned issue as target for non-bug reports due to outdated parsers or queries
What happens
After updating, highlights are broken for some or all languages with an error message like
treesitter/highlighter: error executing lua: /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:172: query: invalid node type at position 765
Why this happens
After an update to nvim-treesitter or a related plugin, you have updated queries but not the corresponding parser (or vice versa), but queries are only compatible with specific parser versions, leading to errors if they no longer match.
What can I do
First, make sure that nvim-treesitter is updated to the latest commit and run :TSUpdate manually.
If the error persists, remove nvim-treesitter completely and reinstall it together with all parsers.
If the error still persists, run :checkhealth and note down the languages for which you see errors (an x in the list of languages, and explicitly listed below that). For each language (hereafter denoted by <lang>), repeat the following steps
:TSInstall! <lang> and restart Neovim; if the error persists, continue.
Run the following commands and note down the output:
If either of these lists contain a directory that is not a subdirectory of nvim-treesitter, remove that directory (and, if it is another plugin, report the issue at the corresponding repository).
UPDATE Since 0.9.0, Neovim bundles parsers and queries for c, lua, vim, vimdoc, and markdown. If you use nvim-treesitter, you must make sure these parsers are installed via nvim-treesitter so that both parser and queries (which are always installed) are taken from nvim-treesitter. (It's important for this that your nvim-treesitter plugin directory comes before both /usr/local/share/nvim/* and /usr/lib/nvim in your runtimepath.)
The text was updated successfully, but these errors were encountered:
clason
changed the title
Highlights broken after update with query: invalid node type
Highlights broken after update with query: invalid structureAug 16, 2023
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
highlightsIssues or PRs about highlighting queriesinvalidThis doesn't seem right
Note: this is a pinned issue as target for non-bug reports due to outdated parsers or queries
What happens
After updating, highlights are broken for some or all languages with an error message like
Why this happens
After an update to
nvim-treesitter
or a related plugin, you have updated queries but not the corresponding parser (or vice versa), but queries are only compatible with specific parser versions, leading to errors if they no longer match.What can I do
First, make sure that
nvim-treesitter
is updated to the latest commit and run:TSUpdate
manually.If the error persists, remove
nvim-treesitter
completely and reinstall it together with all parsers.If the error still persists, run
:checkhealth
and note down the languages for which you see errors (anx
in the list of languages, and explicitly listed below that). For each language (hereafter denoted by<lang>
), repeat the following steps:TSInstall! <lang>
and restart Neovim; if the error persists, continue.nvim-treesitter
, remove that directory (and, if it is another plugin, report the issue at the corresponding repository).UPDATE Since 0.9.0, Neovim bundles parsers and queries for
c
,lua
,vim
,vimdoc
, andmarkdown
. If you use nvim-treesitter, you must make sure these parsers are installed via nvim-treesitter so that both parser and queries (which are always installed) are taken from nvim-treesitter. (It's important for this that yournvim-treesitter
plugin directory comes before both/usr/local/share/nvim/*
and/usr/lib/nvim
in yourruntimepath
.)The text was updated successfully, but these errors were encountered: