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: annotations for implementations of interfaces #56695

Open
BIKA-C opened this issue Jun 22, 2022 · 6 comments
Open

x/tools/gopls: annotations for implementations of interfaces #56695

BIKA-C opened this issue Jun 22, 2022 · 6 comments
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@BIKA-C
Copy link

BIKA-C commented Jun 22, 2022

Since go does not have an explicit declaration of which interfaces one implements, it is hard to follow someone's code. I know that there is a command to show all the interfaces, but it is not very intuitive nor efficient.

Goland has the feature of showing a gutter when a function implements an interface. It would be nice to show maybe a codelens over the implementation and the type, or a similar solution as Goland.

Codelens:
pasted

Goland:
image

I found an extension that does kinda the opposite which is not very helpful in most scenario: galkowskit/go-interface-annotations
image

@dle8 dle8 added FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. gopls Issues related to the Go language server, gopls. labels Jun 23, 2022
@2opremio
Copy link

2opremio commented Aug 31, 2022

That's exactly how rust-analyzer handles traits

@icearith
Copy link

icearith commented Sep 2, 2022

this feature seems exactly what I want.

@Shawn-Huang-Tron
Copy link

Shawn-Huang-Tron commented Oct 21, 2022

This feature is very useful and we use it frequently. A lot of my friends doesn't like vscode-go just because of the leak of this feature.So they change to goland.Hope to add such a feature.

@Tony-Sol
Copy link

Tony-Sol commented Nov 8, 2022

+1
this would be an extremely usefull

@hyangah
Copy link
Contributor

hyangah commented Nov 10, 2022

cc @golang/tools-team This can be expensive depending on the size of the search space, but given that there are already similar functionalities (Find All Implementations, or LSP textDocument/implementation), I guess gopls has sufficient information to package this info as a codelens. Is there any concern?

@findleyr
Copy link
Contributor

findleyr commented Nov 10, 2022

We have this in our long-term roadmap for gopls (along with a references codelens), most likely once we build out indexes that can satisfy these queries cheaply. Moving to the gopls issue tracker.

@findleyr findleyr changed the title UI: annotations for implementations of interfaces x/tools/gopls: annotations for implementations of interfaces Nov 10, 2022
@findleyr findleyr removed the gopls Issues related to the Go language server, gopls. label Nov 10, 2022
@findleyr findleyr transferred this issue from golang/vscode-go Nov 10, 2022
@gopherbot gopherbot added this to the Unreleased milestone Nov 10, 2022
@findleyr findleyr modified the milestones: Unreleased, gopls/later Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

9 participants