Thanks to visit codestin.com
Credit goes to github.com

Skip to content

x/tools/gopls: quick fix implement method should have doc links for interface #75487

@epelc

Description

@epelc

Is your feature request related to a problem? Please describe.

When you define a compile time interface check like var _ SomeInterface = (*MyType)(nil) and hover over MyType then quick fix to implement SomeInterface the generated methods on MyType have comments with out [] on the interface name.

Image

ie

// DoSomething implements SomeInterface.
func (x *MyType) DoSomething() {

}

Should be:

// DoSomething implements [SomeInterface].
func (x *MyType) DoSomething() {

}

Describe the solution you'd like

It should put the interface name in [] so that it is a documentation link.

https://tip.golang.org/doc/comment#package

The square brackets in [path/filepath] create a documentation link.

Describe alternatives you've considered

Manually having to add [] every time code is generated.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.help wanted

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions