Marcel Taeumel uploaded a new version of Tools to project The Trunk: http://source.squeak.org/trunk/Tools-mt.1201.mcz
==================== Summary ====================
Name: Tools-mt.1201 Author: mt Time: 12 May 2023, 9:32:33.304412 am UUID: 1d78afe7-8c20-4e4d-b091-3807faf620a4 Ancestors: Tools-mt.1200
In TreeBrowser, add message category "-- core --" to all classes that have extensions to be able to filter/browse through not-extension methods.
The name 'core' stems from #coreMethods in PackageInfo.
=============== Diff against Tools-mt.1200 ===============
Item was added: + ----- Method: TreeBrowser class>>coreCategory (in category 'defaults') ----- + coreCategory + "The name 'core' stems from #coreMethods in PackageInfo." + + ^ #'-- core --'!
Item was changed: ----- Method: TreeBrowser>>messageCategoryChildren: (in category 'message category tree') ----- messageCategoryChildren: category
| all | category = ClassOrganizer allCategory ifTrue: [^ #()]. + category = self class coreCategory ifTrue: [^ #()]. all := (category = self class extensionCategory or: [category notEmpty and: [category first == $*]]) ifTrue: [lastMessageCategoryList select: [:cat | cat first == $*]] ifFalse: [lastMessageCategoryList reject: [:cat | cat first == $*]].
^ self for: (category = self class extensionCategory ifTrue: [''] ifFalse: [category]) from: all select: [:prefix :cat | self hasMessageCategory: cat prefix: prefix] thenCollect: [:cat :start | self findTrimmedPrefix: cat startingAt: start]!
Item was changed: ----- Method: TreeBrowser>>messageCategoryHasChildren: (in category 'message category tree') ----- messageCategoryHasChildren: category
| predicate | category == ClassOrganizer allCategory ifTrue: [^ false]. + category = self class coreCategory ifTrue: [^ false]. predicate := category == self class extensionCategory ifTrue: [ [:cat | cat first == $*] ] ifFalse: [ [:cat | self hasMessageCategory: cat prefix: category] ]. ^ lastMessageCategoryList anySatisfy: [:cat | predicate value: cat]!
Item was changed: ----- Method: TreeBrowser>>messageCategoryLabel: (in category 'message category tree') ----- messageCategoryLabel: category
| label | category = ClassOrganizer allCategory ifTrue: [^ category]. category = self class extensionCategory ifTrue: [^ category]. + category = self class coreCategory ifTrue: [^ category]. label := self findTrimmedSuffix: category. (self classOrMetaClassOrganizer categories includes: category) ifFalse: [ label := '(', label, ')']. ^ label!
Item was changed: ----- Method: TreeBrowser>>messageCategoryPath (in category 'message category tree') ----- messageCategoryPath "Answer the path represented by the category. Ensure to fill the cache."
self hasClassSelected ifFalse: [^ #()]. self hasMessageCategorySelected ifFalse: [^ #()].
selectedMessageCategoryName = ClassOrganizer allCategory ifTrue: [^ {selectedMessageCategoryName}]. selectedMessageCategoryName = self class extensionCategory ifTrue: [^ {selectedMessageCategoryName}]. + selectedMessageCategoryName = self class coreCategory ifTrue: [^ {selectedMessageCategoryName}].
^ Array streamContents: [:s | | parent | selectedMessageCategoryName first == $* "Is extension category?" ifTrue: [s nextPut: (parent := self class extensionCategory)] ifFalse: [parent := '']. [parent notNil] whileTrue: [ (self messageCategoryChildren: parent) detect: [:ea | selectedMessageCategoryName beginsWith: ea] ifFound: [:ea | s nextPut: (parent := ea)] ifNone: [parent := nil]]]!
Item was changed: ----- Method: TreeBrowser>>messageCategoryRoots (in category 'message category tree') ----- messageCategoryRoots
| hasExtensions hasAny roots | self hasClassSelected ifFalse: [^ Array new]. hasAny := self classOrMetaClassOrganizer isEmpty not. hasExtensions := self classOrMetaClassOrganizer categories anySatisfy: [:cat | cat first == $*].
roots := OrderedCollection new. hasAny ifTrue: [roots add: ClassOrganizer allCategory]. + hasExtensions ifTrue: [ + roots add: self class coreCategory. + roots add: self class extensionCategory]. - hasExtensions ifTrue: [roots add: self class extensionCategory].
roots addAll: (self messageCategoryChildren: ''). ^ roots!
Item was changed: ----- Method: TreeBrowser>>messageList (in category 'message list') ----- messageList "Overwritten to show all extensions when the '-- extensions --' category is selected." + self selectedMessageCategoryName = self class coreCategory + ifTrue: [ + ^ Array streamContents: [:coreSelectors | + self classOrMetaClassOrganizer categories + reject: [:cat | cat first == $*] + thenDo: [:extCat | (self classOrMetaClassOrganizer listAtCategoryNamed: extCat) + do: [:extSel | coreSelectors nextPut: (self formattedLabel: extSel)]]]]. + ^ self selectedMessageCategoryName = self class extensionCategory ifFalse: [super messageList] ifTrue: [ Array streamContents: [:extensionSelectors | self classOrMetaClassOrganizer categories select: [:cat | cat first == $*] thenDo: [:extCat | (self classOrMetaClassOrganizer listAtCategoryNamed: extCat) do: [:extSel | extensionSelectors nextPut: (self formattedLabel: extSel)]]]]!
Hi Marcel,
are the messages in the "-- core --" category deliberately not sorted by their selector but by their category? :-)
Best, Christoph
Hi Marcel,
could we maybe display '-- core --' as a nested item below '-- all --' and keep '-- all --' collapsed by default? While I like that category, I think most people will use it rather rarely, and it currently consumes extra space. Currently, we can have four items for a class with a single message. :-)
[cid:ff305513-3171-45f2-b58a-d5b3380cf255]
Best,
Christoph
________________________________ Von: Thiede, Christoph Gesendet: Freitag, 12. Mai 2023 17:53:03 An: squeak-dev@lists.squeakfoundation.org Betreff: [squeak-dev] Re: The Trunk: Tools-mt.1201.mcz
Hi Marcel,
are the messages in the "-- core --" category deliberately not sorted by their selector but by their category? :-)
Best, Christoph
Hi Christoph --
Currently, we can have four items for a class with a single message. :-)
Hmm... How often can this happen in a typical system?
Best, Marcel Am 14.05.2023 20:10:33 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de: Hi Marcel,
could we maybe display '-- core --' as a nested item below '-- all --' and keep '-- all --' collapsed by default? While I like that category, I think most people will use it rather rarely, and it currently consumes extra space. Currently, we can have four items for a class with a single message. :-)
Best, Christoph Von: Thiede, Christoph Gesendet: Freitag, 12. Mai 2023 17:53:03 An: squeak-dev@lists.squeakfoundation.org Betreff: [squeak-dev] Re: The Trunk: Tools-mt.1201.mcz Hi Marcel,
are the messages in the "-- core --" category deliberately not sorted by their selector but by their category? :-)
Best, Christoph
Hi Marcel,
Currently, we can have four items for a class with a single message. :-)
Hmm... How often can this happen in a typical system?
Let's take a look: :-)
ClassListBrowser browseClassesSatisfying: [:c | c selectors size = 1 and: [(c whichCategoryIncludesSelector: c selectors anyOne) beginsWith: '*']] title: 'classes with single extension method'
This yields two classes in the trunk. So, this is not extremely likely but was rather meant as an extreme example. My main point is that these additional groups help users at scale but might distract a little bit for smaller classes. Maybe my confusion stems from the asymmetric Venn diagram of these helper categories (all includes everything, core and ext are disjoint subsets of all, and all categories below are disjoint subsets of core). I don't know ...
Also, if there are no core methods, should we hide the '-- core --' category?
Best, Christoph
________________________________ Von: Marcel Taeumel via Squeak-dev squeak-dev@lists.squeakfoundation.org Gesendet: Montag, 15. Mai 2023 11:04:14 An: Rein, Patrick via Squeak-dev Cc: Taeumel, Marcel Betreff: [squeak-dev] Re: The Trunk: Tools-mt.1201.mcz
Hi Christoph --
Currently, we can have four items for a class with a single message. :-)
Hmm... How often can this happen in a typical system?
Best, Marcel
Am 14.05.2023 20:10:33 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de:
Hi Marcel,
could we maybe display '-- core --' as a nested item below '-- all --' and keep '-- all --' collapsed by default? While I like that category, I think most people will use it rather rarely, and it currently consumes extra space. Currently, we can have four items for a class with a single message. :-)
[cid:ff305513-3171-45f2-b58a-d5b3380cf255]
Best,
Christoph
________________________________ Von: Thiede, Christoph Gesendet: Freitag, 12. Mai 2023 17:53:03 An: squeak-dev@lists.squeakfoundation.org Betreff: [squeak-dev] Re: The Trunk: Tools-mt.1201.mcz
Hi Marcel,
are the messages in the "-- core --" category deliberately not sorted by their selector but by their category? :-)
Best, Christoph
Also, if there are no core methods, should we hide the '-- core --' category?
A class that only has extension methods? What's that?
Best, Marcel Am 15.05.2023 14:13:15 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de: Hi Marcel,
> Currently, we can have four items for a class with a single message. :-) Hmm... How often can this happen in a typical system?
Let's take a look: :-)
ClassListBrowser browseClassesSatisfying: [:c | c selectors size = 1 and: [(c whichCategoryIncludesSelector: c selectors anyOne) beginsWith: '*']] title: 'classes with single extension method'
This yields two classes in the trunk. So, this is not extremely likely but was rather meant as an extreme example. My main point is that these additional groups help users at scale but might distract a little bit for smaller classes. Maybe my confusion stems from the asymmetric Venn diagram of these helper categories (all includes everything, core and ext are disjoint subsets of all, and all categories below are disjoint subsets of core). I don't know ...
Also, if there are no core methods, should we hide the '-- core --' category?
Best, Christoph Von: Marcel Taeumel via Squeak-dev squeak-dev@lists.squeakfoundation.org Gesendet: Montag, 15. Mai 2023 11:04:14 An: Rein, Patrick via Squeak-dev Cc: Taeumel, Marcel Betreff: [squeak-dev] Re: The Trunk: Tools-mt.1201.mcz Hi Christoph --
Currently, we can have four items for a class with a single message. :-)
Hmm... How often can this happen in a typical system?
Best, Marcel Am 14.05.2023 20:10:33 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de: Hi Marcel,
could we maybe display '-- core --' as a nested item below '-- all --' and keep '-- all --' collapsed by default? While I like that category, I think most people will use it rather rarely, and it currently consumes extra space. Currently, we can have four items for a class with a single message. :-)
Best, Christoph Von: Thiede, Christoph Gesendet: Freitag, 12. Mai 2023 17:53:03 An: squeak-dev@lists.squeakfoundation.org Betreff: [squeak-dev] Re: The Trunk: Tools-mt.1201.mcz Hi Marcel,
are the messages in the "-- core --" category deliberately not sorted by their selector but by their category? :-)
Best, Christoph
squeak-dev@lists.squeakfoundation.org