GemTalk / Jadeite

IDE for GemStone Smalltalk application development using Rowan code management
MIT License
6 stars 2 forks source link

(3.2.8) copy method to a different class fails for extension method #922

Open LisaAlmarode opened 2 years ago

LisaAlmarode commented 2 years ago

drag and drop of methods between classes can either (1) copy the method contents to a new class and create a new method, leaving the old one in place or (2) move a method from one package to another, leaving the class the same with no added or removed methods.

However, if copy an extension method to a class already in the package, you get an error.

Say I have a class AA in package AAA, with method aa. package AAA also contains an extension method bb on class BB (BB class itself is in package BBB).
This means method BB>>bb is in category *aaa.

Attempting to drag method BB>bb to class AA give an error, since the compile statement uses the existing category for the new method, the category is 'aaa', and it's illegal for the category of a method in package AAA to have the category aaa.

ericwinger commented 2 years ago

The stack of the failure is in the attached. RowanClientServices sends rwMoveMethod:toPackage: to move the method. It does not specify the destination category. You can see in the stack that the failure happens deep in Rowan code. I don't think Jadeite has enough information to prevent this, or work around it without an additional api in Rowan.

I propose:

  1. Retire as expected behavior. Aren't *'d categories going away someday anyway?
  2. add an api Behavior>>rwMoveMethod:toPackage:inCategory: so that Jadeite could pass in a legal category. (One solution is for Jadeite to always choose non-starred categories as the destination category. There are other possible solutions) - Is this worth the effort?

@LisaAlmarode thoughts?

20220812_move_method_fails_in_extension_category.txt

LisaAlmarode commented 2 years ago

Perhaps this is a rowan issue? I don't think it can be retired, since you do something legal, and it gives you a walkback. However I don't think it's important... The workaround would be to change the category, copy, then change it back to the original category, but the change-back ran into another walkback, which I'll report separately.

ericwinger commented 2 years ago

Making Lisa the assignee temporarily until a home for this issue finalized or specific Jadeite work is specified.

LisaAlmarode commented 2 years ago

This bug present in 3.2.12 (now you get method failing compilation error) . In 3.2.10, the behavior of *categories is inconsistent; Need a resolution to #956.

LisaAlmarode commented 1 year ago

This is failing still in 3.2.13. Intuitively it doesn't make sense that it fails, but handling of * categories and package residency between Rowan and Rowan Hybrid projects still contains many er quirks. I don't think this is required for first release, since there is a workaround of changing the category first. We might need to publish a list of known bugs.

ericwinger commented 1 year ago

956 is closed. Is this still an issue? Waiting on Rowan?