latest update broke rename method.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

latest update broke rename method.

stepharo
FYI  latest update broke rename method.

privateRenameMethodFor: aMethod
     | class selector oldMethodName newMethodName tempOldArguments
oldArguments argumentPermutation |
     class := aMethod methodClass.
     selector := aMethod selector.
     oldArguments := aMethod ast arguments collect: [ :each | each token
value ].
                                    ^^^^^
     tempOldArguments := aMethod ast arguments collect: [ :each | each
token value ].
     oldMethodName := RBMethodName selector: selector arguments:
oldArguments.
     (newMethodName := self requestMethodNameFor: oldMethodName) ifNil:
[ ^ nil ].
     argumentPermutation := newMethodName arguments collect: [ :each |
tempOldArguments indexOf: each ].
     ^ RBRenameMethodRefactoring
         model: environment
         renameMethod: selector
         in: class
         to: newMethodName selector
         permutation: argumentPermutation

Reply | Threaded
Open this post in threaded view
|

Re: latest update broke rename method.

Marcus Denker-4

> On 27 Feb 2015, at 21:24, stepharo <[hidden email]> wrote:
>
> FYI  latest update broke rename method.
>
> privateRenameMethodFor: aMethod
>    | class selector oldMethodName newMethodName tempOldArguments oldArguments argumentPermutation |
>    class := aMethod methodClass.
>    selector := aMethod selector.
>    oldArguments := aMethod ast arguments collect: [ :each | each token value ].
>                                   ^^^^^
>    tempOldArguments := aMethod ast arguments collect: [ :each | each token value ].
>    oldMethodName := RBMethodName selector: selector arguments: oldArguments.
>    (newMethodName := self requestMethodNameFor: oldMethodName) ifNil: [ ^ nil ].
>    argumentPermutation := newMethodName arguments collect: [ :each | tempOldArguments indexOf: each ].
>    ^ RBRenameMethodRefactoring
>        model: environment
>        renameMethod: selector
>        in: class
>        to: newMethodName selector
>        permutation: argumentPermutation
>


https://pharo.fogbugz.com/f/cases/15025