Skip to content

x/tools/gopls: source.doc code action: missing NewT func that returns unexported type t #69553

@adonovan

Description

@adonovan

The "Show documentation" code action has missing functions. Specifically, a function NewT that returns an instance of a type is grouped under that type as a "constructor" function. But if the type is unexported, neither the type nor its constructors are shown, even if they are exported.

Repro:

package a

type A int

func NewA() A { return 0 }

type a int

func Newa() a { return 0 }
Screenshot 2024-09-20 at 10 24 36 AM

Metadata

Metadata

Assignees

Labels

ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions