-
Notifications
You must be signed in to change notification settings - Fork 784
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 crashed in vscode and couldn't create connection to server #2300
Comments
The problem occurred because in the user's setup, gopls was running in a forwarder mode, so @jamalc already addressed this missing exception handling & command registration ordering issue in https://go-review.googlesource.com/c/vscode-go/+/413424, and this change is available in today's Nightly release. However, I noticed another issue - Now we are prompting various error messages (including the prompt for filing an issue), which is still a regression from v0.33.x. This needs fix. |
Change https://go.dev/cl/414457 mentions this issue: |
Change https://go.dev/cl/414456 mentions this issue: |
…ver is disabled This fixes a bug that made the extension to look up the path to the gopls binary when go.useLanguageServer is false. During the lookup, if the gopls wasn't available, getLanguageServerToolPath eventually triggerred the missing tool prompt and that was not appropriate. Return from buildLanguageServerConfig early if we don't need the language server. Updates #2300 Change-Id: I7572244350f953c8ce874086f4f5cbb45a7301af Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/414456 Reviewed-by: Jamal Carvalho <jamal@golang.org> Reviewed-by: Suzy Mueller <suzmue@golang.org> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com>
Change https://go.dev/cl/414459 mentions this issue: |
Change https://go.dev/cl/414460 mentions this issue: |
…nguage server is disabled This fixes a bug that made the extension to look up the path to the gopls binary when go.useLanguageServer is false. During the lookup, if the gopls wasn't available, getLanguageServerToolPath eventually triggerred the missing tool prompt and that was not appropriate. Return from buildLanguageServerConfig early if we don't need the language server. Updates #2300 Change-Id: I7572244350f953c8ce874086f4f5cbb45a7301af Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/414456 Reviewed-by: Jamal Carvalho <jamal@golang.org> Reviewed-by: Suzy Mueller <suzmue@golang.org> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com> (cherry picked from commit 4dd972e) Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/414459
…s from custom error handler From vscode-languageclient v8.0.x (LSP 3.17), the language client reports the start errors specially and surfaces them as user visible popups regardless revealOutputChannelOn setting. Thus, our error popups are no longer necessary. Remove this. When an error occurs during initialization, the connection to the server shuts down which triggers the close handler. Previously, we suggested gopls issue report from both initializationFailedHandler and errorHandler.closed handler. That now results in two gopls issue report suggestions. Instead, stash the initialization failure error, and handle the suggestion prompt from one place. Note - in case of initializtion error, there is no point of retrying 5 times. We also explicitly set the error & connection close handlers messages to empty when requesting for continue/restart action, which will suppresses the default error message popups. While we are here, we improve the go status bar's language server state report by updating it when the language server connection close is obeserved. Updates microsoft/vscode-languageserver-node#1011 Fixes #2300 Change-Id: I8b20cf11ebb61ab474950440fc46ff23f7b0b826 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/414457 Reviewed-by: Jamal Carvalho <jamal@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> (cherry picked from commit 99369b6) Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/414460 Reviewed-by: Suzy Mueller <suzmue@golang.org>
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.go version go1.18 darwin/amd64
gopls -v version
to get version of Gopls from the VS Code integrated terminal.golang.org/x/tools/gopls master
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.1.68.1
v0.34.0
Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Tools
command.Checking configured tools....
GOBIN: undefined
toolsGopath:
gopath: /Users/dungtuanle/go
GOROOT: /usr/local/go
PATH: /Users/dungtuanle/go/bin:/usr/local/git/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/go/bin
go env
Workspace Folder (tools): /Users/dungtuanle/Desktop/tools
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/dungtuanle/Library/Caches/go-build"
GOENV="/Users/dungtuanle/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/dungtuanle/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/dungtuanle/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/dungtuanle/Desktop/tools/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/nk/vc539lw93856mchxslm_qds000y1hm/T/go-build1615749012=/tmp/go-build -gno-record-gcc-switches -fno-common"
Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.Describe the bug
Gopls couldn't create handshake when starting gopls server in vscode.
Steps to reproduce the behavior:
go run . -listen=localhost:8091
cmd+shift+p
->Go: Restart Language Server
Screenshots or recordings
The text was updated successfully, but these errors were encountered: