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

gopls stops working if you write sufficiently complex code in Go 1.18 #4098

Closed
w0rp opened this issue Mar 1, 2022 · 1 comment · Fixed by #4259
Closed

gopls stops working if you write sufficiently complex code in Go 1.18 #4098

w0rp opened this issue Mar 1, 2022 · 1 comment · Fixed by #4259
Assignees
Labels

Comments

@w0rp
Copy link
Member

w0rp commented Mar 1, 2022

Information

VIM version

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 29 2020 14:11:37)
Included patches: 1-1539

Operating System: Linux

What went wrong

If you write very complex code that causes gopls to freak out something goes wrong with the messages between ALE and gopls and you can't see errors in your editor until the code is modified and you restart the server with :ALEStopAllLSPs. It might be that the server is panicking with code it can't understand and ALE need to handle the server crashing better, or that the messages gopls is sending aren't understood by ALE.

Reproducing the bug

Reproducing this is complicated. I'm going to have a look at it.

:ALEInfo

N/A

@w0rp w0rp added the bug label Mar 1, 2022
@w0rp w0rp self-assigned this Mar 1, 2022
@w0rp w0rp closed this as completed in b42153e Mar 2, 2022
@w0rp
Copy link
Member Author

w0rp commented Mar 2, 2022

I found the source of this and fixed it now. When the LSP programs crash we don't clear the data in ALE. It was a crash in gopls freaking out at code it doesn't handle well yet. Now any time a server crashes we'll just restart it by virtue of doing any other actions that need to send messages to the server.

liskin added a commit to liskin/ale that referenced this issue Jul 20, 2022
When 'close_cb' is set for job_start(), but out_cb or err_cb isn't, vim
buffers data instead of dropping it (in case someone wanted to read and
process it in close_cb), and additionally polls for new data every 10
milliseconds, causing excessive wakeups and CPU usage. Since we don't
read the data anywhere outside of out_cb/err_cb, any LSP that prints an
error to stderr triggers this and vim keeps spinning until :ALEStopAllLSPs.

Fix this by always setting both callbacks, thus dropping any data we're
not interested in.

See vim/vim#10758 for an upstream report of
the excessive polling. It's possible this is intentional, I dunno.

Fixes: b42153e ("Fix dense-analysis#4098 - Clear LSP data when servers crash")
hsanson pushed a commit that referenced this issue Jul 26, 2022
When 'close_cb' is set for job_start(), but out_cb or err_cb isn't, vim
buffers data instead of dropping it (in case someone wanted to read and
process it in close_cb), and additionally polls for new data every 10
milliseconds, causing excessive wakeups and CPU usage. Since we don't
read the data anywhere outside of out_cb/err_cb, any LSP that prints an
error to stderr triggers this and vim keeps spinning until :ALEStopAllLSPs.

Fix this by always setting both callbacks, thus dropping any data we're
not interested in.

See vim/vim#10758 for an upstream report of
the excessive polling. It's possible this is intentional, I dunno.

Fixes: b42153e ("Fix #4098 - Clear LSP data when servers crash")
mnikulin pushed a commit to mnikulin/ale that referenced this issue Nov 12, 2023
…#4259)

When 'close_cb' is set for job_start(), but out_cb or err_cb isn't, vim
buffers data instead of dropping it (in case someone wanted to read and
process it in close_cb), and additionally polls for new data every 10
milliseconds, causing excessive wakeups and CPU usage. Since we don't
read the data anywhere outside of out_cb/err_cb, any LSP that prints an
error to stderr triggers this and vim keeps spinning until :ALEStopAllLSPs.

Fix this by always setting both callbacks, thus dropping any data we're
not interested in.

See vim/vim#10758 for an upstream report of
the excessive polling. It's possible this is intentional, I dunno.

Fixes: b42153e ("Fix dense-analysis#4098 - Clear LSP data when servers crash")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant