Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] lib.treesitter.parse_positions causes crash in nvim 0.11.0 nightly #452

Closed
fredrikaverpil opened this issue Sep 9, 2024 · 1 comment
Assignees

Comments

@fredrikaverpil
Copy link
Contributor

fredrikaverpil commented Sep 9, 2024

NeoVim Version
NVIM v0.11.0-dev-734+g8a2aec997

Describe the bug

The neotest.lib.treesitter.parse_positions works just fine in Neovim 0.10.1 but crashes in nightly. I noticed this as I'm running tests in my CI for neotest-golang for both stable and nightly neovim: https://github.com/fredrikaverpil/neotest-golang/actions/runs/10776208100/job/29882411561?pr=173

.tests/all/site/pack/deps/start/nvim-nio/lua/nio/tests.lua:48: Test task failed with message:
The coroutine failed with this message: 
...r/nvim-nightly/share/nvim/runtime/lua/vim/treesitter.lua:222: attempt to call method 'start' (a nil value)
stack traceback:
	...r/nvim-nightly/share/nvim/runtime/lua/vim/treesitter.lua: in function 'get_node_text'
	...k/deps/start/neotest/lua/neotest/lib/treesitter/init.lua:29: in function 'build_position'
	...k/deps/start/neotest/lua/neotest/lib/treesitter/init.lua:64: in function 'collect'
	...k/deps/start/neotest/lua/neotest/lib/treesitter/init.lua:162: in function 'parse_positions_from_string'
	...k/deps/start/neotest/lua/neotest/lib/treesitter/init.lua:207: in function 'parse_positions'
	./lua/neotest-golang/query.lua:138: in function <./lua/neotest-golang/query.lua:126>

stack traceback:
	.tests/all/site/pack/deps/start/nvim-nio/lua/nio/tests.lua:48: in function <.tests/all/site/pack/deps/start/nvim-nio/lua/nio/tests.lua:31>
	.tests/all/site/pack/deps/start/nvim-nio/lua/nio/tests.lua:89: in function 'with_async_context'
	...eotest-golang/neotest-golang/tests/go/positions_spec.lua:264: in function <...eotest-golang/neotest-golang/tests/go/positions_spec.lua:23>

Invoked through here: https://github.com/fredrikaverpil/neotest-golang/blob/a7704cd2c9674783517cd84e46d6b1db2942e5be/lua/neotest-golang/query.lua#L138

Expected behavior

I would've expected this not to crash.

Logs

I can try and install the nightly locally and extract the logs, if you wish.

@fredrikaverpil fredrikaverpil changed the title [BUG] [BUG] lib.treesitter.parse_positions causes crash in neovim nightly Sep 9, 2024
@fredrikaverpil fredrikaverpil changed the title [BUG] lib.treesitter.parse_positions causes crash in neovim nightly [BUG] lib.treesitter.parse_positions causes crash in nvim 0.11.0 nightly Sep 9, 2024
@fredrikaverpil
Copy link
Contributor Author

I have no idea what originally caused this but I just tried this again with Neovim 0.11.0 nightly and now there are no errors, so I'm closing this.

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

No branches or pull requests

2 participants