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

Comments

@inliquid
Copy link

@inliquid inliquid commented Sep 11, 2019

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
@golang golang deleted a comment from gopherbot Oct 3, 2019
@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

@gopherbot gopherbot commented Dec 5, 2019

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

@stamblerre stamblerre commented Dec 5, 2019

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

@gopherbot gopherbot commented Dec 6, 2019

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

@stamblerre stamblerre commented Dec 17, 2019

This is complete as of the above CL.

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
4 participants
You can’t perform that action at this time.