Author Topic: Go to definition jumps to declaration instead of definition  (Read 24234 times)

donjoe

  • Community Member
  • Posts: 35
  • Hero Points: 1
Re: Go to definition jumps to declaration instead of definition
« Reply #15 on: January 31, 2012, 09:00:47 am »
If the type is the interface, then how can SE know which implementation of the interface it should jump to?  SE navigates based on type.
You're absolutely right. My bad.

Quote
Maybe it could make sense in small projects to list all implementations and let the user pick, but in the large projects where I usually work there are typically hundreds (or more) of discrete implementations of an interface.
Nevertheless, admitting to the ambiguity and offering a selection dialog is far better than directly violating an explicit user option. As for the potentially huge number of options you'd have to show in that dialog, the same can be said of several other SlickEdit features, but then that's what options such as "Maximum number of FooBars to show" have been introduced for.

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: Go to definition jumps to declaration instead of definition
« Reply #16 on: January 31, 2012, 06:48:55 pm »
Nevertheless, admitting to the ambiguity and offering a selection dialog is far better than directly violating an explicit user option.
I think you're saying that when there isn't an implementation at all, then you consider it a violation to fall back to going to the definition.  And that you want it to compile a list of all things that could indirectly be considered implementations.

Interfaces are by definition abstract with no implementation.  However, other things inherit from the interfaces.  Perhaps SE could recognize that the method is a virtual method with no implementation, and then collect a list of override implementations.  It makes sense to do this, and I've even seen SE seem to do it sometimes, but I can't figure out when it does vs when it doesn't.

I recommend opening a support case on this, and including a link to this topic.

donjoe

  • Community Member
  • Posts: 35
  • Hero Points: 1
Re: Go to definition jumps to declaration instead of definition
« Reply #17 on: January 31, 2012, 09:53:13 pm »
I think you're saying that when there isn't an implementation at all, then you consider it a violation to fall back to going to the definition.
No, my answer came in the context of your previous post, where you suggested a situation with multiple implementations. I'm saying that I consider it a violation of my option to "always go to definition" for SE to actually go to the declaration just because there are multiple implementations and it doesn't know which one to jump to. The fallback option should be "Prompt", not the direct opposite of my selected option.

Quote
It makes sense to do this, and I've even seen SE seem to do it sometimes
AFAIK, Visual Studio does it all the time. That's my baseline for comparison, that's what I'm migrating from.

Quote
I recommend opening a support case on this, and including a link to this topic.
I think that's a paid service and I had such good memories of SE v12 that I thought there was no way I'd need it for v16. :)
« Last Edit: January 31, 2012, 09:54:52 pm by donjoe »

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: Go to definition jumps to declaration instead of definition
« Reply #18 on: February 01, 2012, 02:22:32 am »
I think you're saying that when there isn't an implementation at all, then you consider it a violation to fall back to going to the definition.
No, my answer came in the context of your previous post, where you suggested a situation with multiple implementations. I'm saying that I consider it a violation of my option to "always go to definition" for SE to actually go to the declaration just because there are multiple implementations and it doesn't know which one to jump to.
Except there are in fact zero implementations of IFoo::method.  That's what makes IFoo an interface, it is abstract and does not include an implementation, only pure virtual methods (the declaration of each virtual method ends with "= 0" which explicitly omits any implementation).

Instead, some class Bar will derive from IFoo, and implement method.  Thus there is an implementation of Bar::method, but there are zero implementations of IFoo::method.

So SE would have to search for all classes in any way derived from IFoo, and look for methods called "method", then ignore matches where the signature isn't identical, and then list the remaining derived matches.  But there aren't any implementations of IFoo::method.
« Last Edit: February 01, 2012, 02:26:36 am by chrisant »

dholshou

  • Community Member
  • Posts: 51
  • Hero Points: 1
Re: Go to definition jumps to declaration instead of definition
« Reply #19 on: May 13, 2014, 08:08:43 pm »
I finally gave up.
Upgrading to V18 has been the worst experience I've had with VS in 15 years.
Went back to V15 and everything works like it used to.  :(