pharo-project / pharo

Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
http://pharo.org
Other
1.21k stars 355 forks source link

[RB] Refactorings add argument: fails on unary messages #16945

Closed skycluster closed 2 months ago

skycluster commented 2 months ago

Bug description When applying "add argument" to a unary message there is no way to finish the process due to scopes not properly working. The process itself is not straightforward nor is it self-explaining.

To Reproduce Steps to reproduce the behavior:

  1. Create scope from a package.
  2. Apply the scope on the system browser or select scoped view.
  3. Select the unary message to be refactored.
  4. Select from a menu: refactorings -> Add argument.
  5. In the opened window press "+".
  6. Enter the new name for the message.
  7. Enter the argument name to pass.
  8. Remove the excessive old string from selector name.
  9. Press rename.
  10. (in case the hierarchy has the message already - the process fails at this point).
  11. The refactoring changes selection window opens - full scope applied.
  12. When trying to change the scope by selection the drop-down list in the window - the process fails with an error.

Expected behavior The refactoring finishes successfully and it is possible to apply the scopes to choose classes to apply the refactoring to.

Screenshots

Screenshot 2024-07-23 at 22 05 27 Screenshot 2024-07-23 at 00 05 19 Screenshot 2024-07-23 at 00 31 38 Screenshot 2024-07-23 at 13 31 46 Screenshot 2024-07-23 at 13 31 55 Screenshot 2024-07-23 at 13 32 03 Screenshot 2024-07-23 at 13 39 01 Screenshot 2024-07-23 at 13 39 35 Screenshot 2024-07-23 at 13 40 04

Version information:

Expected development cost No idea.

Additional context This feature is addressed in the "Advanced object oriented design and development with Pharo" course. This refactoring works in Pharo 11.0 (stable).

welcome[bot] commented 2 months ago

Thanks for opening your first issue! Please check the CONTRIBUTING documents for some tips about which information should be provided. You can find information of how to do a Pull Request here: https://github.com/pharo-project/pharo/wiki/Contribute-a-fix-to-Pharo

GitHub
Contribute a fix to Pharo
Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk. - pharo-project/pharo
Ducasse commented 2 months ago

THANK YOU for this great bug issue.

Ducasse commented 2 months ago

@carolahp Hi caro I do not know if you have cycles right now but this is a nice bug to fix.

carolahp commented 2 months ago

Hi @Ducasse , I will give it a look now