Skip to content
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

x/tools/gopls: in Centos 7.7 go outline can not be displayed and "go to definition" can not work #35637

Closed
lijingshanxi opened this issue Nov 16, 2019 · 5 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@lijingshanxi
Copy link

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

$ go version
go version go1.13.1 linux/amd64

VS Code version:
Version: 1.40.1
Commit: 8795a9889db74563ddd43eb0a897a2384129a619
Date: 2019-11-13T16:49:30.162Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Linux x64 3.10.0-1062.4.3.el7.x86_64

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
#### Build info
golang.org/x/tools/gopls 0.2.0
    golang.org/x/tools/gopls@v0.2.1
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/go-diff@v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
    golang.org/x/sync@v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
    golang.org/x/tools@v0.0.0-20191108194844-46f05828f2fe h1:FNzasIzfY1IIdyTs/+o3Qv1b7YdffPbBXyjZ5VJJdIA=
    golang.org/x/xerrors@v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc=
    honnef.co/go/tools@v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM=

Go info

go version go1.13.1 linux/amd64

GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/li/.cache/go-build"
GOENV="/home/li/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/data/tidb/deps/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="/bin/gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build094721749=/tmp/go-build -gno-record-gcc-switches"

What did you do?

gopls.zip
outline_is_empty

What did you expect to see?

outline can be displayed

What did you see instead?

outline is empty

@gopherbot gopherbot added this to the Unreleased milestone Nov 16, 2019
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Nov 16, 2019
@gopherbot
Copy link

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@lijingshanxi lijingshanxi changed the title x/tools/gopls: in Centos 7.7 go outline can not displayed and "go to definition can not work" x/tools/gopls: in Centos 7.7 go outline can not be displayed and "go to definition" can not work Nov 16, 2019
@stamblerre
Copy link
Contributor

If you are using modules, have you opened VS Code to the root of the module (the directory that contains the go.mod file)? Most likely, that is the issue.

If that does not help, can you share the output of gopls -rpc.trace -v check /path/to/file.go? Please run the command from inside of the module.

@lijingshanxi
Copy link
Author

If you are using modules, have you opened VS Code to the root of the module (the directory that contains the go.mod file)? Most likely, that is the issue.

If that does not help, can you share the output of gopls -rpc.trace -v check /path/to/file.go? Please run the command from inside of the module.

Very Thanks;

I opened the directory that contain the go.mod, like this:
/data/tidb/deps/go/src/github.com/pingcap/tidb/go.mod
I opened /data/tidb/deps/go/src/github.com/pingcap/tidb/ in VS Code;

I run this command at /data/tidb/deps/go/src/github.com/pingcap/tidb/

gopls -rpc.trace -v check /data/tidb/deps/go/src/github.com/pingcap/tidb/tidb-server/main.go  > 1.txt 2>&1

Below is the result:
log.txt

@lijingshanxi
Copy link
Author

If you are using modules, have you opened VS Code to the root of the module (the directory that contains the go.mod file)? Most likely, that is the issue.

If that does not help, can you share the output of gopls -rpc.trace -v check /path/to/file.go? Please run the command from inside of the module.

Hi, I have recompiled my project, then it works;

Thank you very much;

@stamblerre
Copy link
Contributor

Ok, glad you got it working!

@golang golang locked and limited conversation to collaborators Nov 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants