Skip to content

x/tools/gopls: invalid error messages when switching between tags in kubernetes #43023

Open
@wu0407

Description

@wu0407

What version of Go are you using (go version)?

$ go version
1.15.5
gopls :  0.5.5 
gopls flags: -rpc.trace



Does this issue reproduce with the latest release?

  1. open kubernets folder that code in the git tag 1.18.6, wait gopls server finished
  2. checkout to 1.19.0, that gopls server can not get functions document it fallback to use getdoc
  3. do "go: restart language server", it is not reponsed and retry again
  4. wait some moment, vscode go extension report The language server is not able to serve any features. Initialization failed: Error: Connection got disposed..

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\xiaoqing\AppData\Local\go-build
set GOENV=C:\Users\xiaoqing\AppData\Roaming\go\env  
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=D:\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=D:\go
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=D:\git\kubernetes\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\xiaoqing\AppData\Local\Temp\go-build065131578=/tmp/go-build -gno-record-gcc-switches

What did you do?

many go.exe process find in task manger

What did you expect to see?

checkout new branch should restart gopls server

What did you see instead?

gopls stop work and hover text not show anything after click "go: restart language server"
I can do reload windows to slove this problem
gopls server log
gopls-stop-work-on-checkout-new-branch.txt

vscode settings:
workspace

{
    //"go.buildTags": "linux",
    "go.toolsEnvVars": {
    "GOFLAGS": "-tags=linux -mod=mod"
    },
}

user

{
    "files.eol": "\n",
    "go.useCodeSnippetsOnFunctionSuggest": true,
    "editor.renderWhitespace": "all",
    "editor.renderControlCharacters": true,
    "files.autoSave": "afterDelay",
    "editor.wordWrap": "on",
    "go.toolsEnvVars": {
    
    //    "GOFLAGS": "-tags=linux"
    },
    "go.languageServerFlags": [
        "-rpc.trace",
    ],
    "go.languageServerExperimentalFeatures": {


        "diagnostics": true,
        "documentLink": true
    },
    "workbench.settings.openDefaultSettings": true,
    "editor.minimap.enabled": false,
    "go.formatTool": "goimports",
    "go.useLanguageServer": true,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions