Skip to content

fix treesitter node recursion for nvim v0.12#612

Open
zach-wahrer wants to merge 1 commit intoray-x:masterfrom
zach-wahrer:zw.fix-node-recursion
Open

fix treesitter node recursion for nvim v0.12#612
zach-wahrer wants to merge 1 commit intoray-x:masterfrom
zach-wahrer:zw.fix-node-recursion

Conversation

@zach-wahrer
Copy link
Copy Markdown

@zach-wahrer zach-wahrer commented Mar 31, 2026

I'm getting the following error when trying to run GoAddTest , running on Neovim v0.12.0:

stack traceback:
...re/bob/v0.12.0/share/nvim/runtime/lua/vim/treesitter.lua:196: in function 'get_range'
...re/bob/v0.12.0/share/nvim/runtime/lua/vim/treesitter.lua:231: in function 'get_node_text'
.../zach/.local/share/nvim/lazy/go.nvim/lua/go/ts/nodes.lua:185: in function 'accumulator'
...nvim/lazy/nvim-treesitter/lua/nvim-treesitter/locals.lua:143: in function 'recurse_local_nodes'
...nvim/lazy/nvim-treesitter/lua/nvim-treesitter/locals.lua:146: in function 'recurse_local_nodes'
...nvim/lazy/nvim-treesitter/lua/nvim-treesitter/locals.lua:146: in function 'recurse_local_nodes'
.../zach/.local/share/nvim/lazy/go.nvim/lua/go/ts/nodes.lua:177: in function 'get_all_nodes'
.../zach/.local/share/nvim/lazy/go.nvim/lua/go/ts/nodes.lua:272: in function 'nodes_at_cursor'
/Users/zach/.local/share/nvim/lazy/go.nvim/lua/go/ts/go.lua:200: in function 'get_func_method_node_at_pos'
...s/zach/.local/share/nvim/lazy/go.nvim/lua/go/gotests.lua:44: in function 'fun_test'
.../zach/.local/share/nvim/lazy/go.nvim/lua/go/commands.lua:351: in function <.../zach/.local/share/nvim/lazy/go.nvim/lua/go/commands.lua:350>

This additional code fixes the issue and restores functionality, but I'm not familiar enough with the plugin/repo to know if this has other, unintended impacts. I also couldn't get the local tests to fully pass, but it looked unrelated to these changes?

I tested GoAddTest with this code on Neovim v0.12.0, nightly, and v0.11.5, and it worked as expected on all versions, so this seems v0.11 safe as well.

Thanks for the awesome plugin! I use it everyday and appreciate all the hard work that went into it's creation and maintenance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant