|
Last Site Update: 20 July 2010 | Latest Version: 1.6.0 |
|
|
|
|
|
|
|
![]() |
![]() |
|
|
Well, let's see how refactoring works... and let's make it by example :-P As our 'base', we will use the example below:
Renaming: This refactoring is provided by Pydev and provides a
preview and undo/redo (the others are provided by BRM and have undo/redo only for the current editor
-- which should be ok as they are refactorings that work only in the local scope).
That would give us the following result:
Extracting a method: Let's mark the '100+500' and press Alt+Shift+M (alternatively, you could use a context menu: press the right button and select: refactoring > Extract Method). And set the name of the new method to 'newMethod'.
That would give us the following result:
Inlining a variable: Let's say that we are still not satisfied with that, we wouldn't like that 'var' variable, so, we want to remove the reference to it and call the method directly. To do that, mark the 'var' and press Alt+Shift+I.
That would give us the following result:
Extracting a variable: Ok, it just wasn't what we wanted, so, let's make the opposite refactoring, let's extract a variable from the self.newMethod() call. Mark it and press Alt+Shift+L and set the name to 'newVar'
That would give us the following result:
And that's it for the refactoring... hope you enjoy it.
|
|
|
Copyright: Aptana, Inc. 2008-2010 |