nvim-treesitter / nvim-treesitter-textobjects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`@call.inner` throws an error

ibldzn opened this issue · comments

Describe the bug
I got this error when trying to use @call.inner

E5108: Error executing lua: /usr/share/nvim/runtime/lua/vim/treesitter.lua:204: node: expected userdata, got table
stack traceback:
        [C]: in function 'error'
        vim/shared.lua: in function 'validate'
        /usr/share/nvim/runtime/lua/vim/treesitter.lua:204: in function 'is_in_node_range'
        ...r-textobjects/lua/nvim-treesitter/textobjects/shared.lua:85: in function 'best_match_at_point'
        ...r-textobjects/lua/nvim-treesitter/textobjects/shared.lua:223: in function 'textobject_at_point'
        ...r-textobjects/lua/nvim-treesitter/textobjects/select.lua:103: in function 'select_textobject'
        ...r-textobjects/lua/nvim-treesitter/textobjects/select.lua:184: in function <...r-textobjects/lua/nvim-treesitter/textobjects/select.lua:183
>

To Reproduce
Steps to reproduce the behavior:

  1. Open any file which has treesitter support
  2. Use @call.inner binding

Expected behavior
No errors when using the textobject

Output of :checkhealth nvim-treesitter

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

Installation ~

  • OK tree-sitter found 0.20.7 (parser generator, only needed for :TSInstallFromGrammar)
  • OK node found v19.7.0 (only needed for :TSInstallFromGrammar)
  • OK git executable found.
  • OK cc executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: cc (GCC) 12.2.1 20230201
  • 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 = "6.2.2-arch1-1",
sysname = "Linux",
version = "#1 SMP PREEMPT_DYNAMIC Fri, 03 Mar 2023 15:58:31 +0000"
} ~

Parser/Features H L F I J

  • bash ✓ ✓ ✓ . ✓
  • c ✓ ✓ ✓ ✓ ✓
  • cmake ✓ . ✓ . .
  • comment ✓ . . . .
  • cpp ✓ ✓ ✓ ✓ ✓
  • css ✓ . ✓ ✓ ✓
  • dockerfile ✓ . . . ✓
  • gitcommit ✓ . . . ✓
  • go ✓ ✓ ✓ ✓ ✓
  • graphql ✓ . . ✓ ✓
  • html ✓ ✓ ✓ ✓ ✓
  • java ✓ ✓ . ✓ ✓
  • javascript ✓ ✓ ✓ ✓ ✓
  • json ✓ ✓ ✓ ✓ .
  • kotlin ✓ ✓ ✓ . ✓
  • latex ✓ . ✓ . ✓
  • lua ✓ ✓ ✓ ✓ ✓
  • markdown ✓ . ✓ . ✓
  • markdown_inline ✓ . . . ✓
  • meson ✓ . ✓ . ✓
  • nix ✓ ✓ ✓ . ✓
  • norg . . . . .
  • pascal ✓ ✓ ✓ ✓ ✓
  • php ✓ ✓ ✓ ✓ ✓
  • python ✓ ✓ ✓ ✓ ✓
  • rust ✓ ✓ ✓ ✓ ✓
  • sql ✓ . . . ✓
  • toml ✓ ✓ ✓ ✓ ✓
  • typescript ✓ ✓ ✓ ✓ ✓
  • vim ✓ ✓ ✓ . ✓
  • yaml ✓ ✓ ✓ ✓ ✓
  • zig ✓ . ✓ ✓ ✓

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.9.0-dev-1165+g0e7edd70a9
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/usr/include/luajit-2.1 -I/usr/include -I/usr/include -I/home/User/.cache/yay/neovim-git/src/build/src/nvim/auto -I/home/User/.cache/yay/neovim-git/src/build/include -I/home/User/.cache/yay/neovim-git/src/build/cmake.config -I/home/User/.cache/yay/neovim-git/src/neovim/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include

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

Run :checkhealth for more info

Additional context
Add any other context about the problem here.

I made a hotfix PR (#411), but it looks like this upstream PR (neovim/neovim#22582) will fix this issue. We can maybe wait for a day or two.