Try #execute rather than #primitiveExecute





Vitor Medina Cruz wrote
> Will wait then.
> 
> I tried to use the RB classes but with no success. There are few docs and
> test code are hard to understand (still not sure if I should use transform
> ou primitiveExecute). I did this:
> 
> (RBRenameMethodRefactoring new
>     renameMethod: #with:doThis:
>     in: RefactoringReformatExample
>     to: #withh:doThis:
>     permutation: #(1 2)) primitiveExecute
> 
> and
> 
> (RBRenameMethodRefactoring new
>     renameMethod: #with:doThis:
>     in: RefactoringReformatExample
>     to: #withh:doThis:
>     permutation: #(1 2)) tranform
> 
> but nothing happens... It is really odd, I expected an error at least.
> 
> I am assuming permutation means the change of params order.
> 
> 
> On Fri, May 22, 2020 at 3:50 AM Stéphane Ducasse <

> stephane.ducasse@

> >
> wrote:
> 
>> we are working with sebastian jordan on a better rewriter.
>>
>> S.
>>
>> On 21 May 2020, at 17:17, Vitor Medina Cruz <

> vitormcruz@

> > wrote:
>>
>> Interesting, I will have a look at it.
>>
>> On Thu, May 21, 2020 at 11:52 AM Thierry Goubier <
>> 

> thierry.goubier@

>> wrote:
>>
>>> Hi Vitor,
>>>
>>> as a matter of fact, the infrastructure for doing what you're looking
>>> for is already there.
>>>
>>> The algorithm is the following:
>>>
>>> - create a scope (something based on RBBrowserEnvironment, such as
>>> RBClassEnvironment or based on regexes and AND / OR operations:
>>> RBAndEnvironment, RBNotEnvironment, which allows for virtually
>>> anything, such as all #printString methods in the package X that do
>>> not belong to class Y)
>>>
>>> - create a refactoring command: if it is not a pre-existing command
>>> such as rename class, etc..., then writing a pattern matcher is
>>> possible with RBTreeRewriter.
>>>
>>> - execute the refactoring command on the environment, changing only
>>> for the subset of code visible in the environment.
>>>
>>> Normally, the system browser or the search tools should automatically
>>> setup the environment for you, and scope accordingly most of the
>>> refactoring commands. As far as I know, there isn't yet a shell giving
>>> you the full pattern matching rewrite power, but some work was
>>> underway (GUI tools).
>>>
>>> Going with the source files as you did also work...
>>>
>>> Regards,
>>>
>>> Thierry
>>>
>>> Le jeu. 21 mai 2020 à 15:30, Vitor Medina Cruz &lt;

> vitormcruz@

> &gt; a
>>> écrit :
>>> >
>>> > Well, as it seems, there is no way of find/replacing other than inside
>>> a single method.
>>> >
>>> > As a workaround, I did the following:
>>> >
>>> > 1- Committed all my image work in progress;
>>> > 2- Opened the project structure in an external tool (notepad++ in this
>>> case) and did the find/replace there;
>>> > 3- Committed it using git command line;
>>> > 4- Back to the image, I did a repair repository from iceberg checking
>>> out and ignoring changes to the image (safe because I did commit
>>> everything
>>> before)
>>> >
>>> > If there are many places to change, it is worth.
>>> >
>>> > Regards,
>>> > Vitor
>>> >
>>> > On Tue, May 19, 2020 at 12:56 PM Vitor Medina Cruz <
>>> 

> vitormcruz@

>> wrote:
>>> >>
>>> >> Hello,
>>> >>
>>> >> Is there a way to make find replace in a class scoped way? I can do
>>> that with finder, but I figured only with package scoping. I wanna to
>>> change the name of a variable in multiple methods, and also I would like
>>> to
>>> regex replace an expression also in multiple methods.
>>> >>
>>> >> Regards,
>>> >> Vitor
>>>
>>>
>> --------------------------------------------
>> Stéphane Ducasse
>> http://stephane.ducasse.free.fr / http://www.pharo.org
>> 03 59 35 87 52
>> Assistant: Aurore Dalle
>> FAX 03 59 57 78 50
>> TEL 03 59 35 86 16
>> S. Ducasse - Inria
>> 40, avenue Halley,
>> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
>> Villeneuve d'Ascq 59650
>> France
>>
>>





--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Reply via email to