IssueRaiser

x/tools/gopls: codelens to show implementations of interfaces

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](https://user-images.githubusercontent.com/50717946/174982252-3d672678-052b-4aea-b4f2-e6458d10bb1c.png) Goland: <img width="744" alt="image" src="https://user-images.githubusercontent.com/50717946/174978822-cecb02b8-ba0c-4c8f-8f87-3da61ac66eca.png"> I found an extension that does kinda the opposite which is not very helpful in most scenario: [galkowskit/go-interface-annotations](https://github.com/galkowskit/go-interface-annotations) <img width="718" alt="image" src="https://user-images.githubusercontent.com/50717946/174983652-4ad9ef84-13ab-4401-8862-e51f6dd0b1a0.png">

Posted by trivial-zero on Jun 22, 2022, 8:36 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments

ux (Software)

x/tools/gopls: codelens to show implementations of interfaces

trivial-zeroJun 22, 2022, 8:36 AM

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](https://user-images.githubusercontent.com/50717946/174982252-3d672678-052b-4aea-b4f2-e6458d10bb1c.png) Goland: <img width="744" alt="image" src="https://user-images.githubusercontent.com/50717946/174978822-cecb02b8-ba0c-4c8f-8f87-3da61ac66eca.png"> I found an extension that does kinda the opposite which is not very helpful in most scenario: [galkowskit/go-interface-annotations](https://github.com/galkowskit/go-interface-annotations) <img width="718" alt="image" src="https://user-images.githubusercontent.com/50717946/174983652-4ad9ef84-13ab-4401-8862-e51f6dd0b1a0.png">

Comments (0)

No comments yet. Start the discussion.

Comment on this issue