Skip to content

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

@xieyuschen

Description

@xieyuschen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.help wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions