Open etcimon opened 9 years ago
If I'm getting you right, this depends on the location where the identifier that shall be resolved is located at. Of course, if you're in a class definition that inherits Libevent2Driver (which is not possible because final
), listenTCP should resolve to inherited/local definitions first, that's for sure.
That echoserver example with its resolution to vibe.core.net.d totally makes sense to me, so no misbehaviour recognizable there.
Stuff in libevent2.d furthermore got version(VibeLibeventDriver)
on top, so you probably should elaborate this a bit further :)
Yes, i think the right example would be here https://www.jetbrains.com/resharper/documentation/reviewers_guide.html go to inheriter . The webstorm IDE actually moves to the inheritors after the interface. It's often more convenient when you want to see how it is implemented. Otherwise, find usages could also do but I'm not sure if it should actually be working right now..
I've been writing some features related to interface implementations. The polymorphic objects used in my code can sometimes resolve to a single implementation, but when going to the declaration it's only resolve to the interface. It could be more appropriate to resolve to the only implementation instead.
e.g. https://github.com/rejectedsoftware/vibe.d/tree/master/examples/echoserver
The function
listenTCP
resolves to this: https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/core/net.d#L57The returned object
TCPListener
resolves to this: https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/core/net.d#L243However the only implementation that isn't
version
ed out is this: https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/core/drivers/libevent2.d#L310It seems to me that the resolver should resolve to the actual implementation, unless you're trying to resolve the inherited interface of the implementation here: https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/core/drivers/libevent2.d#L61
This issue could also be tackled by looking up all the possible implementations and putting them in a queue, where every time you hit the "Go to declaration" it picks up the next entry in the list, and loops back when you're at the last.