# HG changeset patch # User Jan Vrany # Date 1391133870 0 # Node ID bf7f37b63ea23106a9ad0cb0b0e9c6d5c1eaeba3 # Parent 26ac4840e5d0222a233c366bbc8ce280b37b0258 Added: ClassDescription>>addInstVarName:afterIndex: - used by refactoring engine This allows refactoring engine to rename instance variables without changing their order - it may have some meaning for either programmer or VM. diff -r 26ac4840e5d0 -r bf7f37b63ea2 ClassDescription.st --- a/ClassDescription.st Mon Jan 13 11:46:28 2014 +0000 +++ b/ClassDescription.st Fri Jan 31 02:04:30 2014 +0000 @@ -697,9 +697,27 @@ !ClassDescription methodsFor:'Compatibility-ST80'! addInstVarName:anotherInstVar - |sel newClass args newNames| - - newNames := self instanceVariableString , ' ' , anotherInstVar. + ^ self addInstVarName:anotherInstVar afterIndex: nil + + "Modified: / 25-02-2009 / 14:51:01 / Jan Vrany " + "Modified: / 18-01-2011 / 17:57:23 / cg" + "Modified: / 31-01-2014 / 02:00:36 / Jan Vrany " +! + +addInstVarName:anotherInstVar afterIndex: indexOrNil + |newClass newNames| + + indexOrNil notNil ifTrue:[ + | oldNames | + + oldNames := self instVarNames asOrderedCollection. + oldNames := oldNames add: anotherInstVar afterIndex: (indexOrNil min: oldNames size). + newNames := oldNames asStringWith:' '. + ] ifFalse:[ + newNames := self instanceVariableString , ' ' , anotherInstVar. + ]. + + self isMeta ifTrue:[ ^ self instanceVariableNames:newNames. @@ -759,8 +777,7 @@ ^ newClass " - "Modified: / 25-02-2009 / 14:51:01 / Jan Vrany " - "Modified: / 18-01-2011 / 17:57:23 / cg" + "Created: / 31-01-2014 / 01:51:08 / Jan Vrany " ! organization @@ -822,6 +839,7 @@ "Created: / 28.3.1998 / 21:21:52 / cg" ! ! + !ClassDescription methodsFor:'Compatibility-V''Age'! categoriesFor:aSelector are:listOfCategories