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
Describe the bug
Sometimes Treesitter cannot parse a statement with complex grammar, thus producing an "ERROR" node in the syntax tree. Then @function.inner doesn't treat the current function as a function.
To Reproduce
A simple example:
#include<stdio.h>#definedef(type, name) type name
intmain() {
def(int, a);
a=5;
}
As you can see, I pass a type name (i.e. int) as a macro argument. And this is the syntax tree shown by :InspectTree:
If you type vif (under default configuration) then it selects nothing.
Expected behavior
Textobjects should include (ERROR) nodes in @function.inner.
WARNING tree-sitter executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
OK node found v22.12.0 (only needed for :TSInstallFromGrammar)
OK git executable found.
OK cc executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
Version: gcc (GCC) 13.3.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.15.153.1-microsoft-standard-WSL2",
sysname = "Linux",
version = "#1 SMP Fri Mar 29 23:14:13 UTC 2024"
} ~
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 ✓ ✓ ✓ ✓ ✓
cylc ✓ . ✓ ✓ ✓
d ✓ ✓ ✓ ✓ ✓
dart ✓ ✓ ✓ ✓ ✓
desktop ✓ . ✓ . ✓
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 ✓ ✓ ✓ ✓ ✓
nu ✓ . . ✓ ✓
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 ✓ ✓ ✓ ✓ ✓
runescript ✓ . . . ✓
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 ✓ ✓ ✓ ✓ ✓
sway ✓ ✓ ✓ ✓ ✓
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} ~
Output of nvim --version
NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713773202
Run "nvim -V1 -v" for more info
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
Sometimes Treesitter cannot parse a statement with complex grammar, thus producing an "ERROR" node in the syntax tree. Then
@function.inner
doesn't treat the current function as a function.To Reproduce
A simple example:
As you can see, I pass a type name (i.e.
int
) as a macro argument. And this is the syntax tree shown by:InspectTree
:If you type
vif
(under default configuration) then it selects nothing.Expected behavior
Textobjects should include
(ERROR)
nodes in@function.inner
.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 v22.12.0 (only needed for :TSInstallFromGrammar)git
executable found.cc
executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }Version: gcc (GCC) 13.3.0
OS Info:
{
machine = "x86_64",
release = "5.15.153.1-microsoft-standard-WSL2",
sysname = "Linux",
version = "#1 SMP Fri Mar 29 23:14:13 UTC 2024"
} ~
Parser/Features H L F I J
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
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: