Status: Accepted
Owner:
[hidden email]
Labels: Type-Enh
New issue 6896 by
[hidden email]: differently organized method
categories in the Debugger dnu: create process
http://code.google.com/p/pharo/issues/detail?id=6896When I create methods using the Debugger's 'Create' button I am never sure
which categories are used in the class I'm adding the method to versus
those in its super classes. In an effort to not have to think about that
any more I've adapted the
ClassDescription>>#allMethodCategoriesIntegratedThrough: to put the method
categories that are used in the target class first, then those in the super
classes after that.
I think this should work in Pharo and Squeak but I've only tested it in
Pharo 1.4. I've attached a changeset and also pasted the method below
Paul
allMethodCategoriesIntegratedThrough: mostGenericClass
"Answer a list of all the method categories of the receiver and all its
superclasses, up through mostGenericClass"
| otherClassCategories thisClassCategories combinedClassCategories |
otherClassCategories := OrderedCollection new.
self allSuperclasses
do: [ :aClass |
(aClass includesBehavior: mostGenericClass)
ifTrue: [ otherClassCategories addAll: aClass organization categories ]
].
otherClassCategories remove: 'no messages' asSymbol ifAbsent: [ ].
thisClassCategories := self organization categories asSortedCollection:
[ :a :b | a asLowercase < b asLowercase ].
^ Array
streamContents: [ :stream |
stream
nextPutAll: thisClassCategories;
nextPutAll:
((otherClassCategories asSet removeAllSuchThat: [ :each |
thisClassCategories includes: each ])
asSortedCollection: [ :a :b | a asLowercase < b asLowercase ]) ]
_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker