This Question is Possibly Answered

1 "correct" answer available (4 pts) 1 "helpful" answer available (2 pts)
3 Replies Last post: Sep 10, 2013 10:51 AM by Anton Makeev  
Mark Bernstein Newbie 7 posts since
Jul 30, 2013
Currently Being Moderated

Sep 9, 2013 6:04 PM

Show Usages: what is a usage, exactly?

What is the definition of a "usage" for Show Usages?

 

Two C++ situations in particular concern me. First, consider overloading:

 

class A {

...

    virtual void Mill(Sprocket*);

    virtual void Mill(Sprocket*, Tool*);

    virtual void Mill()

...

};

 

Does Show Usages locate uses of all three methods?  Or only of the method with the corresponding signature?

 

Suppose I select the zero-argument declaration of Mill and Rename it. Will we also rename the one-argument and two-argument methods?

 

 

Second, consider two unrelated classes, each of which have a method with the same name.

 

class FactoryModel {

     virtual void  Mill();

     };

 

class RiverFloss {

     virtual void Mill();

     }

 

If I select the declaration in FactoryModel, will we also find usages for RiverFloss?

 

Suppose I rename the method in FactoryModel by selecting Mill() in the declaration.  Will I also rename the method in RiverFloss?

Anton Makeev JetBrains 1,291 posts since
Dec 19, 2006
Currently Being Moderated
Sep 9, 2013 6:32 PM in response to: Mark Bernstein
Re: Show Usages: what is a usage, exactly?

Mark,

currently, AppCode finds only usages of the exact symbol under the caret (no overloads).

Here is a feature request to also allow findind overloaded functions.

 

As for the overridden functions, every time AppCode asks, if you want to find the statically typed usages, or usages of the base method:

Screen Shot 2013-09-09 at 16.27.28 .png

 

You can also check this blog post for other Find Usages tips.

Anton Makeev JetBrains 1,291 posts since
Dec 19, 2006
Currently Being Moderated
Sep 10, 2013 10:51 AM in response to: Mark Bernstein
Re: Show Usages: what is a usage, exactly?

Mark,

thanks, that's a bug in AppCode, here is a report you may follow.

More Like This

  • Retrieving data ...