Skip to content

x/tools/gopls: Find All References on named parameters should show the return values #60075

Description

@jsgoupil

Is your feature request related to a problem? Please describe.
When using Find All References, I expect to find all references where a variable is used or assigned.
If I am using a named return parameters, then the final return is not included in the references.

x := func() (other string) {
	defer func() {
		fmt.Println("I got: " + other)
	}()

	other = "abc"
	return "def"
}

xx := x()
fmt.Println(xx)

Searching the variable other in the code above will not give me the final def usage.
image

Describe the solution you'd like
Show me the return line in the References.

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.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions