Extract-method refactoring erratic behavior in Pharo 8

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

Extract-method refactoring erratic behavior in Pharo 8

Esteban A. Maringolo
Hi,

I get, more often than not, a message indicating an "invalid source to
extract", commonly with the "End of statement list encountered"
explanation.

In comparison, I can extract the same code in Pharo 4. Is there a
reason why the "Extract method" refactoring is not working in Pharo 8
as it was in that or any other version?

Thanks!

Esteban A. Maringolo

Reply | Threaded
Open this post in threaded view
|

Re: Extract-method refactoring erratic behavior in Pharo 8

Tim Mackinnon
Well said. Yes - we should work on our refactoring tools a lot more.  As the inventors of refactoring and the tools that back it, we’ve got to a place where we are a bit poor in this area - it’s not fluid and easy like it should be. Although - hats off to the automatic rewrite tools for migration - that is very neat. But let’s rally around making the basic refactorings enjoyable and easy again.

Tim

> On 31 Jul 2020, at 19:23, Esteban Maringolo <[hidden email]> wrote:
>
> Hi,
>
> I get, more often than not, a message indicating an "invalid source to
> extract", commonly with the "End of statement list encountered"
> explanation.
>
> In comparison, I can extract the same code in Pharo 4. Is there a
> reason why the "Extract method" refactoring is not working in Pharo 8
> as it was in that or any other version?
>
> Thanks!
>
> Esteban A. Maringolo
>


Reply | Threaded
Open this post in threaded view
|

Re: Extract-method refactoring erratic behavior in Pharo 8

Stéphane Ducasse


On 1 Aug 2020, at 01:58, Tim Mackinnon <[hidden email]> wrote:

Well said. Yes - we should work on our refactoring tools a lot more.  As the inventors of refactoring and the tools that back it, we’ve got to a place where we are a bit poor in this area - it’s not fluid and easy like it should be. Although - hats off to the automatic rewrite tools for migration - that is very neat. But let’s rally around making the basic refactorings enjoyable and easy again.

Please help us. 

Tim

On 31 Jul 2020, at 19:23, Esteban Maringolo <[hidden email]> wrote:

Hi,

I get, more often than not, a message indicating an "invalid source to
extract", commonly with the "End of statement list encountered"
explanation.

In comparison, I can extract the same code in Pharo 4. Is there a
reason why the "Extract method" refactoring is not working in Pharo 8
as it was in that or any other version?

Thanks!

Esteban A. Maringolo




--------------------------------------------
Stéphane Ducasse
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

Reply | Threaded
Open this post in threaded view
|

Re: Extract-method refactoring erratic behavior in Pharo 8

Stéphane Ducasse
In reply to this post by Esteban A. Maringolo


> On 31 Jul 2020, at 20:21, Esteban Maringolo <[hidden email]> wrote:
>
> Hi,
>
> I get, more often than not, a message indicating an "invalid source to
> extract", commonly with the "End of statement list encountered"
> explanation.
>
> In comparison, I can extract the same code in Pharo 4. Is there a
> reason why the "Extract method" refactoring is not working in Pharo 8
> as it was in that or any other version?

I asked my self this exact question. The answer is
without UI tests we are doomed to break things.


S.


Reply | Threaded
Open this post in threaded view
|

Re: Extract-method refactoring erratic behavior in Pharo 8

tbrunz
I found the same problem only yesterday when I tried "Extract method" in
Pharo 8 (for the first time).

Comprehensive UI tests would be a great thing.  But complicated to create.
Like writing tutorials for GUI-based applications.  ;^)

Is there a way to emulate a GUI user and the actions of mouse moves & clicks
(as well as keypresses)?  And to capture the results of pointing, clicking,
right-click menu selections, etc?

Is there a UI testing framework for Pharo that includes this?  If not,
should we start building one?

How much of the above is tied directly to Spec2 and how much is part of the
core elements of Pharo?

