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

gopls vscode no symbols found #31535

Closed
yanyan33333 opened this issue Apr 18, 2019 · 2 comments
Closed

gopls vscode no symbols found #31535

yanyan33333 opened this issue Apr 18, 2019 · 2 comments

Comments

@yanyan33333
Copy link

yanyan33333 commented Apr 18, 2019

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

$ go version
go version go1.12.4 windows/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

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\hw\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\hw\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
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\hw\AppData\Local\Temp\go-build951410218=/tmp/go-build -gno-record-gcc-switches

What did you do?

vscode version 1.33.1
vscode-go version 0.9.2
settings.json

"go.useLanguageServer": true,
"go.alternateTools": {
"go-langserver": "gopls"
},
"go.languageServerExperimentalFeatures": {
"format": true,
"autoComplete": true,
"diagnostics": true,
"goToDefinition": true,
"hover": true,
"signatureHelp": true,
"goToTypeDefinition": true,
"documentSymbols": true,
"findReferences": true
},
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"go.buildOnSave": "off",
"go.vetOnSave": "off"

What did you see instead?

everything going well ,but the outline Explorer Tab shows

No symbols found in document

use shortcut Ctrl + Shift + o to Go to Symbol in File shows

No symbols found

when I set "go.useLanguageServer": false and reload , it goes well

thanks for help

@ianthehat
Copy link

I believe this is not a gopls problem, there was a bug in the vscode-go extension that prevented symbols from working.
It was fixed on tip a while ago, but is not yet in the released build I think.
You can try out the beta version as described here
If you try that and it does not work, please re-open this bug.

@yanyan33333
Copy link
Author

thanks ~ it works

@golang golang locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants