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: return godoc.org reference in documentation #34240

Closed
inliquid opened this issue Sep 11, 2019 · 5 comments
Closed

x/tools/gopls: return godoc.org reference in documentation #34240

inliquid opened this issue Sep 11, 2019 · 5 comments
Labels
Documentation FeatureRequest FrozenDueToAge gopls Issues related to the Go language server, gopls. help wanted Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@inliquid
Copy link

I propose to add a feature (probably configuarable) when documentation request will result with a related godoc.org reference at the bottom, in same way as it's done in other editors/places.

For example, here is how standard VS Code HTML language feature returns reference to MDN for a class property documentation:
изображение
And here is how it's done for Go in Goland:
изображение
Latter have a link to https://godoc.org/github.com/jinzhu/gorm#DB.Model

I found it very useful.

@gopherbot gopherbot added this to the Unreleased milestone Sep 11, 2019
@gopherbot gopherbot added Documentation gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels Sep 11, 2019
@golang golang deleted a comment from gopherbot Oct 3, 2019
@Southclaws
Copy link

I've picked this up https://go-review.googlesource.com/c/tools/+/200604

@stamblerre stamblerre changed the title x/tools/gopls: [Feature Request] return godoc.org reference in documentation x/tools/gopls: return godoc.org reference in documentation Dec 4, 2019
@stamblerre stamblerre modified the milestones: Unreleased, gopls v1.0 Dec 4, 2019
@gopherbot
Copy link

Change https://golang.org/cl/200604 mentions this issue: internal/lsp: expose godoc or pkg.go.dev link on hover

gopherbot pushed a commit to golang/tools that referenced this issue Dec 5, 2019
This adds a link to documentation to the hover contents for the
current symbol if it is exported.

Updates golang/go#34240

Change-Id: I19c66e91e46f79284bfd0006c53f518eda4edef7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200604
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
@stamblerre
Copy link
Contributor

The above CL partially fixes this, as it doesn't handle methods or fields. A follow-up is needed to handle this.

@gopherbot
Copy link

Change https://golang.org/cl/210201 mentions this issue: internal/lsp: improve link in documentation on hover

gopherbot pushed a commit to golang/tools that referenced this issue Dec 12, 2019
This change refactors some of the logic that builds a link anchor for
a given symbol, pushing the actual Link into the HoverInformation struct.
This is necessary because type information is needed to build up that
link in certain cases, like methods.

The last step will be to correctly display struct fields.

Updates golang/go#34240
Fixes golang/go#36031

Change-Id: I7f989faddbaa07f91838a870b4477bf78ce8ddf7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/210201
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
@stamblerre
Copy link
Contributor

This is complete as of the above CL.

@stamblerre stamblerre modified the milestones: gopls/v1.0.0, gopls/v0.4.0 Jul 22, 2020
@golang golang locked and limited conversation to collaborators Jul 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FeatureRequest FrozenDueToAge gopls Issues related to the Go language server, gopls. help wanted Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants