Hi , please integrate this change to Class>>rename:

rename: aString 
        "The new name of the receiver is the argument, aString."

        | oldName newName |
        (newName := aString asSymbol) = (oldName := self name)
                ifTrue: [^ self].
        (self environment includesKey: newName)
                ifTrue: [^ self error: newName , ' already exists'].
        name := newName.
        self environment renameClass: self from: oldName.
        
        (Undeclared includesKey: newName)
                ifTrue: [self inform: 'There are references to, ' , aString 
printString , '
from Undeclared. Check them after this change.'].


I moved the (Undeclared..... ) statement to the end. 

To  send   #inform: after performing the actual change, and not before. 

In this way you can catch the ProvideAnswerNotification, and remove the modal 
dialog that pops up and still perform the actual class rename!

For example...

[ self performRefactoring: refactoring ] on: ProvideAnswerNotification do:[:err 
| " do not inform the user! " ].


Please let me know if you agree, and will integrate it.
Saludos,
Fernando

Attachment: Class-rename.st
Description: Binary data

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to