[squeak-dev] ClassOrganizer and classifyAllUnclassfied
2018-12-06 19:28:24 UTC
Hi all,

while going through categories I naturally came by the source code for categorizing all uncategorized messages through the context menu in the Browser (Browser>>#categorizeAllUncategorizedMethods). I found that that method implemented the logic of classifying methods which I found odd as this sounds like something the class organizer should take care of. Thus, I rewrote the two classes to the code below:

"Categorize methods by looking in parent classes for a method category."

self classOrMetaClassOrganizer classifyAllUnclassified.
self changed: #messageCategoryList


| organizers |
organizers := self subject withAllSuperclasses collect: [:ea | ea organization].
(self listAtCategoryNamed: ClassOrganizer default) do: [:sel | | found |
found := (organizers collect: [ :org | org categoryOfElement: sel])
detect: [:ea | ea ~= ClassOrganizer default and: [ ea ~= nil]]
ifNone: [].
found ifNotNil: [self classify: sel under: found]].

Does anyone have any opinion on that? I really prefer that version but I wanted to check first if there is a good reason not to have this in the Organizers.


P.S.: I also just noticed a weird inconsistency in the naming scheme between categoriz