3 ms·
How do you jump to the interface from any structure implementing it? Beside from comments there is no immediate way to which interface/interfaces a structure is
by terminalcommand 9y ago
How do you jump to the interface from any structure implementing it? Beside from comments there is no immediate way to which interface/interfaces a structure is implementing.
Maybe Gogland solves this by keeping records on all interfaces, and checking all structures whether they satisfy them. If that's the case, this is definitely solved by tooling.
- cube2222 9y agoThat's exactly what it does as far as I know. EDIT: I can also search for any interface with a struct selected, and generated stubs for all method. Well, basically what you get for any other language when implementing interfaces.
- sythe2o0 9y agoIf you need this, you can write type assertion lines in a var block of the interfaces that you explicitly want to implement (and this will throw compile time errors if they don't).
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- slrz 9y agoThe standard godoc documentation browser does this too when started with the -analysis option. They all use the same source code oracle functionality available from the x/tools repo.
- cube2222 9y agoNo, Goland actually doesn't use that, they're rolling their own for everything.
- slrz 9y agoThanks for the correction. I think that's somewhat unfortunate, though. The powerful shared tooling is one of the strengths of the Go ecosystem and if there are issues with it that prevent the use in Goland I'd rather see those get fixed. OTOH, they (Jetbrains) probably have shared infrastructure (between languages) within their IDE code base, too, and are more comfortable using their existing tooling.
- cube2222 9y agoThey are actually parsing the code into their custom ast format, so they have a lot of things done out of the box already.