-t





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

Reply | Threaded
Open this post in threaded view
|

Re: Extract-method refactoring erratic behavior in Pharo 8

Stéphane Ducasse


On 2 Aug 2020, at 16:45, tbrunz <[hidden email]> wrote:

I found the same problem only yesterday when I tried "Extract method" in
Pharo 8 (for the first time).

Comprehensive UI tests would be a great thing.  But complicated to create.
Like writing tutorials for GUI-based applications.  ;^)

the problem is that right now we can write tests for UI and we try hard to do it but 
as soon as we have a pop up we do not have yet a way to capture this interaction. 
We were discussing about it and got it by the covid. 

Is there a way to emulate a GUI user and the actions of mouse moves & clicks
(as well as keypresses)?  
Yes. 
You can have a look at Spec20 tests

And to capture the results of pointing, clicking,
right-click menu selections, etc?

Is there a UI testing framework for Pharo that includes this?  If not,
should we start building one?

We are missing a way to model pop up and more. 


How much of the above is tied directly to Spec2 and how much is part of the
core elements of Pharo?

-t





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


--------------------------------------------
Stéphane Ducasse
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

Reply | Threaded
Open this post in threaded view
|

Re: Extract-method refactoring erratic behavior in Pharo 8

tbrunz
> the problem is that right now we can write tests for UI and we try hard to
do it but
> as soon as we have a pop up we do not have yet a way to capture this
> interaction.
> We were discussing about it and got it by the covid.

So many things have been impacted by COVID.  Now we have new ways of
working.

>> Is there a way to emulate a GUI user and the actions of mouse moves &
>> clicks
>> (as well as keypresses)?  
> Yes.
> You can have a look at Spec20 tests

I guess it's time for me to dive into Spec2...  I want to add a Spec2 UI to
my Zebra Puzzle tutorial.  That certainly will require UI tests, too.

>> And to capture the results of pointing, clicking,
>> right-click menu selections, etc?
>>
>> Is there a UI testing framework for Pharo that includes this?  If not,
>> should we start building one?

> We are missing a way to model pop up and more.

That sounds like the first step, then...

-t



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

Reply | Threaded
Open this post in threaded view
|

Re: Extract-method refactoring erratic behavior in Pharo 8

Tim Mackinnon
In reply to this post by tbrunz
I think these ones should be testable quite easily - I wrote (when prompted by Stef) a series of tests for the text selection expansion commands which use a similar ast/node based inferencing - so  the refactorings should be written with an ast passed to them along with cursor and text selection positioning and that is all testable. (if its not this way, we should change it so it is unit testable like this).

If I can get some time (hopefully my newish job starts to lighten up a bit), I will try and have a look if no-one else has stepped in. I'm quite passionate in making pharo more "intellij fluid-like" so we can have an enjoyable keyboard centric, and fast modern refactoring experience as we have all the right tooling to do this really well.

Tim

On Sun, 2 Aug 2020, at 3:45 PM, tbrunz wrote:

> I found the same problem only yesterday when I tried "Extract method" in
> Pharo 8 (for the first time).
>
> Comprehensive UI tests would be a great thing.  But complicated to create.
> Like writing tutorials for GUI-based applications.  ;^)
>
> Is there a way to emulate a GUI user and the actions of mouse moves & clicks
> (as well as keypresses)?  And to capture the results of pointing, clicking,
> right-click menu selections, etc?
>
> Is there a UI testing framework for Pharo that includes this?  If not,
> should we start building one?
>
> How much of the above is tied directly to Spec2 and how much is part of the
> core elements of Pharo?
>
> -t
>
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Extract-method refactoring erratic behavior in Pharo 8

Esteban A. Maringolo
Hi,

Just to add some feedback to this, I found that having the formatter
in auto mode seems to interfere. If I disable the formatter and resort
to the manual Ctrl+Shift+F shortcut, then it seems I'm able to extract
code in a more predictable way.

