Showcase
On this page we would like to show you some of the things we have achieved in our term project.
Rename Local Variable
Preview
Warning when renaming an argument
Rename Attribute
Preview
Warning when object might belong to multiple types
Rename Method Eclipse Preview
Preview
Rename Method
class Knight(object): def print_stat(self): print "alive" def fight(self, other): print "fighting" self.print_stat() other.print_stat() knight1 = Knight() knight2 = Knight() knight1.fight(knight2)
Renaming the print_stat to print_status would result in:
class Knight(object): def print_status(self): print "alive" def fight(self, other): print "fighting" self.print_status() other.print_status() knight1 = Knight() knight2 = Knight() knight1.fight(knight2)
Rename Attribute in complex situations
Renaming an attribute is a common refactoring. Here's an example:
class Knight(object): def __init__(self, name): self.name = name def create(klass, name): return klass(name) robin = create(Knight, "Sir Robin") print robin.name
Suppose we want to rename the name attribute in Knight to full_name. We can select name in __init__ or at the end in the print statement and run the refactoring, and the result is this:
class Knight(object): def __init__(self, name): self.full_name = name def create(klass, name): return klass(name) robin = create(Knight, "Sir Robin") print robin.full_name
Handy :).





