Hi all,
geez, I seem to have opened a can of worms with that change to the package browser. In the past, it was just a normal browser that splits up the system category into two parts. Now, I have -- yet inconsistently -- switched it to use the actual package artifacts. However, these package artifacts do not match the system categories-classes structure completely:
* A package may have system categories that do not have the package name as their prefixes. E.g., for package MyPackage, valid system categories include not only MyPackage-Core, but also MyPackage, MyPackageTests, and OurPackage. * A package may have extension methods that belong to extension classes that are not defined by the package itself.
So the question is, how should the package browser deal with these artifacts?
* Should it rather mimic the MCSnapshotBrowser as much as possible, including a display for extension methods? * Or should it stick with the idea of a traditional browser, do not display extension methods, and * just show matching system categories? * or also show the system categories for all other classes contained in the package? * Or should we better revert the recent change and stick with a "package browser" that is actually a "hierarchical system category browser"? * Or yet something else?
If it helps, we can also add a "browse package snapshot" item to the package menu of browsers (similar to what Squit's commit dialog's #browseOriginalEdition: offers). This would bring up what I think Tobias was asking for:
(MCSnapshotBrowser forSnapshot: Morph packageInfo mcPackage snapshot) showLabelled: 'Snapshot of package'.
[cid:75ccafeb-262b-4858-abe3-bf42ac4b5b4a]
So, looking forward to your opinions and arguments!
Best, Christoph
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Tobias Pape Das.Linux@gmx.de Gesendet: Montag, 12. September 2022 23:24 Uhr An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] The Trunk: Tools-ct.1173.mcz
On 12. Sep 2022, at 22:14, Thiede, Christoph Christoph.Thiede@student.hpi.uni-potsdam.de wrote:
Hi Tobias, Hi Karl,
I noticed a few packages are empty: Etoys, MonticelloForTraits, MonticelloMocks, ST80Tools, SUnitsTools, WebClient-HTTP, XML-Explorer
Yeah, these only carry extension methods…
Yes. EToys is interesting, though, as it reveals that PackagePaneBrowser>>#systemCategoryList still uses an insufficient substring mechanism. I will revise that in the next few days. Sorry for the inconvenience.
…which you can _currently_ only find out via the monticello browser. :(
There is "browse extensions" in the browsers' class list/package menu. :-)
Which is _different_ from the way the monticello browser displays it…
:D
<pastedImage.png>
Best, Christoph Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Tobias Pape Das.Linux@gmx.de Gesendet: Montag, 12. September 2022 21:58:27 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] The Trunk: Tools-ct.1173.mcz
Hi
On 12. Sep 2022, at 21:41, karl ramberg karlramberg@gmail.com wrote:
I noticed a few packages are empty: Etoys, MonticelloForTraits, MonticelloMocks, ST80Tools, SUnitsTools, WebClient-HTTP, XML-Explorer
Yeah, these only carry extension methods…
…which you can _currently_ only find out via the monticello browser. :(
Best regards -Tobias
Best, Karl
On Mon, Sep 12, 2022 at 7:12 PM commits@source.squeak.org wrote: Christoph Thiede uploaded a new version of Tools to project The Trunk: http://source.squeak.org/trunk/Tools-ct.1173.mcz
==================== Summary ====================
Name: Tools-ct.1173 Author: ct Time: 8 September 2022, 3:05:12.665836 pm UUID: f0fe2b64-b27c-6d4b-9670-d920d0580baf Ancestors: Tools-ct.1171
Fixes package pane browser to actually use the package organizer instead of parsing the system category list. Resolves https://github.com/squeak-smalltalk/squeak-object-memory/issues/28.
=============== Diff against Tools-ct.1171 ===============
Item was changed: Browser subclass: #PackagePaneBrowser
instanceVariableNames: 'packageOrganizer package packageListIndex packageList'
instanceVariableNames: 'package packageListIndex packageList' classVariableNames: '' poolDictionaries: '' category: 'Tools-Browser'!
- !PackagePaneBrowser commentStamp: 'ct 9/8/2022 15:05' prior: 0!
- A package browser represents a hierarchical query path through an organization of class and method information. It nests classes into a two-level hierarchy that consists of the package (e.g., Kernel, FFI-Kernel) and the system category (e.g., Exception, Exceptions-Kernel; Support, empty).
!PackagePaneBrowser commentStamp: '<historical>' prior: 0!
A package browser represents a hierarchical query path through an organization of class and method information. It parses class categories into a two-level hierarchy on the first '-' character, giving "packages" (e.g., Magnitude, Collections, Graphics, etc.), and "categories" (e.g., Magnitude-General and Magnitude-Number).
Instance Variables:
packageOrganizer <PackageOrganizer> the organizer of packages in the current environment package <Symbol> the "category header," e.g., #Magnitudes or #Collections packageListIndex <Integer> The index in the package list
packageList <OrderedCollection of String> the list of package names!
packageList <OrderedCollection of String> the list of package names
- !
Item was added:
- ----- Method: PackagePaneBrowser>>initialize (in category 'initialize-release') -----
- initialize
super initialize.
self packageOrganizer: self environment packageOrganizer.!
Item was changed: ----- Method: PackagePaneBrowser>>packageList (in category 'package list') ----- packageList
"Answer a list of the packages in the current system organization."
^ self packageOrganizer packageNames sorted!
| str stream |
str := Set new: 100.
stream := WriteStream on: (Array new: 100).
systemOrganizer categories do:
[ :categ | | cats |
cats := categ asString copyUpTo: $-.
(str includes: cats) ifFalse:
[str add: cats.
stream nextPut: cats]].
^stream contents!
Item was added:
- ----- Method: PackagePaneBrowser>>packageOrganizer (in category 'accessing') -----
- packageOrganizer
^ packageOrganizer!
Item was added:
- ----- Method: PackagePaneBrowser>>packageOrganizer: (in category 'initialize-release') -----
- packageOrganizer: aPackageOrganizer
packageOrganizer := aPackageOrganizer.
self systemOrganizer: self systemOrganizer. "reset selections"!
Item was added:
- ----- Method: PackagePaneBrowser>>selectEnvironment: (in category 'accessing') -----
- selectEnvironment: anEnvironment
super selectEnvironment: anEnvironment.
self packageOrganizer: anEnvironment packages.!
<pastedImage.png>