Is there a way to have an indicator referring to the interface that a function implements and to see where an interface is implemented? #1735
Replies: 4 comments 7 replies
|
If you run "Find All Implementations" from the struct type, vscode will show the list of interfaces the type implements. There is no visual indicator though. |
|
I agree, I was looking for the same thing. These are those small features that once you get used to them, you can't live without. |
|
I ran into the same issue and ended up making a small VS Code extension that shows a CodeLens with the number of implementations above interfaces and methods. It uses You can try it out on the Marketplace https://marketplace.visualstudio.com/items?itemName=xiaoxuxxxx.gogo-codelens or build the .vsix locally from here https://github.com/xiaoxuxxxx/gogo-codelens?tab=readme-ov-file#option-2-build-and-install-locally |
|
Someone have already created this so its doable and help devs, so why can't we have it in the official go extension? |



If you run "Find All Implementations" from the struct type, vscode will show the list of interfaces the type implements.
If you run "Find All Implementations" from a method, vscode will show the list of corresponding interfaces.
This is not very intuitive but it looks like this was an attempt to fit Go-specific information in the general purpose LSP concept back then.
golang/go#35550
There is no visual indicator though.