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

When using go-mode eglot failes to properly connect with gopls #413

Closed
the42 opened this issue Dec 11, 2022 · 3 comments
Closed

When using go-mode eglot failes to properly connect with gopls #413

the42 opened this issue Dec 11, 2022 · 3 comments

Comments

@the42
Copy link

the42 commented Dec 11, 2022

Using emacs 29 on windows from https://github.com/kiennq/emacs-build/releases/tag/v29.169.20221201.4a23421

When using go-mode eglot failes to properly connect with gopls

The actual error message I get is

Error in menu-bar-update-hook (imenu-update-menubar): (jsonrpc-error "request id=2 failed:" (jsonrpc-error-message . "Timed out")

I already commented out imenu-integration of go-mode, that's not the problem.

  • If I uninstall go-mode and open the file, eglot correctly starts gopls
  • If I literally open a go file and start eglot afterwards, gopls correctly loads.

The problem is rather hard to debug. In my particular project, out of 20? times gopls and eglot start to interact properly
If I open a very small project (so that gopls has probably not much to analyse) go-mode, eglot and gopls always work.

Maybe it is a problem with windows pre-maturely reporting back successful process spawning, maybe it is gopls pre-maturely returning control to the os while rpc thread is still blocked? It seems a rather interacted timing issue of which go-mode may actually not be the culprit but rather a promoter.

Reporting here nonetheless as without go-mode eglot and gopls work.

@dominikh
Copy link
Owner

Possibly related: joaotavora/eglot#587 and golang/go#54559

@the42
Copy link
Author

the42 commented Feb 8, 2023

Indeed, the fix is to use Emacs 30 OR install jsonrp.el https://elpa.gnu.org/packages/jsonrpc.html

Unrelated to go-mode

@the42
Copy link
Author

the42 commented Oct 3, 2023

Closing this issue as it has been fixed by shipping a more current jsonrpc package in stock emacs 29

@the42 the42 closed this as completed Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants