nvim-treesitter / nvim-treesitter-textobjects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

textobject_at_point can generates matches without nodes

Grazfather opened this issue · comments

Describe the bug

E5108: Error executing lua: ...r-textobjects/lua/nvim-treesitter/textobjects/shared.lua:269: attempt to index field
 'node' (a nil value)
stack traceback:
│       ...r-textobjects/lua/nvim-treesitter/textobjects/shared.lua:269: in function 'textobject_at_point'

To Reproduce
Steps to reproduce the behavior:

  1. Open buffer with something line (print 1 2 3), ft=fennel
  2. :lua require'nvim-treesitter.textobjects.shared'.textobject_at_point("@call")
  3. See error

Expected behavior
Probably some warning about what's wrong with the invocation. @call is a query that exists for fennel in this repo.

Inspecting the matches table, I see an inner and outer, both with nodes, but my query did not specify. I think this call should error out if the query doesn't specify .inner or .outer.

Output of nvim --version

nvim --version
NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3

Additional context
Add any other context about the problem here.