-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
godef crashes when looking up a tag #3661
Comments
Crash:
|
While plying around some more I found the fix and created a PR for it. I am leaving the issue open in the hopes we can convince rogpeppe to commit this. If not I wouldn't mind if you point it to my repo and I'll keep it up to date. |
Thank you @marcopeereboom. I'll leave this open while your PR to godef is evaluated. Interestingly, |
hey guys, I have same problem as you that godef has crashed when looking up a tag; How can i fix it? thanks! |
You have a couple of options:
I'd recommend the first option. |
Fix isn't being picked up. I am willing to maintain this if you guys want to flip the link. gopls does not work for me at all so I continue to use godef. |
I'd be interested to find out why |
I'm interested in this answer as well since I have a similar experience as the author: after editing text for a while I suddenly cannot jump to definitions anymore. I have no clue how to debug it. |
@constant-mihai turn on lsp debugging with |
What did you do? (required: The issue will be closed when not provided)
When you press
CTRL-]
on a variable or type godef crashes. From the looks of it this is a side effect of go 1.22.Now before everyone starts yelling "use gopls and besides godef is deprecated", hear me out.
The unfortunate reality is that
gopls
is not robust, is slow, and uses a lot of resources. After one or two days of hacking on code it stops working and I have to restart vim and lose my development environment as it is. Before it stops working it also slows down drastically, several seconds to autocomplete rendering it useless to quickly hitCTRL-p
in succession to autocomplete. Overallgopls
degrades very quickly and eventually dies.I have used godef for years and right up until go 1.22 it never failed or brought down my development environment. It auto-completes sub-second and doesn't hog resources like chrome. My vim sessions are always inside tmux and they are long lived (months at a time) and it basically stayed out of the way and just worked.
Now, I know this isn't the right repo to bring this issue up but I figured that I am not the only one that would like for
godef
to become active again and maybe as a part of vim-go. Or maybe someone can point me to some magic config option to make gopls less painful to use. I'll gladly help debugging the issue as well if there is interest.To reproduce use
godef
instead ofgopls
by adding this to the config:Reopen vim with a go source file and position the cursor on any type (e.g. time.Second) and hit
CTRL-]
.What did you expect to happen?
I expected to go to the definition of the tag.
What happened instead?
godef crashed.
Configuration (MUST fill this out):
vim-go version:
vimrc
you used to reproduce:vimrc
Vim version (first three lines from
:version
):VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 14 2024 09:05:11)
Included patches: 1-579, 1969, 580-1848, 4975, 5016, 5023, 5072, 2068, 1849-1854, 1857, 1855-1857, 1331, 1858, 1858-1859, 1873, 1860-1969, 1992, 1970-1992, 2010, 1993-2068, 2106, 2069-2106, 2108, 2107-2109, 2109-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919, 213, 1840, 1846-1847, 2110-2112, 2121
Modified by [email protected]
Go version (
go version
):go version go1.22.2 linux/arm64
Go environment
go env
Output:gopls version
gopls version
Output:vim-go configuration:
vim-go configuration
filetype detection configuration:
filetype detection
The text was updated successfully, but these errors were encountered: