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/internal/lsp: Wrong symbol kind for the textDocument/symbol. #31202

Closed
movie-travel-code opened this issue Apr 2, 2019 · 3 comments
Closed
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@movie-travel-code
Copy link

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

$ go version
go version go1.12 darwin/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
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/henrywong/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/henrywong/workspace/gopath"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/fm/bk0wqlkj523gdp9pbtnyvxmm0000gn/T/go-build954865857=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Get the textDocument/symbol for the go source file.

// The symbol kind for `int_basic_alias` should be `NumberSymbol`, not `StructSymbol`.
type int_basic_alias = int

What did you expect to see?

For the type alias, lsp should strip off the type alias to get the essential type. And compute the correct symbol based on the essential type.

// The symbol kind for `int_basic_alias` should be `NumberSymbol`
type int_basic_alias = int

What did you see instead?

// The symbol kind for `int_basic_alias` is `StructSymbol`
type int_basic_alias = int
@gopherbot gopherbot added this to the Unreleased milestone Apr 2, 2019
@stamblerre
Copy link
Contributor

cc @zmb3

@gopherbot
Copy link

Change https://golang.org/cl/170198 mentions this issue: internal/lsp: enhance document symbols support

@movie-travel-code
Copy link
Author

movie-travel-code commented Apr 3, 2019

Hi @zmb3 btw, I have sent a PR for this issue. Please review it and help me decide if it can solve the this issue. Seemly, you have sent a PR for that, thanks!

@andybons andybons added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 3, 2019
@golang golang locked and limited conversation to collaborators Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants