Refactor Examples (activates on right mouse click - there is usually a keyboard
key that emulates that):
On:
class C:
....def a(self):
........a = 2
........b = 3
........c = a+b #this should be refactored.
........return c
c = C()
Marking 'a+b' and making an extract method refactor for a method called
'plusMet' should give you:
class C:
....def a(self):
........a = 2
........b = 3
........c = self.plusMet(a, b) #this should be refactored.
........return c
....def plusMet(self, a, b):
........return a+b
c = C()
And with the same class, marking C (it must be the class definition) should
give you:
class G:
....def a(self):
........a = 2
........b = 3
........c = a+b #this should be refactored.
........return c
c = G()
Until now, extract method has given me no problems, but rename does not always
work... It has to scan all the PYTHONPATH and does not always find all the
references (and sometimes may have problems parsing some files too...)
Methods or variables can be renamed too.
And as a helper, a Refactor Results View has been contributed. After any
refactoring it should show which files were changed.