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?

0

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.

0

To expand on this a bit, here are two methods I'm look at right now.

class Node ....{

      virtual void          GetPosition(double& outx,double& outy) const;
      virtual SPoint      GetPosition() const;
     ....
};

In the old days, we used the first version. Now, we're in transition to the second, which returns an object instead of the ugly pair of doubles.  


Now, i select the second GetPosition (bold above) and press cmd-F7.  The first item on the list is:

     MultipleMoveAction.mm
        draggedNode->GetPosition(dragx,dragy);

If I understood you correctly above, this should NOT be a usage of GetPosition().  Is my problem (a) I'm selecting the wrong text and confusing AppCode, (b) misunderstanding Find Usages, or (c) something else entirely?
0

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

0

请先登录再写评论。