Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

language server(gopls) not working #2768

Closed
1yefuwang1 opened this issue Sep 20, 2019 · 11 comments
Closed

language server(gopls) not working #2768

1yefuwang1 opened this issue Sep 20, 2019 · 11 comments

Comments

@1yefuwang1
Copy link

After setting go.useLanguageServer to true, this plugin basically stops working: no auto-completion, no go-to-definition, no quick-info-on-hover.
When I try to restart the language server, the following message shows up.
image

Detailed info of my vscode:
Version: 1.38.1
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:31:32.854Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 18.7.0

Version of the this plugin I am using: 0.11.5

Version of gopls:
golang.org/x/tools/gopls v0.1.7
golang.org/x/tools/gopls@v0.1.7 h1:YwKf8t9h69++qCtVmc2q6fVuetFXmmu9LKoPMYLZid4=

@1yefuwang1
Copy link
Author

seems like the same issue as #2767

@enix223
Copy link

enix223 commented Sep 20, 2019

got the same issue, after upgrading vscode-go to 0.11.5, gopls daemon does not start when vscode started... while rolling back to 0.11.4, all works fine...

@liuhangyu
Copy link

I also encountered the same problem, unable to pull up the gopls version at 0.11.5, 0.11.4 is normal

@ramya-rao-a
Copy link
Contributor

Thanks for reporting everyone

Can one of you check the logs and share any errors that you see there?

  • Run the command Developer: Toggle Developer Tools.
  • Share any errors from here related to the go extension.
  • If there is too much noise here, then reload the window, and you should be able to see errors if nay

Another place to check is the logs from the Extension Host

  • Select Output from the View menu
  • In the output panel that opens, select Log (extension host) from the drop down on the top right corner.

@stamblerre has found a potential reason for the language server to not load and has a fix for that. Please give that a try as well via the latest beta version of this extension

@enix223
Copy link

enix223 commented Sep 21, 2019

Log from Developer tools for version 0.11.5:

[Extension Host] Language Server Config: [object Object]
console.ts:137 [Extension Host] Language Server Path: /Users/enix/go/bin/gopls
console.ts:137 [Extension Host] Language server tool name: gopls
console.ts:137 [Extension Host] Language server tool: [object Object]
console.ts:137 [Extension Host] Checking if the user should update gopls.
console.ts:137 [Extension Host] The user's version of gopls is v0.1.7
mainThreadExtensionService.ts:65 Error: connect ETIMEDOUT 172.217.24.17:443
	at Request.request [as _callback] (/Users/enix/.vscode/extensions/ms-vscode.go-0.11.5/node_modules/web-request/index.js:61)
	at Request.init.self.callback (/Users/enix/.vscode/extensions/ms-vscode.go-0.11.5/node_modules/request/request.js:185)
	at Request.emit (events.js:182)
	at Request.onRequestError (/Users/enix/.vscode/extensions/ms-vscode.go-0.11.5/node_modules/request/request.js:881)
	at ClientRequest.emit (events.js:187)
	at TLSSocket.socketErrorListener (/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-browser/workbench/_http_client.js:391)
	at TLSSocket.emit (events.js:182)
	at emitErrorNT (internal/streams/destroy.js:82)
	at emitErrorAndCloseNT (internal/streams/destroy.js:50)
	at process._tickCallback (internal/process/next_tick.js:63)

gopls daemon not started after timeout 😢

Log from Developer tools for version 0.11.6.beta-1:

[Extension Host] Unable to determine latest gopls version: Error: connect ETIMEDOUT 172.217.24.17:443

gopls daemon started after timeout occurred, and all works fine now 😄...

@kidlj
Copy link

kidlj commented Sep 21, 2019

VSCode remote-container with go-extension 0.11.5 and gopls v0.1.7 does not work too. And after switching to 0.11.4 it works again, however it noticed me to rebuild go tools for go version has changed, but I'm using the same go in the same container.

@js00070
Copy link

js00070 commented Sep 21, 2019

I have the same problem.
I tried ps aux | grep gopls to see if gopls was started and i found the gopls wasn't started at all.... I also tried to restart the language server and got "go.languageserver not found" too.

this is my settings.json for vscode-go
"go.useLanguageServer": true, "go.alternateTools": { "go-langserver": "gopls", }, "go.languageServerExperimentalFeatures": { "format": true, "autoComplete": true }, "go.languageServerFlags": ["-rpc.trace"],

version of vscode: 1.38.1
versiion of vscode-go: 0.11.5
version of gopls is golang.org/x/tools/gopls@v0.1.7 ( I also tried v0.1.3 and failed too )
OS: Deepin 15.11 x86_64

@js00070
Copy link

js00070 commented Sep 21, 2019

VSCode remote-container with go-extension 0.11.5 and gopls v0.1.7 does not work too. And after switching to 0.11.4 it works again, however it noticed me to rebuild go tools for go version has changed, but I'm using the same go in the same container.

Thanks for your solution!
I uninstalled 0.11.5 and installed 0.11.4 and the gopls could work!!!

@ramya-rao-a
Copy link
Contributor

@enix223, @kidlj, @js00070,
Can you try the latest beta version and see if that helps?

@js00070
Copy link

js00070 commented Sep 21, 2019

@enix223, @kidlj, @js00070,
Can you try the latest beta version and see if that helps?

0.11.6-beta.1 works perfectly! Thanks!

@ramya-rao-a
Copy link
Contributor

Hello all,

I have just released an update(0.11.6) where we have replaced the outgoing call with known hard-coded value of the latest version for gopls. This should fix the problem reported here.

I have logged an issue #2776 to discuss next steps on how to make this check better, please feel free to provide your thoughts there.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants