5

In resharper features page:

Extract Class
Enables extracting some of the fields and methods of a class into a separate, newly created class. This refactoring is useful, when a class has grown too large, too incoherent, or does too many things.

I select couple methods within class, open context menu and can't find anything related to extract class, do I miss something?

1 Answer 1

4

Found it: enter image description here

You need to place your cursor on class name, then in Refactor menu there's Extract class submenu.

But couple tries show, that functionality still needs polishing:

  • would like to have ability simply select methods/fields to be moved to new class and then choose Extract Class,
  • it does not add using statements for newly created class,
  • if moving only static methods it does not mark newly class as static, that means it tries to create instance of it when it is not needed and many other small things :)
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.