-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
x/tools/gopls: panic when adding a comment at the end of a file #38793
Comments
Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here. |
This issue might be related to #37226 |
This area of the code has been a rich source of bugs, but I can't reproduce this one. If you can get the panic trace, I can probably fix it without a repro. I don't know how to do that in vim, sorry. |
@heschik do you mean this one? I forgot to add it.
|
Ah thank you for sharing the trace! Just added a comment to https://golang.org/cl/230215, so hopefully we can get it resolved as part of that change. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I use Neovim with the coc.nvim plugin to access the language server features.
coc.nvim config
When I write a comment at the end of a file, gopls panics with
panic: illegal line number
.It doesn't panic with an empty file when only the comment is added, but as soon as package name is added, gopls crashes when writing the first character after
//
that is not a space.What did you expect to see?
gopls does not panic.
What did you see instead?
gopls panics and coc.nvim tries to restart it. If this fails 5 times within 3 minutes, coc.nvim will not try again and completion and other features are not available anymore.
coc.nvim shows something like this in its log:
The text was updated successfully, but these errors were encountered: