[Pharo-project] Class>>rename:
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
Hola Fernando. If you want something to be integrated, you should follow the rules. As an start, open a bug ticket, set the correct status and label, and commit to inbox. Otherwise, this mail will be forgotten. Cheers Mariano 2010/4/27 Fernando olivero <oliverof@lu.unisi.ch>
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
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
and a test would help too :) On Apr 28, 2010, at 7:57 PM, Mariano Martinez Peck wrote:
Hola Fernando.
If you want something to be integrated, you should follow the rules. As an start, open a bug ticket, set the correct status and label, and commit to inbox. Otherwise, this mail will be forgotten.
Cheers
Mariano
2010/4/27 Fernando olivero <oliverof@lu.unisi.ch>
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
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Ok, will do! On Apr 28, 2010, at 8:54 PM, Stéphane Ducasse wrote:
and a test would help too :)
On Apr 28, 2010, at 7:57 PM, Mariano Martinez Peck wrote:
Hola Fernando.
If you want something to be integrated, you should follow the rules. As an start, open a bug ticket, set the correct status and label, and commit to inbox. Otherwise, this mail will be forgotten.
Cheers
Mariano
2010/4/27 Fernando olivero <oliverof@lu.unisi.ch>
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
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Issue 2437. Fix in Pharo Inbox: Name: Kernel-FernandoOlivero.662 Author: FernandoOlivero
Is #rename: still untracked by changes log? 2010/5/17 Fernando olivero <oliverof@lu.unisi.ch>:
Issue 2437. Fix in Pharo Inbox:
Name: Kernel-FernandoOlivero.662 Author: FernandoOlivero
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
Class>>rename: aString .. self environment renameClass: self from: oldName. .. I've believe that when the method SystemDictionary>>classRenamed: from: to: inCategory: is sent , the rename get's logged. Is that what you were asking? Fernando On May 17, 2010, at 1:11 PM, Igor Stasenko wrote:
Is #rename: still untracked by changes log?
2010/5/17 Fernando olivero <oliverof@lu.unisi.ch>:
Issue 2437. Fix in Pharo Inbox:
Name: Kernel-FernandoOlivero.662 Author: FernandoOlivero
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On 17 May 2010 16:54, Fernando olivero <oliverof@lu.unisi.ch> wrote:
Class>>rename: aString     ..     self environment renameClass: self from: oldName.     ..
I've believe that when the method  SystemDictionary>>classRenamed: from: to: inCategory:  is sent , the rename get's logged.
Is that what you were asking?
yes
Fernando
On May 17, 2010, at 1:11 PM, Igor Stasenko wrote:
Is #rename: still untracked by changes log?
2010/5/17 Fernando olivero <oliverof@lu.unisi.ch>:
Issue 2437. Fix in Pharo Inbox:
Name: Kernel-FernandoOlivero.662 Author: FernandoOlivero
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
participants (4)
-
Fernando olivero -
Igor Stasenko -
Mariano Martinez Peck -
Stéphane Ducasse