I don't know if it was that or if it was just a coincidence and I'm in a fluke.

Regards,

Esteban A. Maringolo

On Sun, Aug 2, 2020 at 4:19 PM Tim Mackinnon <[hidden email]> wrote:

>
> I think these ones should be testable quite easily - I wrote (when prompted by Stef) a series of tests for the text selection expansion commands which use a similar ast/node based inferencing - so  the refactorings should be written with an ast passed to them along with cursor and text selection positioning and that is all testable. (if its not this way, we should change it so it is unit testable like this).
>
> If I can get some time (hopefully my newish job starts to lighten up a bit), I will try and have a look if no-one else has stepped in. I'm quite passionate in making pharo more "intellij fluid-like" so we can have an enjoyable keyboard centric, and fast modern refactoring experience as we have all the right tooling to do this really well.
>
> Tim
>
> On Sun, 2 Aug 2020, at 3:45 PM, tbrunz wrote:
> > I found the same problem only yesterday when I tried "Extract method" in
> > Pharo 8 (for the first time).
> >
> > Comprehensive UI tests would be a great thing.  But complicated to create.
> > Like writing tutorials for GUI-based applications.  ;^)
> >
> > Is there a way to emulate a GUI user and the actions of mouse moves & clicks
> > (as well as keypresses)?  And to capture the results of pointing, clicking,
> > right-click menu selections, etc?
> >
> > Is there a UI testing framework for Pharo that includes this?  If not,
> > should we start building one?
> >
> > How much of the above is tied directly to Spec2 and how much is part of the
> > core elements of Pharo?
> >
> > -t
> >
> >
> >
> >
> >
> > --
> > Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> >
> >
>

Reply | Threaded
Open this post in threaded view
|

Re: Extract-method refactoring erratic behavior in Pharo 8

Stéphane Ducasse
Thanks. This is a useful information. 
We found a bug in calypso, apparently the editor is sometimes working on the edited text and sometimes on the previous version (via the object).

Philippe did you open the issue we talked about?

Tx

On 8 Aug 2020, at 01:36, Esteban Maringolo <[hidden email]> wrote:

Hi,

Just to add some feedback to this, I found that having the formatter
in auto mode seems to interfere. If I disable the formatter and resort
to the manual Ctrl+Shift+F shortcut, then it seems I'm able to extract
code in a more predictable way.

I don't know if it was that or if it was just a coincidence and I'm in a fluke.

Regards,

Esteban A. Maringolo

On Sun, Aug 2, 2020 at 4:19 PM Tim Mackinnon <[hidden email]> wrote:

I think these ones should be testable quite easily - I wrote (when prompted by Stef) a series of tests for the text selection expansion commands which use a similar ast/node based inferencing - so  the refactorings should be written with an ast passed to them along with cursor and text selection positioning and that is all testable. (if its not this way, we should change it so it is unit testable like this).

If I can get some time (hopefully my newish job starts to lighten up a bit), I will try and have a look if no-one else has stepped in. I'm quite passionate in making pharo more "intellij fluid-like" so we can have an enjoyable keyboard centric, and fast modern refactoring experience as we have all the right tooling to do this really well.

Tim

On Sun, 2 Aug 2020, at 3:45 PM, tbrunz wrote:
I found the same problem only yesterday when I tried "Extract method" in
Pharo 8 (for the first time).

Comprehensive UI tests would be a great thing.  But complicated to create.
Like writing tutorials for GUI-based applications.  ;^)

Is there a way to emulate a GUI user and the actions of mouse moves & clicks
(as well as keypresses)?  And to capture the results of pointing, clicking,
right-click menu selections, etc?

Is there a UI testing framework for Pharo that includes this?  If not,
should we start building one?

How much of the above is tied directly to Spec2 and how much is part of the
core elements of Pharo?

-t





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





--------------------------------------------
Stéphane Ducasse
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