Search code examples
c++visual-studioresharper

Visual Studio & Resharper: Rename class only in current project and not entire solution


I have a solution with many projects in it.

Two projects both have a class with the same name. Lets call them project A and project B.

When i use resharper rename feature (Ctrl+R -> R) in project B and rename the class, then that new class name will be applied to project A as well.

Before refactoring:

Project A (ActorPool.h)

class ActorPool
{
  // ...
}

Project B (ActorPool.h)

class ActorPool
{
    //...
}

After refactoring (placing cursor on project B's ActorPool and ctrl+r -> r renaming ActorPool to ObjectPool)

Project A (ObjectPool.h)

class ObjectPool
{
  // ...
}

Project B (ObjectPool.h)

class ObjectPool
{
    //...
}

Expected result after refactoring:

Project A (ActorPool.h)

class ActorPool
{
  // ...
}

Project B (ObjectPool.h)

class ObjectPool
{
    //...
}

Here is the rename popup from resharper, i cant see any options to limit the scope of this refactor operation:

Resharper Rename Popup

How do i apply a rename through resharper only for the current project (e.g. the project the file belongs to, in my example project B, that contains the class that i'm performing the refactor on)?


Solution

  • Unfortunately, this is a known issue RSCPP-18643 that does not have an ETA yet. Feel free to vote for/star this issue to subscribe for updates.