SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: Wanderer on November 16, 2008, 04:19:51 PM

Title: Defs and Refs problems
Post by: Wanderer on November 16, 2008, 04:19:51 PM
Hello,

My class has overloaded functions like
  doIt(InterfaceA * pifc)
  doIt(InterfaceB * pifc)

When I right-click on a use
  InterfaceA * pIfcA = /* something */;
  doit(pIfcA);
and select "Go to References to doIt", I am given a list of the two versions of doIt() to choose from.  Regardless of the version I choose, SlickEdit lists all references to all versions.

Similarly, if I right-click on doIt(ifcA) and choose "Go to definition of doIt", I have to choose from a list of all versions, both declarations and definitions.  In this case, I am guessing SlickEdit only looks at the function name, and not the parameter list.  It would be nice if the params were evaluated; if I have 5 overloads, the list is 10 entries...

UPDATE:  This problem is very tedious.  I am working in the same handful of overloaded functions; when I click on a function call, I want to go to that specific overload's definition.  Since I have "Options->Languages->Application Languages->C/C++->Context Tagging->Go to Definition->Prefer to navigate directly to symbol definition" checked, why are the prototypes listed in the Select Symbol dialog?  Removing the prototypes would cut the number of entries in the dialog in half.  (Of course, the right thing is to go to the correct def w/o presenting all overloads in a list....)
Title: Re: Defs and Refs problems
Post by: ScottW, VP of Dev on November 18, 2008, 02:59:11 PM
Have you tried using "Attempt to filter out non-matching function overloads (expensive and slow)?" It's on the Context Tagging options under the "Prefer to navigate directly to ..." settings. That should filter out the non-matching overloads, but I can't predict just how "expensive and slow" it will be for you.

I'm looking into why the prototypes are being listed. It does seem that they should be in a case like this.
Title: Re: Defs and Refs problems
Post by: ScottW, VP of Dev on November 18, 2008, 03:26:33 PM
OK, the setting I suggested before only applies to "Go to Definition", not "Go to Reference". As for the issue with both prototypes and functions being listed, I can't replicate that. No matter what I do, I'm only getting the functions listed in the Select Symbol dialog. The "Prefer to Navigate directly to..." settings only apply to "Go to Definition". So, having selected a function in the Select Symbol dialog, I am presented with a list of references to all symbol references using the same symbol name--no type matching is done to filter this list.
Title: Re: Defs and Refs problems
Post by: Wanderer on November 18, 2008, 04:06:29 PM
Have you tried using "Attempt to filter out non-matching function overloads (expensive and slow)?" It's on the Context Tagging options under the "Prefer to navigate directly to ..." settings. That should filter out the non-matching overloads, but I can't predict just how "expensive and slow" it will be for you.

I'm looking into why the prototypes are being listed. It does seem that they should be in a case like this.
Thanks, Scott, that setting helps, and it doesn't seem to add too much overhead.
Here's an odd case -- when symbol is in a #if 0/#endif block, SE prompts with a list of declarations and definitions.


Title: Re: Defs and Refs problems
Post by: ScottW, VP of Dev on November 18, 2008, 09:03:57 PM
OK, I got the story on this one. The Select Symbol dialog will always display the full set of declarations and definitions regardless of your settings. The thought is that since a choice is required anyway, you might as well have a comprehensive list of choices.
Title: Re: Defs and Refs problems
Post by: Wanderer on November 19, 2008, 07:07:47 PM
Now what?  "Go to Definition" only works intermittently, even on a function that is not overloaded.  If the Preview toolbar is visible, the def and the decl are listed, but Ctrl-. doesn't do anything.
If I turn off "Attempt to filter out non-matching....", it works as expected, but then I have the frustration with the overloaded functions...

Title: Re: Defs and Refs problems
Post by: Wanderer on December 03, 2008, 04:29:30 PM
Now what?  "Go to Definition" only works intermittently, even on a function that is not overloaded.
I now think that "Go to Definition" does not work for a non-overloaded function when "Attempt to filter out non-matching...." is checked.
Is there a workaround for this problem, other than turning off "Attempt to filter..."?
Is this likely to be addressed in the near future?

Title: Re: Defs and Refs problems
Post by: ScottW, VP of Dev on December 04, 2008, 08:39:32 PM
It seems to be working for me. The only problem I get is that sometimes it can't rule out the overload. I've never seen a case where it fails to find the definition, regardless of whether it is overloaded or not.

Can you boil this down to a small workspace that reliably demonstrates the problem and attach it to a post? That should help us figure out what's going on.
Title: Re: Defs and Refs problems
Post by: Wanderer on December 04, 2008, 09:43:01 PM
Can you boil this down to a small workspace that reliably demonstrates the problem and attach it to a post? That should help us figure out what's going on.
Here ya' go....
Line 32, main.cpp, cursor on collectByID(), click "Go to Definition..."
Title: Re: Defs and Refs problems
Post by: ScottW, VP of Dev on December 15, 2008, 03:04:02 PM
I just wanted to give you an update. I was able to reproduce this problem using the workspace you posted. Thank you very much for that! I can't tell you how frustrating it is to read problems and then not be able to reproduce them.

Anyway, I've forwarded this on to the appropriate developer and we'll see what he has to say.
Title: Re: Defs and Refs problems
Post by: Dennis on December 16, 2008, 08:05:45 PM
Thanks for the example.  An updated 13.0.2 hot fix will be available by the end of the week.