Problems Page
The three top-most mistakes when extracting a method are:
-
The selection does not cover statements from a method body.
-
The selection does not cover whole statements, which is defined as:
-
everything between two semicolons (; ... ;), or
-
a whole block, totally contained within a set of curly braces ({ ... }).
-
the selection doesn't mark the condition part of an if/then/else, do/while, or while statement. Besides normal statements these parts can be extracted too.
On the problems pages, you can press F1 to link to a detailed description of errors.