golang / vscode-go

Go extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=golang.Go
Other
3.88k stars 754 forks source link

Gopls server error Unknown command ...fast #1186

Closed ntsd closed 3 years ago

ntsd commented 3 years ago

My go autocomplete doesn't work

After I restart the language server I found this error from gopls

gopls flags are:
[Info  - 3:25:35 PM] Connection to server got closed. Server will restart.
[Error - 3:25:35 PM] Connection to server got closed. Server will not be restarted.
gopls: Unknown command ...fast
The Go Language source tools.

What version of Go, VS Code & VS Code Go extension are you using?

Build info
----------
golang.org/x/tools/gopls v0.6.5
    golang.org/x/tools/gopls@v0.6.5 h1:kLt9rD/dWtVdvc8LmdcxagDFih6zxYXREpKSYYZu5KE=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/google/go-cmp@v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8=
    golang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
    golang.org/x/sys@v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k=
    golang.org/x/tools@v0.1.1-0.20210201201750-4d4ee958a9b7 h1:/wdPW261t381NDQd8TBo63/FyvACfLICwtH8wMRoHJQ=
    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
    honnef.co/go/tools@v0.0.1-2020.1.6 h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc=
    mvdan.cc/gofumpt@v0.1.0 h1:hsVv+Y9UsZ/mFZTxJZuHVI6shSQCtzZ11h1JEFPAZLw=
    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

Go: Locate Configured Go Tools command

GOBIN: /Users/ntsd/git/go/bin
toolsGopath: 
gopath: /Users/ntsd/git/go
GOROOT: /usr/local/go
PATH: /usr/local/go/bin:/Users/ntsd/.asdf/shims:/usr/local/opt/asdf/bin:/Users/ntsd/git/go/bin:/Users/ntsd/git/go:/usr/local/go:/usr/local/opt/gnu-getopt/bin:/Users/ntsd/google-cloud-sdk/bin:/Users/ntsd/.rbenv/shims:/Users/ntsd/.nvm/versions/node/v12.17.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/ntsd/Library/Android/sdk/tools:/Users/ntsd/Library/Android/sdk/platform-tools:/usr/local/bin/gradle:/Users/ntsd/Library/Android/sdk/build-tools/29.0.2/:/usr/local/Cellar/python@3.8/3.8.6/bin:/Users/ntsd/.gem/ruby/2.6.0/bin:/Users/ntsd/flutter/bin:/usr/local/opt/gettext/bin:/usr/local/opt/libxml2/bin:/usr/local/mysql/bin

   gopkgs: /Users/ntsd/git/go/bin/gopkgs installed
   go-outline: /Users/ntsd/git/go/bin/go-outline installed
   gotests: /Users/ntsd/git/go/bin/gotests installed
   gomodifytags: /Users/ntsd/git/go/bin/gomodifytags installed
   impl: /Users/ntsd/git/go/bin/impl installed
   goplay: /Users/ntsd/git/go/bin/goplay installed
   dlv: /Users/ntsd/git/go/bin/dlv installed
   golint: /Users/ntsd/git/go/bin/golint installed
   gopls: /Users/ntsd/git/go/bin/gopls installed

go env
Workspace Folder (ewaas-boilerplate): /Users/ntsd/git/omise/ewaas-boilerplate
    GO111MODULE=""
    GOARCH="amd64"
    GOBIN="/Users/ntsd/git/go/bin"
    GOCACHE="/Users/ntsd/Library/Caches/go-build"
    GOENV="/Users/ntsd/Library/Application Support/go/env"
    GOEXE=""
    GOFLAGS=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOINSECURE=""
    GOMODCACHE="/Users/ntsd/git/go/pkg/mod"
    GONOPROXY=""
    GONOSUMDB=""
    GOOS="darwin"
    GOPATH="/Users/ntsd/git/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"
    GCCGO="gccgo"
    AR="ar"
    CC="clang"
    CXX="clang++"
    CGO_ENABLED="1"
    GOMOD="/Users/ntsd/git/omise/ewaas-boilerplate/go.mod"
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/y2/qwk84xfn4vj35h_7100sr6540000gp/T/go-build227871366=/tmp/go-build -gno-record-gcc-switches -fno-common"

image

hyangah commented 3 years ago

@ntsd What is your setting like? I see the following error message

gopls flags are:
gopls: Unknown command ...fast
The Go Language source tools.

Looks like the gopls flags ("go.languageServerFlags") contained invalid values and gopls terminated after printing the error message.

ntsd commented 3 years ago

@ntsd What is your setting like? I see the following error message

gopls flags are:
gopls: Unknown command ...fast
The Go Language source tools.

Looks like the gopls flags ("go.languageServerFlags") contained invalid values and gopls terminated after printing the error message.

Yes, it is now fixed. Thanks.