Skip to content
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

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

Open
adonovan opened this issue Sep 20, 2024 · 0 comments
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@adonovan
Copy link
Member

adonovan commented Sep 20, 2024

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
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Sep 20, 2024
@gopherbot gopherbot added this to the Unreleased milestone Sep 20, 2024
@findleyr findleyr modified the milestones: Unreleased, gopls/v0.18.0 Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants