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: implement type hierarchy support #72142

Open
findleyr opened this issue Mar 6, 2025 · 1 comment
Open

x/tools/gopls: implement type hierarchy support #72142

findleyr opened this issue Mar 6, 2025 · 1 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.
Milestone

Comments

@findleyr
Copy link
Member

findleyr commented Mar 6, 2025

Recently, @adonovan a I were discussing the problem of finding interfaces/implementations for function types, and we (re)encountered a critical limitation of the textDocument/implementations query: there's no way to go up the type hierarchy (which matters a lot for Go!). Currently, gopls (by convention) serves implementations when asking for implementation of a concrete type. But if you're on type HandlerFunc func(ResponseWriter, *Request), there's no way to query both interfaces implemented by this type (http.Handler, in this case), and functions that implement it (all of the literal handlers in your codebase).

From microsoft/language-server-protocol#2037 (comment), it sounds like the only option is to implement the textDocument/typeHierarchy request, though unfortunately this is not supported by many clients. Nevertheless, we should implement this capability.

@findleyr findleyr added this to the gopls/backlog milestone Mar 6, 2025
@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 Mar 6, 2025
@gabyhelp
Copy link

gabyhelp commented Mar 6, 2025

@gabyhelp gabyhelp added the FeatureRequest Issues asking for a new feature that does not need a proposal. label Mar 6, 2025
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

3 participants