7

I have a lot of classes with several methods. And i need to separate each method of the class in its own file, but kept they in the same class( make it partial).

Exploring the R# 6.1 options i haven't found linear possibility. May be there are hidden options?

Thanks

Added:

This refactoring is not usual because this code is UI tests, that grouped in class by the part of functionality. We need to separate them to be able to work on them separately from source control.

0

1 Answer 1

6

I'm using ReSharper 5.1 and do not know such refatoring in one step.

The fastest way I know is:

  1. Create partial classes
    Write a second declaration of partial class with empty body and copy/paste or double (Ctl+D) it so often as the count of different files should be.
  2. Create files
    Go to every class declaration, press Ctrl+Shift+R and select Move To Another File..., enter a new file name and press OK.
  3. Move methods
    Do for every method to move: Go to method, press Alt+Enter, select Move declaration(s) to another type part and select file.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.