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: support pkg.go.dev in textDocument/documentLink #35563

Closed
zikaeroh opened this issue Nov 13, 2019 · 10 comments

Comments

@zikaeroh
Copy link

@zikaeroh zikaeroh commented Nov 13, 2019

gopls currently uses godoc.org in its documentLink responses. This is fine, but it'd be nice to support the new pkg.go.dev site as it lets you look at a specific module version's documentation.

gopls has the module version info for imports, so could construct links to the new site with the correct version, which would work a bit better than just pointing to godoc.org in some cases. (Looking at the implementation of documentLink, it would require some extra work, since right now it just uses the AST and grabs the link, versus actually needing the import info.)

Sorry to drop the issue template, but it's a feature request and I thought it'd be a bunch of stuff that didn't matter.

@gopherbot gopherbot added this to the Unreleased milestone Nov 13, 2019
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 13, 2019

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

@dmitshur

This comment has been minimized.

Copy link
Member

@dmitshur dmitshur commented Nov 14, 2019

/cc @julieqiu

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Nov 14, 2019

Thanks for the suggestion! We can quite absolutely change the links to point to pkg.go.dev, but you're right that adding the versions will be a little tougher. It will be more doable once #31999 is resolved.

@jbszczepaniak

This comment has been minimized.

Copy link

@jbszczepaniak jbszczepaniak commented Nov 22, 2019

@stamblerre I would like to claim this one. Is this ready to be done, or do we wait for #31999 ?

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Nov 22, 2019

@jbszczepaniak: I think we can do the first step of changing the link godoc.org links to point to pkg.go.dev.

@zikaeroh

This comment has been minimized.

Copy link
Author

@zikaeroh zikaeroh commented Nov 22, 2019

If the version info isn't going to be used, I'd maybe consider making this configurable. The default behavior of pkg.go.dev compared to godoc.org (@latest vs @master) makes it somewhat difficult to work with some libraries like docker, where @latest is simply never the right thing. (That, and for people who are still working in non-module-aware repos, but these are all of course edge cases.)

@jbszczepaniak

This comment has been minimized.

Copy link

@jbszczepaniak jbszczepaniak commented Nov 28, 2019

So what is decision here @stamblerre? Do we want to get version as well and point to the right pkg.go.dev website?

If this is only about changing link, here is the CL https://go-review.googlesource.com/c/tools/+/209337

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Nov 29, 2019

Getting the version will only be possible after #31999 is complete, but I am fine with moving forward on changing the links. We could also add a setting to opt-out and use godoc instead, as per @zikaeroh's suggestion.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 29, 2019

Change https://golang.org/cl/209337 mentions this issue: internal/lsp: link to the new pkg.go.dev instead of godoc.org

gopherbot pushed a commit to golang/tools that referenced this issue Nov 30, 2019
Updates golang/go#35563

Change-Id: I88ae3f742daf5043d4784fe8827454fb1ce1f9db
Reviewed-on: https://go-review.googlesource.com/c/tools/+/209337
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Dec 4, 2019

Closing this since we are now linking to https://pkg.go.dev. Using version info can be tracked in #31999.

@stamblerre stamblerre closed this Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.