Cannot rename class vars via Refactoring Tools menu

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

Cannot rename class vars via Refactoring Tools menu

StephenASmith
Hi everyone, I just installed the Refactoring Tools in Squeak 5.1 like this:

Metacello new
                configuration: 'RefactoringTools';
                version: #stable;
                load.

and I am trying to rename some class variables (not instance variables) but
when I select the option from the menu shown below it prompts me for a new
class name, which is unexpected. I'm expecting it to give me the list of
class vars (which do exist) to select one to rename (the same way that the
instance vars rename feature works). If I provide a class name it actually
renames my class. Seems that the wrong code is attached to this menu item?
Anyone else had this issue?

<http://forum.world.st/file/t266054/refactor.png>

I'm trying to figure out where the code is that attaches a method to this
menu. I suspect the wrong method is being called from this menu as the
RBRenameClassVariableTest passes in TestRunner which to me means the code to
rename class variables is working as expected, it's just not linked to this
menu item as expected?

Any help appreciated,
Steve.




--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Reply | Threaded
Open this post in threaded view
|

Re: Cannot rename class vars via Refactoring Tools menu

marcel.taeumel
Uh, thanks for the pointer. :-) I just fixed that. Try updating. I made a 1.0.1 release via Metacello. Otherwise load "mt.3" from "http://ss3.gemtalksystems.com/ss/RefactoringToolsForSqueak" via Monticello.

Best,
Marcel

Am 25.09.2017 10:05:18 schrieb sst <[hidden email]>:

Hi everyone, I just installed the Refactoring Tools in Squeak 5.1 like this:

Metacello new
configuration: 'RefactoringTools';
version: #stable;
load.

and I am trying to rename some class variables (not instance variables) but
when I select the option from the menu shown below it prompts me for a new
class name, which is unexpected. I'm expecting it to give me the list of
class vars (which do exist) to select one to rename (the same way that the
instance vars rename feature works). If I provide a class name it actually
renames my class. Seems that the wrong code is attached to this menu item?
Anyone else had this issue?



I'm trying to figure out where the code is that attaches a method to this
menu. I suspect the wrong method is being called from this menu as the
RBRenameClassVariableTest passes in TestRunner which to me means the code to
rename class variables is working as expected, it's just not linked to this
menu item as expected?

Any help appreciated,
Steve.




--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html



Reply | Threaded
Open this post in threaded view
|

Re: Cannot rename class vars via Refactoring Tools menu

StephenASmith
Thank you very much Marcel for the quick reply and the fix. I had found the
offending method :-) (renameClassVarRefactoring) and was about to make the
fix and post it.

For those interested in the steps to find the method that was incorrect:
1. metaclick (to bring up the halos) on the popup menu where you select
'refactor class var' in the system browser
2. select the debug icon and select 'explore morph'
3. expand the submorphs branch
4. expand the 'refactor class var' branch
5. expand subMenu
6. expand submorphs and select the branch 'rename' (this is the menu item
exhibiting the problem)
7. look at the 'selector' and 'arguments' values - 'arguments' contains the
method name that is exhibiting the problem
8. use the method finder tool to navigate to renameClassVarRefactoring
9. now you know where the problem is and can debug the code (but Marcel has
already done this :)

Cheers,
Steve.



--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Reply | Threaded
Open this post in threaded view
|

Re: Cannot rename class vars via Refactoring Tools menu

marcel.taeumel
Thanks for this explanation! :)

Best,
Marcel

Am 25.09.2017 18:35:14 schrieb sst <[hidden email]>:

Thank you very much Marcel for the quick reply and the fix. I had found the
offending method :-) (renameClassVarRefactoring) and was about to make the
fix and post it.

For those interested in the steps to find the method that was incorrect:
1. metaclick (to bring up the halos) on the popup menu where you select
'refactor class var' in the system browser
2. select the debug icon and select 'explore morph'
3. expand the submorphs branch
4. expand the 'refactor class var' branch
5. expand subMenu
6. expand submorphs and select the branch 'rename' (this is the menu item
exhibiting the problem)
7. look at the 'selector' and 'arguments' values - 'arguments' contains the
method name that is exhibiting the problem
8. use the method finder tool to navigate to renameClassVarRefactoring
9. now you know where the problem is and can debug the code (but Marcel has
already done this :)

Cheers,
Steve.



--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html



Reply | Threaded
Open this post in threaded view
|

Re: Cannot rename class vars via Refactoring Tools menu

Jakob Reschke
In reply to this post by marcel.taeumel
Hi,

Just for the record, you can also get halos for the menu item
directly, by meta-clicking/blue-clicking a second time on the menu
item. It saves you the steps 3-6.

In the debug halo menu for the menu item, you will also find an
"implementors of" command that will browse the method that would be
invoked by the menu item. It does not help in the particular case of
the refactoring tools because the selector you are looking for is in
the argument, not in the selector. Nevertheless, I think this is a
very utile command and I sometimes observe that even experienced
Squeak users do not know about it, hence I felt the urge to mention
it. :-)

Kind regards,
Jakob

2017-09-25 18:35 GMT+02:00 sst <[hidden email]>:

> Thank you very much Marcel for the quick reply and the fix. I had found the
> offending method :-) (renameClassVarRefactoring) and was about to make the
> fix and post it.
>
> For those interested in the steps to find the method that was incorrect:
> 1. metaclick (to bring up the halos) on the popup menu where you select
> 'refactor class var' in the system browser
> 2. select the debug icon and select 'explore morph'
> 3. expand the submorphs branch
> 4. expand the 'refactor class var' branch
> 5. expand subMenu
> 6. expand submorphs and select the branch 'rename' (this is the menu item
> exhibiting the problem)
> 7. look at the 'selector' and 'arguments' values - 'arguments' contains the
> method name that is exhibiting the problem
> 8. use the method finder tool to navigate to renameClassVarRefactoring
> 9. now you know where the problem is and can debug the code (but Marcel has
> already done this :)
>
> Cheers,
> Steve.
>
>
>
> --
> Sent from: http://forum.world.st/Squeak-Dev-f45488.html
>