Refactoring

David Shaffer cdshaffer at acm.org
Thu Jan 19 16:33:51 UTC 2006


Jason Rogers wrote:

>On 1/19/06, stéphane ducasse <ducasse at iam.unibe.ch> wrote:
>  
>
>>Hi Nigel,
>>
>>This is true that the support for refactorings could be better.
>>In VisualWorks the refactoring engine is integrated and the default
>>browser.
>>
>>Now for 3.9 we are trying to integrate the RB engine everywhere with
>>shortcut support
>>and I strongly believe that Squeak could be much better than the one
>>in VisualWorks :) but we
>>need to people to help.
>>    
>>
>
>Another nice-to-have-feature-that-is-way-beyond-me is to have scoped
>renaming of a method.  I hate having to rename a method manually and
>delete the old named one, then update my code that was using the old
>method just because the parent of my class defined a method with the
>same selector.
>  
>

Me too.  I keep a workspace script around:

    "Renaming method only in package"
    | pi env |
    pi := PackageOrganizer default packageNamed: 'SomePackage' ifAbsent: [].
    env := BrowserEnvironment new forPackage: pi.
    (RenameMethodRefactoring
        model: (RBNamespace onEnvironment: env)
        renameMethod: #someSelector:
        in: RSContainer
        to: #someOtherSelector:
        permuation: #(1)) execute

for renaming at the package level but a UI would definitely be nice. 
The same thing could be done at the class level.

David




More information about the Squeak-dev mailing list