when testing highlighting on cpp file, got error:
treesitter/highlighter: Error executing lua: /use/share/nvim/runtime/lua/vim/treesitter/query.lua:557 No handler for has-ancestor? stack traceback: [C]: in function 'error' /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:557: in function 'match_preds'
WARNING tree-sitter executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
OK node found v18.19.1 (only needed for :TSInstallFromGrammar)
OK git executable found.
OK cc executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
Version: cc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.
OS Info:
{
machine = "x86_64",
release = "5.10.102.1-microsoft-standard-WSL2",
sysname = "Linux",
version = "#1 SMP Wed Mar 2 00:30:59 UTC 2022"
} ~
Parser/Features H L F I J
ada ✓ ✓ ✓ . ✓
agda ✓ . ✓ . ✓
angular ✓ ✓ ✓ ✓ ✓
apex ✓ ✓ ✓ . ✓
arduino ✓ ✓ ✓ ✓ ✓
asm ✓ . . . ✓
astro ✓ ✓ ✓ ✓ ✓
authzed ✓ . . . ✓
awk ✓ . . . ✓
bash ✓ ✓ ✓ . ✓
bass ✓ ✓ ✓ ✓ ✓
beancount ✓ . ✓ . ✓
bibtex ✓ . ✓ ✓ ✓
bicep ✓ ✓ ✓ ✓ ✓
bitbake ✓ ✓ ✓ ✓ ✓
blueprint ✓ . . . ✓
bp ✓ ✓ ✓ ✓ ✓
c ✓ ✓ ✓ ✓ ✓
c_sharp ✓ ✓ ✓ . ✓
cairo ✓ ✓ ✓ ✓ ✓
capnp ✓ ✓ ✓ ✓ ✓
chatito ✓ ✓ ✓ ✓ ✓
clojure ✓ ✓ ✓ . ✓
cmake ✓ . ✓ ✓ ✓
comment ✓ . . . .
commonlisp ✓ ✓ ✓ . ✓
cooklang ✓ . . . ✓
corn ✓ ✓ ✓ ✓ ✓
cpon ✓ ✓ ✓ ✓ ✓
cpp ✓ ✓ ✓ ✓ ✓
css ✓ . ✓ ✓ ✓
csv ✓ . . . .
cuda ✓ ✓ ✓ ✓ ✓
cue ✓ ✓ ✓ ✓ ✓
d ✓ ✓ ✓ ✓ ✓
dart ✓ ✓ ✓ ✓ ✓
devicetree ✓ ✓ ✓ ✓ ✓
dhall ✓ . ✓ . ✓
diff ✓ . ✓ . ✓
disassembly ✓ . . . ✓
djot ✓ ✓ ✓ ✓ ✓
dockerfile ✓ . . . ✓
dot ✓ . . ✓ ✓
doxygen ✓ . . ✓ ✓
dtd ✓ ✓ ✓ . ✓
earthfile ✓ . . . ✓
ebnf ✓ . . . ✓
editorconfig ✓ . ✓ . ✓
eds ✓ . ✓ . .
eex ✓ . . . ✓
elixir ✓ ✓ ✓ ✓ ✓
elm ✓ . ✓ . ✓
elsa ✓ ✓ ✓ ✓ ✓
elvish ✓ . . . ✓
embedded_template ✓ . . . ✓
erlang ✓ . ✓ . ✓
facility ✓ . ✓ ✓ ✓
faust ✓ . . . ✓
fennel ✓ ✓ ✓ . ✓
fidl ✓ . ✓ . ✓
firrtl ✓ ✓ ✓ ✓ ✓
fish ✓ ✓ ✓ ✓ ✓
foam ✓ ✓ ✓ ✓ ✓
forth ✓ ✓ ✓ ✓ ✓
fortran ✓ . ✓ ✓ ✓
fsh ✓ . . . ✓
fsharp ✓ . . . ✓
func ✓ . . . ✓
fusion ✓ ✓ ✓ ✓ ✓
gap ✓ ✓ ✓ . ✓
gaptst ✓ . ✓ . ✓
gdscript ✓ ✓ ✓ ✓ ✓
gdshader ✓ . . . ✓
git_config ✓ . ✓ . ✓
git_rebase ✓ . . . ✓
gitattributes ✓ ✓ . . ✓
gitcommit ✓ . . . ✓
gitignore ✓ . . . ✓
gleam ✓ ✓ ✓ ✓ ✓
glimmer ✓ ✓ ✓ ✓ ✓
glimmer_javascript ✓ ✓ . ✓ ✓
glimmer_typescript ✓ . . ✓ ✓
glsl ✓ ✓ ✓ ✓ ✓
gn ✓ ✓ ✓ ✓ ✓
gnuplot ✓ . . . ✓
go ✓ ✓ ✓ ✓ ✓
goctl ✓ . ✓ ✓ ✓
godot_resource ✓ ✓ ✓ . ✓
gomod ✓ . . . ✓
gosum ✓ . . . .
gotmpl ✓ ✓ ✓ . ✓
gowork ✓ . . . ✓
gpg ✓ . . . ✓
graphql ✓ . . ✓ ✓
gren ✓ . . . ✓
groovy ✓ ✓ ✓ ✓ ✓
gstlaunch ✓ . . . .
hack ✓ . . . ✓
hare ✓ ✓ ✓ ✓ ✓
haskell ✓ ✓ ✓ . ✓
haskell_persistent ✓ . ✓ . .
hcl ✓ . ✓ ✓ ✓
heex ✓ ✓ ✓ ✓ ✓
helm ✓ ✓ ✓ . ✓
hjson ✓ ✓ ✓ ✓ ✓
hlsl ✓ ✓ ✓ ✓ ✓
hlsplaylist ✓ . . . ✓
hocon ✓ . ✓ . ✓
hoon ✓ ✓ ✓ . ✓
html ✓ ✓ ✓ ✓ ✓
htmldjango ✓ . ✓ ✓ ✓
http ✓ . . . ✓
hurl ✓ . ✓ ✓ ✓
hyprlang ✓ . ✓ ✓ ✓
idl ✓ . . ✓ ✓
ini ✓ . ✓ . ✓
inko ✓ ✓ ✓ ✓ ✓
ispc ✓ ✓ ✓ ✓ ✓
janet_simple ✓ ✓ ✓ . ✓
java ✓ ✓ ✓ ✓ ✓
javascript ✓ ✓ ✓ ✓ ✓
jq ✓ ✓ . . ✓
jsdoc ✓ . . . .
json ✓ ✓ ✓ ✓ .
json5 ✓ . . . ✓
jsonc ✓ ✓ ✓ ✓ ✓
jsonnet ✓ ✓ ✓ . ✓
julia ✓ ✓ ✓ ✓ ✓
just ✓ ✓ ✓ ✓ ✓
kconfig ✓ ✓ ✓ ✓ ✓
kdl ✓ ✓ ✓ ✓ ✓
kotlin ✓ ✓ ✓ . ✓
koto ✓ ✓ ✓ . ✓
kusto ✓ . . . ✓
lalrpop ✓ ✓ ✓ . ✓
ledger ✓ . ✓ ✓ ✓
leo ✓ . . ✓ ✓
linkerscript ✓ ✓ ✓ ✓ ✓
liquid ✓ . . . ✓
liquidsoap ✓ ✓ ✓ ✓ ✓
llvm ✓ . . . ✓
lua ✓ ✓ ✓ ✓ ✓
luadoc ✓ . . . .
luap ✓ . . . .
luau ✓ ✓ ✓ ✓ ✓
m68k ✓ ✓ ✓ . ✓
make ✓ . ✓ . ✓
markdown ✓ . ✓ ✓ ✓
markdown_inline ✓ . . . ✓
matlab ✓ ✓ ✓ ✓ ✓
menhir ✓ . . . ✓
mermaid ✓ . ✓ ✓ ✓
meson ✓ . ✓ ✓ ✓
muttrc ✓ . . . ✓
nasm ✓ . . . ✓
nginx ✓ . ✓ . ✓
nickel ✓ . . ✓ ✓
nim ✓ ✓ ✓ . ✓
nim_format_string ✓ . . . ✓
ninja ✓ . ✓ ✓ ✓
nix ✓ ✓ ✓ ✓ ✓
norg . . . . .
nqc ✓ ✓ ✓ ✓ ✓
objc ✓ ✓ ✓ ✓ ✓
objdump ✓ . . . ✓
ocaml ✓ ✓ ✓ ✓ ✓
ocaml_interface ✓ ✓ ✓ ✓ ✓
odin ✓ ✓ ✓ ✓ ✓
org . . . . .
pascal ✓ ✓ ✓ ✓ ✓
passwd ✓ . . . .
pem ✓ . ✓ . ✓
perl ✓ . ✓ . ✓
php ✓ ✓ ✓ ✓ ✓
php_only ✓ ✓ ✓ ✓ ✓
phpdoc ✓ . . . .
pioasm ✓ . . . ✓
po ✓ . ✓ . ✓
pod ✓ . . . .
poe_filter ✓ . ✓ ✓ ✓
pony ✓ ✓ ✓ ✓ ✓
powershell ✓ ✓ ✓ ✓ ✓
printf ✓ . . . .
prisma ✓ . ✓ . ✓
problog ✓ . ✓ ✓ ✓
prolog ✓ . ✓ ✓ ✓
promql ✓ . . . ✓
properties ✓ ✓ . . ✓
proto ✓ . ✓ ✓ ✓
prql ✓ . . . ✓
psv ✓ . . . .
pug ✓ . . . ✓
puppet ✓ ✓ ✓ ✓ ✓
purescript ✓ ✓ . . ✓
pymanifest ✓ . . . ✓
python ✓ ✓ ✓ ✓ ✓
ql ✓ ✓ ✓ ✓ ✓
qmldir ✓ . . . ✓
qmljs ✓ . ✓ . ✓
query ✓ ✓ ✓ ✓ ✓
r ✓ ✓ . ✓ ✓
racket ✓ . ✓ . ✓
ralph ✓ . . . ✓
rasi ✓ ✓ ✓ ✓ ✓
rbs ✓ . ✓ ✓ ✓
re2c ✓ ✓ ✓ ✓ ✓
readline ✓ . ✓ ✓ ✓
regex ✓ . . . .
rego ✓ . . . ✓
requirements ✓ . . . ✓
rescript ✓ ✓ ✓ ✓ ✓
rnoweb ✓ . ✓ . ✓
robot ✓ . ✓ ✓ ✓
robots ✓ . . . ✓
roc ✓ ✓ . . ✓
ron ✓ ✓ ✓ ✓ ✓
rst ✓ ✓ . . ✓
ruby ✓ ✓ ✓ ✓ ✓
rust ✓ ✓ ✓ ✓ ✓
scala ✓ ✓ ✓ . ✓
scheme ✓ . ✓ . ✓
scss ✓ . ✓ ✓ ✓
sflog ✓ . . . .
slang ✓ ✓ ✓ ✓ ✓
slint ✓ ✓ ✓ ✓ ✓
smali ✓ ✓ ✓ ✓ ✓
smithy ✓ . . . ✓
snakemake ✓ ✓ ✓ ✓ ✓
solidity ✓ . ✓ . ✓
soql ✓ . . . .
sosl ✓ . . . .
sourcepawn ✓ ✓ . . ✓
sparql ✓ ✓ ✓ ✓ ✓
sql ✓ . . ✓ ✓
squirrel ✓ ✓ ✓ ✓ ✓
ssh_config ✓ ✓ ✓ ✓ ✓
starlark ✓ ✓ ✓ ✓ ✓
strace ✓ . . . ✓
styled ✓ . ✓ ✓ ✓
supercollider ✓ ✓ ✓ ✓ ✓
superhtml ✓ . . . ✓
surface ✓ . ✓ ✓ ✓
svelte ✓ ✓ ✓ ✓ ✓
sxhkdrc ✓ . ✓ . ✓
systemtap ✓ ✓ ✓ . ✓
t32 ✓ ✓ ✓ ✓ ✓
tablegen ✓ ✓ ✓ ✓ ✓
tact ✓ ✓ ✓ ✓ ✓
tcl ✓ . ✓ ✓ ✓
templ ✓ . ✓ . ✓
terraform ✓ . ✓ ✓ ✓
textproto ✓ . ✓ ✓ ✓
thrift ✓ ✓ ✓ ✓ ✓
tiger ✓ ✓ ✓ ✓ ✓
tlaplus ✓ ✓ ✓ . ✓
tmux ✓ . . . ✓
todotxt ✓ . . . .
toml ✓ ✓ ✓ ✓ ✓
tsv ✓ . . . .
tsx ✓ ✓ ✓ ✓ ✓
turtle ✓ ✓ ✓ ✓ ✓
twig ✓ . . . ✓
typescript ✓ ✓ ✓ ✓ ✓
typespec ✓ . . ✓ ✓
typoscript ✓ . ✓ ✓ ✓
typst ✓ . ✓ ✓ ✓
udev ✓ ✓ . . ✓
ungrammar ✓ ✓ ✓ ✓ ✓
usd ✓ ✓ ✓ ✓ ✓
uxntal ✓ ✓ ✓ ✓ ✓
v ✓ ✓ ✓ ✓ ✓
vala ✓ . ✓ . ✓
vento ✓ . . . ✓
verilog ✓ . ✓ . ✓
vhdl ✓ . ✓ . ✓
vhs ✓ . . . ✓
vim ✓ ✓ ✓ . ✓
vimdoc ✓ . . . ✓
vrl ✓ ✓ ✓ ✓ ✓
vue ✓ . ✓ ✓ ✓
wgsl ✓ . ✓ ✓ ✓
wgsl_bevy ✓ . ✓ ✓ .
wing ✓ ✓ ✓ . ✓
wit ✓ . ✓ . ✓
xcompose ✓ ✓ . . ✓
xml ✓ ✓ ✓ ✓ ✓
xresources ✓ ✓ ✓ . ✓
yaml ✓ ✓ ✓ ✓ ✓
yang ✓ . ✓ ✓ ✓
yuck ✓ ✓ ✓ ✓ ✓
zathurarc ✓ . . . ✓
zig ✓ ✓ ✓ ✓ ✓
ziggy ✓ . . ✓ .
ziggy_schema ✓ . . ✓ .
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} ~
Describe the bug
when testing highlighting on cpp file, got error: treesitter/highlighter: Error executing lua: /use/share/nvim/runtime/lua/vim/treesitter/query.lua:557 No handler for has-ancestor? stack traceback: [C]: in function 'error' /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:557: in function 'match_preds'
To Reproduce
install with: return { "nvim-treesitter/nvim-treesitter", run = ":TSUpdate", config = function() require'nvim-treesitter.configs'.setup { ensure_installed = "all", highlight = { enable = true, }, indent = { enable = true, }, } end, }
Expected behavior
No response
Output of
:checkhealth nvim-treesitter
============================================================================== nvim-treesitter: require("nvim-treesitter.health").check()
Installation ~
tree-sitter
executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)node
found v18.19.1 (only needed for :TSInstallFromGrammar)git
executable found.cc
executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" } Version: cc (Ubuntu 13.2.0-23ubuntu4) 13.2.0OS Info: { machine = "x86_64", release = "5.10.102.1-microsoft-standard-WSL2", sysname = "Linux", version = "#1 SMP Wed Mar 2 00:30:59 UTC 2022" } ~
Parser/Features H L F I J
ziggy_schema ✓ . . ✓ .
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
root@LAPTOP-OQB457IO:~/.config/nvim/lua/plugins# nvim --version NVIM v0.9.5 Build type: Release LuaJIT 2.1.1703358377
system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"
Additional context
No response