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: List package constants for a type when mousing over type #71907

Open
soypat opened this issue Feb 22, 2025 · 3 comments
Open

x/tools/gopls: List package constants for a type when mousing over type #71907

soypat opened this issue Feb 22, 2025 · 3 comments
Labels
FeatureRequest Issues asking for a new feature that does not need a proposal. gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.

Comments

@soypat
Copy link

soypat commented Feb 22, 2025

gopls version

$ gopls -v version
Build info

golang.org/x/tools/gopls v0.18.0
golang.org/x/tools/[email protected] h1:oBmnrmi0Uk7Ea+ZPK16BdcjnpEJX8ciBCSp9S90GULo=
github.com/BurntSushi/[email protected] h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=
github.com/google/[email protected] h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
golang.org/x/exp/[email protected] h1:1xaZTydL5Gsg78QharTwKfA9FY9CZ1VQj6D/AZEvHR0=
golang.org/x/[email protected] h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
golang.org/x/[email protected] h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
golang.org/x/[email protected] h1:L2k9GUV2TpQKVRGMjN94qfUMgUwOFimSQ6gipyJIjKw=
golang.org/x/[email protected] h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/[email protected] h1:4+it9JYqVd2wIAapscAb5mUAI1yHY0u4B4idYPigWeE=
golang.org/x/[email protected] h1:NPGnvPOTgnjBc9HTaUx+nj+EaUYxl5SJOWqaDYGaFYw=
honnef.co/go/[email protected] h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I=
mvdan.cc/[email protected] h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU=
mvdan.cc/xurls/[email protected] h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
go: go1.24.0

go env

N/A

What did you do?

Moused over the type time.Duration

What did you see happen?

Type declaration, type documentation comment, type method set displayed.

What did you expect to see?

See a list of time package defined constants of type time.Duration as well as what is already provided. Probably not of all constants, 6 or so would be already helpful to get an idea of the type's use.

Editor and settings

No response

Logs

No response

@soypat soypat added gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels Feb 22, 2025
@gopherbot gopherbot added this to the Unreleased milestone Feb 22, 2025
@gabyhelp gabyhelp added the FeatureRequest Issues asking for a new feature that does not need a proposal. label Feb 23, 2025
@findleyr
Copy link
Member

Thanks for the issue.

I'm not sure this would be universally useful. The way to find usage of a type is to find references, though in the case of time.Duration, that may be noisy.

It is important that hover information be succinct, and mixing in usage information seems counter to that goal.

@findleyr findleyr modified the milestones: Unreleased, gopls/unplanned Feb 24, 2025
@soypat
Copy link
Author

soypat commented Feb 25, 2025

Maybe it makes more sense for the special case of enum-like constants defined with = iota. So think of time.Weekday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest Issues asking for a new feature that does not need a proposal. 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

4 participants