Closed jhillyerd closed 6 months ago
I ran your steps a few times. Does not reproduce
I'll try building an empty neovim config w/ go.nvim and see if I can still make it happen, perhaps its a setting in my config or a bug in my version of nvim.
@ray-x I made a brand new nvim config with just go.nvim and treesitter, and the issue still repros on nvim 0.9.4 for me.
I found https://stackoverflow.com/questions/34675677/disable-highlight-matched-parentheses-in-vim-let-loaded-matchparen-1-not-w -- and discovered that adding let g:loaded_matchparen = 1
to init.vim prevents the error. Do you also have matchparen disabled?
In theory set noshowmatch
and :NoMatchParen
should have similar effect, but didn't work. They robably have to be added to an autocmd and not directly to init.vim
Edit: I've uploaded the minimal config I was experimenting with https://github.com/jhillyerd/minimal-go.nvim
I am sure the minium vimrc in playground folder dose not have g:loaded_matchparen=1
setting.
I also tried your config but still not able to reproduce
Hmm, struggling a bit with the playground. When I do nvim -u ../init_lazy.lua pkg/findAllSubStr_test.go
and try to run the tests, it blows up. Perhaps a nvim 0.9.4 compat issue? Edit: still fails on 0.9.1
Error executing Lua callback: ...ed-0.9.4/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 3406 for language lua
stack traceback:
[C]: in function '_ts_parse_query'
...ed-0.9.4/share/nvim/runtime/lua/vim/treesitter/query.lua:259: in function 'get'
...4/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:114: in function 'new'
...nwrapped-0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:61: in function '_create_parser'
...nwrapped-0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:131: in function 'get_parser'
...nwrapped-0.9.4/share/nvim/runtime/lua/vim/treesitter.lua:459: in function 'start'
...m/lazy/nvim-treesitter/lua/nvim-treesitter/highlight.lua:20: in function 'attach'
/tmp/nvim/lazy/guihua.lua/lua/guihua/util.lua:274: in function 'highlighter'
/tmp/nvim/lazy/guihua.lua/lua/guihua/sprite.lua:125: in function 'initialize'
/tmp/nvim/lazy/guihua.lua/lua/middleclass.lua:181: in function 'new'
/tmp/nvim/lazy/go.nvim/lua/go/asyncmake.lua:252: in function 'run_test'
/tmp/nvim/lazy/go.nvim/lua/go/gotest.lua:366: in function 'test'
/tmp/nvim/lazy/go.nvim/lua/go/commands.lua:186: in function </tmp/nvim/lazy/go.nvim/lua/go/commands.lua:185>
However the tests will run with init_packer.lua
I am able to get the issue to repro, but it requires me to disable floating terminals run_in_floaterm = false
-- so the problem must be specific to the quickfix window.
I was able to repro the ID already taken 3
issue with the Ubuntu snap of neovim 0.9.1, so it does not appear to be specific to 0.9.4 -- and the 0.9.4 was on NixOS, so two different Linux distros as well.
I was able to reproduce this without go.nvim at all, just by running :cexpr system('go test')
a couple times, closing the quickfix window in between. I believe it's a bug in nvim itself.
I'm not sure where the issue lies, but go.nvim could be the culprit, as I removed all my other plugins and still see the issue. It appears that test ouput containing JSON blocks (ie text with
{
and}
in them) triggers the issue.What I did
To reproduce, create a new go repo with the following files:
main.go
main_test.go
Open
main_test.go
in neovim, and runWhat I expect
I would expect the sequence of commands above to display the failing test output in the quickfix window, close the quickfix window, and then display the output of the re-run test.
What I got
Instead, the second attempt to run the test triggers an error somewhere in Lua land.
Commenting out the println, or removing the leading & trailing
{}
from the printed string stop the issue from triggering.vim verbose output: