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: 'span' should support the import module path with upper-case #34230

Closed
movie-travel-code opened this issue Sep 11, 2019 · 3 comments

Comments

@movie-travel-code
Copy link

commented Sep 11, 2019

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/opt/go/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/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-build295263798=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Clone https://github.com/nytimes/gizmo and put gizmo under module mode, jump to definition for gizmo/pubsub/kafka/config.go: Config *sarama.Config.

What did you expect to see?

The expected trace log for the definition jump.

[Trace - 6:58:12 PM] Received response 'textDocument/definition - (5)' in 75ms.
Params: [{"uri":"file:///Users/henrywong/workspace/gopath/pkg/mod/github.com/!shopify/sarama@v1.23.1/config.go","range":{"start":{"line":20,"character":5},"end":{"line":20,"character":11}}}]

What did you see instead?

There is %21 in the uri. %21 corresponds to "!", the exclamation mark is intended, see #26456.

[Trace - 6:58:12 PM] Received response 'textDocument/definition - (5)' in 75ms.
Params: [{"uri":"file:///Users/henrywong/workspace/gopath/pkg/mod/github.com/%21shopify/sarama@v1.23.1/config.go","range":{"start":{"line":20,"character":5},"end":{"line":20,"character":11}}}]

vscode-go can handle this because of https://github.com/microsoft/vscode/blob/master/src/vs/base/common/uri.ts#L478. However I think it would be better convert the %21 back to ! when gopls reply the result to the clients.

@gopherbot gopherbot added this to the Unreleased milestone Sep 11, 2019

@gopherbot

This comment has been minimized.

Copy link

commented Sep 11, 2019

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

@stamblerre

This comment has been minimized.

Copy link
Contributor

commented Sep 16, 2019

Does CL 195618 fix this for you?

@movie-travel-code

This comment has been minimized.

Copy link
Author

commented Sep 17, 2019

It works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.