Skip to content

x/tools/gopls: Sublime Text 3 - LSP: Error loading workspace folders(excepted 1, got 0) #43746

@thep0y

Description

@thep0y

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

$ go version
go version go1.15.6 linux/amd64

Does this issue reproduce with the latest release?

yes.

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/thepoy/.cache/go-build"
GOENV="/home/thepoy/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/thepoy/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/thepoy/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build522328134=/tmp/go-build -gno-record-gcc-switches"

What did you do?

According to the official document, gopls is enabled through LSP in sublime text 3. If I do not start sublime in the terminal, gopls will report an error: Error loading workspace folders(excepted 1, got 0).
If you start sublime in the terminal, everything is normal.
LSP setting:

{
  "clients": {
    "gopls": {
      "enabled": true,
      "command": [
        "gopls"
      ]
    }
  }
}

Project structure:
图片

What did you expect to see?

I hope gopls can run normally.

What did you see instead?

gopls is not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeToolsThis 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

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions