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: Go to pkg.go.dev #41488

Closed
gertcuykens opened this issue Sep 18, 2020 · 7 comments
Closed

x/tools/gopls: Go to pkg.go.dev #41488

gertcuykens opened this issue Sep 18, 2020 · 7 comments
Labels
Milestone

Comments

@gertcuykens
Copy link
Contributor

@gertcuykens gertcuykens commented Sep 18, 2020

Hover space is precious, only the most necessary description should be in it

image

http.HandlerFunc on pkg.go.dev

is not the place for it, it should be in the right click navigation menu Go to pkg.go.dev instead

image

@gopherbot gopherbot added this to the Unreleased milestone Sep 18, 2020
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Sep 18, 2020

gopls has no way of adding to the context menu, and it's not part of the language server protocol.
You can set "linksInHover": false to disable this feature.

@stamblerre stamblerre closed this Sep 18, 2020
@gertcuykens
Copy link
Contributor Author

@gertcuykens gertcuykens commented Sep 18, 2020

ok fair enough, I will disable it thanks. Maybe I should created the ticket on https://github.com/golang/vscode-go then instead although I doubt this can be done without modifying gopls first so that a separate call to gopls can be made on right click updating the navigation menu. Anyway I will create ticket on vscode-go instead.

image

new ticket created golang/vscode-go#663

@gertcuykens
Copy link
Contributor Author

@gertcuykens gertcuykens commented Sep 18, 2020

actually i wasn't able to disable it in vscode

tried following settings

  "gopls": {
    "linksInHover": false
  },

and looking for a option go.linksInHover

https://github.com/golang/tools/blob/gopls/v0.5.0/gopls/doc/user.md doesn't mention other posiblilities

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Sep 18, 2020

It should be mentioned here: https://github.com/golang/tools/blob/gopls/v0.5.0/gopls/doc/settings.md, but I believe it's still considered an experimental option which is why it's not.

"gopls": {
    "linksInHover": false,
}

This does work for me however. Can you please share a gopls log (https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capturing-logs) from when you see this happening? (Please make sure you are using gopls/v0.5.0 - you can check by running gopls version.)

@gertcuykens
Copy link
Contributor Author

@gertcuykens gertcuykens commented Sep 18, 2020

You are correct seems I wasn't using v.0.5 but after go get -u golang.org/x/tools/gopls my vscode broke

~/Desktop/src master % gopls version                     
golang.org/x/tools/gopls master
    golang.org/x/tools/gopls@v0.5.0 h1:XEmO9RylgmaXp33iGrWfCGopVYDGBmLy+KmsIsfIo8Y=
[Trace - 01:06:14.752 AM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/09/19 01:06:14 module suggested fixes failed:  is not a go.mod file\n\tdirectory=file:///Users/gert/Desktop/src\n"}

[Error - 1:06:14 AM] 2020/09/19 01:06:14 module suggested fixes failed:  is not a go.mod file
	directory=file:///Users/gert/Desktop/src

I have a workspace src with several different seperate go modules. But this is out of the scope of this ticket will troubleshoot it on mailing list or slack.

Thanks anyway for feedback

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Sep 18, 2020

You can update by running GO111MODULE=on go get golang.org/x/tools/gopls@v0.5.0 or by opening the Command Palette (Ctrl+Shift+P) and selecting "Go: Install/Update Tools". Sounds like you may have downloaded a bad version because
gopls at master should only be downloaded by running GO111MODULE=on go get golang.org/x/tools/gopls@master golang.org/x/tools@master.

@gertcuykens
Copy link
Contributor Author

@gertcuykens gertcuykens commented Sep 18, 2020

Did upgrade trough "Go: Install/Update Tools"
gopls version now tells v0.5.0 instead of master but the commit hash seem the same

~/Desktop/src master % gopls version
golang.org/x/tools/gopls v0.5.0
    golang.org/x/tools/gopls@v0.5.0 h1:XEmO9RylgmaXp33iGrWfCGopVYDGBmLy+KmsIsfIo8Y=

I dont have the error message anymore but it also can't compile the source code as in it doesnt get results back

[Trace - 01:36:40.333 AM] Sending request 'textDocument/hover - (8)'.
Params: {"textDocument":{"uri":"file:///Users/gert/Desktop/src/proxy/gzip.go"},"position":{"line":35,"character":7}}

[Trace - 01:36:40.334 AM] Received response 'textDocument/hover - (8)' in 0ms.
Result: null

Anyway you don't have to worry about it I will create specific tickets if I find the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
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.