Lukas, that doesn't seem right, as I had to do it manually and it seems to work fine in my code (maybe it wasn't clear what was trying to extract)? - e.g. nextEditorCharacter := (editor text at: editor startIndex ifAbsent: [nil ]). (opposite = aCharacter and: [ nextEditorCharacer = aCharacter ]) ifTrue: [.... I should have been able to select the expression 'editor text at: editor startIndex ifAbsent: [nil ])' and use the extract temporary menu item to get the above. In fact, it looks like if you select it from right to left then sometimes it un-disables that source menu item (but not always)? Or if I select it left to right as well as the space at the end of the expression? Something seems amiss somewhere. Tim On 2 Aug 2010, at 14:34, Lukas Renggli wrote:
On 2 August 2010 15:13, Tim Mackinnon <tamackinnon@gmail.com> wrote:
I was having a look at some of the ecompletion code - and noticed that I couldn't do an extract to temporary refactoring because the refactor source method is grayed out?
This looks like a bug - and I'm happy to report it - but just wanted to check with people here.
The code fragment in question is:
(opposite = aCharacter and: [ (editor text at: editor startIndex ifAbsent: [ nil ]) = aCharacter ]) ifTrue: [ editor selectFrom: editor startIndex + 1 to: editor startIndex. self invalidateEditorMorph. ^ true ].
If I hilite the expresion (editor.... nil]) inside the and: block its grayed out? I should be able to extract a temp for that code shouldn't I?
No, that's not a bug. For obvious reasons you cannot extract expressions with a return inside.
Lukas
-- Lukas Renggli www.lukas-renggli.ch
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project