[squeak-dev] Review Request: packageSelfExtensions.1.cs

christoph.thiede at student.hpi.uni-potsdam.de christoph.thiede at student.hpi.uni-potsdam.de
Fri Mar 25 15:05:49 UTC 2022


=============== Summary ===============

Change Set:        packageSelfExtensions
Date:            25 March 2022
Author:            Christoph Thiede

Revises the notion of extension method so that also extensions to the same package are found. For instance, browsing all extensions of the package 'Etoys' local to the category 'Etoys-Squeakland-MorphicExtras-Charts' will now also bring up the extensions on Player.

Fixes #extensionCategoriesForClass:localTo: to also find different casings of the package name in the extension category. Also revises #methodCategoryPrefix to no longer destroy the original casing of the package name.

Note that with this change, #extensionMethods and #coreMethods are no longer necessarily disjunct.

=============== Diff ===============

PackageInfo>>allBehaviors {private} · ct 3/25/2022 15:40
+ allBehaviors
+ 
+     ^ self systemNavigation allBehaviors contents

PackageInfo>>extensionCategoriesForClass:localTo: {testing} · ct 3/25/2022 15:55 (changed)
extensionCategoriesForClass: aClass localTo: aClassCategory

    ^ (self extensionCategoriesForClass: aClass)
-         select: [:ea | ea beginsWith: '*', aClassCategory]
+         select: [:ea | self category: ea matches: '*' , aClassCategory]

PackageInfo>>extensionClasses {listing} · ct 3/25/2022 15:38 (changed)
extensionClasses
-     ^ self externalBehaviors reject: [:classOrTrait | (self extensionCategoriesForClass: classOrTrait) isEmpty]
+     ^ self allBehaviors reject: [:classOrTrait | (self extensionCategoriesForClass: classOrTrait) isEmpty]

PackageInfo>>extensionClassesLocalTo: {listing} · ct 3/25/2022 15:38 (changed)
extensionClassesLocalTo: classCategory

-     ^ self externalBehaviors reject: [:classOrTrait |
+     ^ self allBehaviors reject: [:classOrTrait |
        (self extensionCategoriesForClass: classOrTrait localTo: classCategory) isEmpty]

PackageInfo>>extensionMethods {listing} · ct 3/25/2022 15:36 (changed)
extensionMethods
-     ^ self externalBehaviors gather: [:classOrTrait | self extensionMethodsForClass: classOrTrait]
+     ^ self allBehaviors gather: [:classOrTrait | self extensionMethodsForClass: classOrTrait]

PackageInfo>>extensionMethodsLocalTo: {listing} · ct 3/25/2022 15:37 (changed)
extensionMethodsLocalTo: aClassCategory

-     ^ self externalBehaviors gather: [:classOrTrait |
+     ^ self allBehaviors gather: [:classOrTrait |
        self extensionMethodsForClass: classOrTrait localTo: aClassCategory]

PackageInfo>>methodCategoryPrefix {naming} · ct 3/25/2022 15:53 (changed)
methodCategoryPrefix
-     ^ methodCategoryPrefix ifNil: [methodCategoryPrefix := '*', self packageName asLowercase]
+     ^ methodCategoryPrefix ifNil: [methodCategoryPrefix := '*', self packageName]

PackageInfo>>methods {listing} · ct 3/25/2022 16:00 (changed)
methods
-     ^ (self extensionMethods, self coreMethods) select: [:method |
+     ^ (self extensionMethods, self coreMethods) withoutDuplicates select: [:method |
        method isValid
            and: [method isLocalSelector]]

["packageSelfExtensions.1.cs"]

---
Sent from Squeak Inbox Talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220325/94fa8d96/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: packageSelfExtensions.1.cs
Type: application/octet-stream
Size: 2345 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220325/94fa8d96/attachment.obj>


More information about the Squeak-dev mailing list