Move class into another class by ReSharper

775 Views Asked by At

I have a non-nested class WillBeNestedClass and another class NestBox.
Now I want to move class WillBeNestedClass into class NestBox as a nested class. So WillBeNestedClass will be nested in class NestBox.

Is there a refactoring in VS or ReSharper that can do that moving and that automatically updates all references to nested class (from WillBeNestedClass to NestBox.WillBeNestedClass)?

1

There are 1 best solutions below

0
On BEST ANSWER

As far as I'm aware, there is no such quick-action or refactoring available in ReSharper by default. Maybe there is some plugin that allows this - or you could try and create your own. I'm sure it'd be appreciated by more developers.

Available out of the box are:

  • Move to folder
  • Move to namespace
  • Move to separate file

I did, as you, attempt to use Move to namespace and input a type but that dog wouldn't fly.