REfactoring - extract method.

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

REfactoring - extract method.

bestlem
In Pharo 6 I select some code and then from menu choose Suggestions
ExtractMethod

If the code is one line it sometimes works but after the first fail it
then logs "Could not extract code from method'

If it has multiple lines including onbe message over lines I get a
debugger call back

In SugsNatilusContent

selectedStatements
        selectedNode isMessage ifTrue: [ ^{selectedNode} ].
        ^(selectedNode statements select: [ :stat | stat containedBy:
selectionPreviousHighligth ])


selectionPreviousHighligth is nil


That nil is passed to RBMessageNode  containedBy: sp its anInterval is
nil and it crashes.

Apart from the bad spelling what is wrong here?



--
Mark


Reply | Threaded
Open this post in threaded view
|

Re: REfactoring - extract method.

Stephane Ducasse-3
Hi mark

this is probably a bug. 
Also the smart suggestions would need another pass to better integrate them. 

Can you open a bug entry? Now we are busy so this is not clear that it will be fixed. 

Stef

On Sat, Mar 25, 2017 at 6:08 PM, Mark Bestley <[hidden email]> wrote:
In Pharo 6 I select some code and then from menu choose Suggestions ExtractMethod

If the code is one line it sometimes works but after the first fail it then logs "Could not extract code from method'

If it has multiple lines including onbe message over lines I get a debugger call back

In SugsNatilusContent

selectedStatements
        selectedNode isMessage ifTrue: [ ^{selectedNode} ].
        ^(selectedNode statements select: [ :stat | stat containedBy: selectionPreviousHighligth ])


selectionPreviousHighligth is nil


That nil is passed to RBMessageNode  containedBy: sp its anInterval is nil and it crashes.

Apart from the bad spelling what is wrong here?



--
Mark