Skip to content

x/tools/gopls: provide links for replace in go.mod #73423

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

Closed
xieyuschen opened this issue Apr 17, 2025 · 4 comments
Closed

x/tools/gopls: provide links for replace in go.mod #73423

xieyuschen opened this issue Apr 17, 2025 · 4 comments
Labels
FeatureRequest Issues asking for a new feature that does not need a proposal. 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

@xieyuschen
Copy link
Contributor

xieyuschen commented Apr 17, 2025

gopls version

gopls tip

go env

irrelevant

What did you do?

  1. in local replacement case, the local path doesn't have a link.

Image

  1. in case of require A v1.2.3, replace A => A v2.3.4, if I click the required module, it jumps to v1.2.3 go doc rather than v2.3.4.

Image

What did you see happen?

NA

What did you expect to see?

I would like to support the 2 cases above:

  1. the local replacement(replace A => /local/path should have a link to /local/path/go.mod, so once I click the link i can jump to the corresponding module. Adding a go.mod rather than /local/path because vscode will show an empty page if you want to open a folder.
    I want this feature because I define a CLI which helps to insert many local replacements via code generation, and it will be great if the local path has a link so i can click it in vscode.

  2. the docs should respect the replace, the jumped link should have version v0.32.0 rather than v0.30.0.

I can help to do the code change, actually I already have a draft here.

Editor and settings

No response

Logs

No response

@xieyuschen xieyuschen added gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels Apr 17, 2025
@xieyuschen
Copy link
Contributor Author

@adonovan @findleyr could you let me know whether you think it's a good improvement.

@findleyr
Copy link
Member

Lets discuss this in triage as well.

@dmitshur dmitshur changed the title [golang/go] x/tools/gopls: feature request: go.mod: provide links for replaces x/tools/gopls: provide links for replace in go.mod Apr 17, 2025
@dmitshur dmitshur added the FeatureRequest Issues asking for a new feature that does not need a proposal. label Apr 17, 2025
@gopherbot gopherbot added this to the Unreleased milestone Apr 17, 2025
@ansaba ansaba modified the milestones: Unreleased, Backlog Apr 17, 2025
@findleyr
Copy link
Member

Thanks, we think that this is a good improvement. Please feel free to send a CL.

@findleyr findleyr modified the milestones: Backlog, gopls/backlog Apr 17, 2025
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/667015 mentions this issue: gopls/internal/server: support links and hovers for replace directive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest Issues asking for a new feature that does not need a proposal. 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

5 participants