MordFustang21 / ide-gopls

Atom integration with the Go language server (gopls)
MIT License
13 stars 5 forks source link

ide-go the gopls language server stopped unexpectedly #8

Open wuleninja opened 4 years ago

wuleninja commented 4 years ago

Description

ide-gopls does not load at Atom's startup.

Steps to Reproduce

  1. Open Atom with ide-gopls installed.

Expected behavior:

No error hint.

Actual behavior:

2 error hints (red) :

ide-go the gopls language server stopped unexpectedly.
Exit code -2

then

gopls language server for Go unable to start
Error: spawn gopls ENOENT

Reproduces how often:

Always.

Versions

atom --version
Atom    : 1.45.0
Electron: 4.2.7
Chrome  : 69.0.3497.128
Node    : 10.11.0
apm --version
apm  2.4.3
npm  6.2.0
node 10.2.1 x64
atom 1.45.0
python 2.7.16
git 2.21.1

Additional Information

OS : macOS 10.15.3

Current workaround

  1. Close the error hints
  2. Uninstall ide-gopls
  3. Install it again, without restarting Atom
  4. Work with ide-gopls
stamblerre commented 4 years ago

It sounds like gopls may have crashed in this case. Is there any way for you to view the gopls logs when this happens?

wuleninja commented 4 years ago

There does not seem to be any documentation about how to access the gopls logging through this package.

The fact that it works right after being installed, could it be a clue ? It's like the installation of ide-gopls manages to launch gopls correctly, whereas its launching at Atom's startup does not.

stamblerre commented 4 years ago

The tips here may prove useful in investigating. I likely won't have a chance to look at this for a while, but that may be a place to start.

wuleninja commented 4 years ago

Thanks ! I've started looking into it, though I'm not very at ease with debugging in this kind of environment.

Looks like disabling / enabling the package again also works as a workaround.

xh3b4sd commented 4 years ago

I experience the same problem. I played around a bit and tried to figure out what the current state of the art with all the packages and their configuration might be. It is currently pretty complicated to get Golang IDE features right. Starting Atom with open *.go files causes gopls to crash.

Screenshot 2020-05-16 at 13 11 05 Screenshot 2020-05-16 at 13 11 18

Disabling/enabling ide-gopls and atom-ide-ui seems to resolve the problem as a workaround. Closing all Golang source files and starting Atom seems then also to be fine and no crashing of gopls appears to happen.

I cannot really do more than report this but would be curious to know if someone is looking at the issue. I am afraid hacking go in Atom becomes a dying art.

stamblerre commented 4 years ago

If you can get a gopls log when you see this, I can advise about what might be causing gopls to crash.

I cannot really do more than report this but would be curious to know if someone is looking at the issue. I am afraid hacking go in Atom becomes a dying art.

Unfortunately, this does seem to be the case. The LSP client library on which this extension depends is used by all Atom LSP extensions, and it does not support recent versions of the protocol (https://github.com/atom/atom-languageclient/issues/280). I would suggest trying out VS Code as an alternative since it is quite similar to Atom. You can also see more details about popular Go editors in the Developer Tools section of the Go 2019 user survey: https://blog.golang.org/survey2019-results.

xh3b4sd commented 4 years ago

Looks like I am riding a dead horse. 🙈 I tried VS Code recently but it smelled too much like Windows 95. Can you tell me where I find the gopls logs?

stamblerre commented 4 years ago

It looks like you will need to add this configuration: https://github.com/atom/atom-languageclient#debugging.

xh3b4sd commented 4 years ago

So what does it tell you when you debug it on your end? How can the issue be fixed?

stamblerre commented 4 years ago

I'm sorry, but I will likely not have time to debug this issue, particularly since it seems like there is an existing workaround. I'm happy to advise on gopls-specific issues, but fixes for editor-specific issues will have to be made by community contributors.