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/cmd/gopls: shows canonical path when in symlinked path #32377

mdhender opened this issue May 31, 2019 · 3 comments

x/tools/cmd/gopls: shows canonical path when in symlinked path #32377

mdhender opened this issue May 31, 2019 · 3 comments


Copy link

@mdhender mdhender commented May 31, 2019

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

$ go version
go version go1.12.5 darwin/amd64

Does this issue reproduce with the latest release?


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

go env Output
$ go env
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/5s/fp5yn8mn2yb5cjz4wbh1jbph0000gq/T/go-build534139428=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Ran code from a symlinked directory.

$ pwd
$ ll -d /Volumes/ssda/mdhender/Software/ui5app
drwxr-xr-x  17 mdhender  staff  578 May 31 16:14 /Volumes/ssda/mdhender/Software/ui5app
$ ll -d /Volumes/ssdb/mdhender/Software/ui5app
drwxr-xr-x  17 mdhender  staff  578 May 31 16:14 /Volumes/ssdb/mdhender/Software/ui5app
$ ll -d /Volumes/ssdb/mdhender/Software
lrwxr-xr-x  1 mdhender  wheel  32 Apr 22  2015 /Volumes/ssdb/mdhender/Software -> /Volumes/ssda/mdhender/Software/

Initially, hovering over an identifier will display the popup with information on the symbol. After an indeterminate while, the hover will stop, formatting will stop, and the output for gopls will display something like

[Info  - 4:29:19 PM] no signature help for file:///Volumes/ssda/mdhender/Software/ui5app/adapters/ui5/adapter.go:100:6 : cannot find an enclosing function
[Error - 4:29:20 PM] Request textDocument/codeAction failed.
  Message: /Volumes/ssda/mdhender/Software/ui5app/adapters/ui5/adapter.go:101:18: missing ',' in parameter list
  Code: 0 

Note that the path in the error message is the canonical path for my project, not the path that I opened the editor in.


[Error - 4:31:46 PM] Request textDocument/hover failed.
  Message: no room in queue
  Code: -32000 

An earlier error was

[Error - 2:17:19 PM] unable to check package for
file:///Volumes/ssda/mdhender/Software/ui5app/main.go: go [list -e -json -compiled=true -test=true -export=false -deps=true -find=false -- /Volumes/ssda/mdhender/Software/ui5app]: exit status 1: build cannot find module for path

I haven't seen that again since a restart.

What did you expect to see?

Hovering over a symbol should show the popup and saving should do the formatting and updating import statements. Paths in the error messages should reflect the current location.

What did you see instead?

I'd expect that popups and formatting not stop working randomly. I'm surprised that the output shows the canonical path instead of the path that I started in, but I can almost understand that.

FWIW, I don't think that the apparent out of memory error is related to the symlink path. Just throwing that in for good measure.

@gopherbot gopherbot added this to the Unreleased milestone May 31, 2019
@gopherbot gopherbot added the gopls label May 31, 2019
Copy link

@freeformz freeformz commented Jun 1, 2019

The "formatting will stop" part may be be related to #32368, which I patched, can you update gopls and see if that part of the problem continues?

WRT canonical path, this doesn't surprise me, but I'll leave further commentary up to others.

Copy link
Contributor Author

@mdhender mdhender commented Jun 1, 2019

@freeformz that seems to be the case here, too. Adding a file and deleting it, then making a change in another file cause the hover popup to say "Loading..." and then the "no room in queue" starts. I'll try updating gopls. Thanks!

Confirmed - updating gopls fixes the error with popups and formatting after deleting a .go file.

$ gopls version h1:tvvUBWZ5+WFnfcokh8TavIRxYRxUtmB+gQgCytJckhs=
Copy link
Contributor Author

@mdhender mdhender commented Jun 2, 2019

I'm ok with closing this since it seems to be a feature of os.Getwd:

Getwd returns a rooted path name corresponding to the current directory. If the current directory can be reached via multiple paths (due to symbolic links), Getwd may return any one of them.

@mdhender mdhender closed this Jun 2, 2019
@golang golang locked and limited conversation to collaborators Jun 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.