Skip to content

Commit

Permalink
Merge 438ba4f
Browse files Browse the repository at this point in the history
  • Loading branch information
JurajKubelka committed Oct 21, 2024
2 parents fdabec6 + 438ba4f commit c36ca3f
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Extension { #name : #GtCoderDummySuperclass }

{ #category : #'*GT-PackageWithExtensions' }
GtCoderDummySuperclass class >> classSideExtension [
]

{ #category : #'*GT-PackageWithExtensions' }
GtCoderDummySuperclass >> instanceSideExtension [
]
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,71 @@ GtCoderNavigationPackagesTagsClassesModelExamples >> navigateToClass_03_selectCl
^ aModel
]

{ #category : #'examples - navigate to extensions' }
GtCoderNavigationPackagesTagsClassesModelExamples >> navigateToPackageWithExtensions_01_selectPackage [
<gtExample>
| aModel classesToShow |

aModel := self defaultModel.
aModel selectPackage: self packageWithExtensions.

self assert: aModel hasSelectedPackage.
self assert: aModel selectedPackage equals: self packageWithExtensions.

self assert: aModel hasSelectedTag not.
self assert: aModel hasSelectedClass not.

classesToShow := aModel classesToShow.
self assert: (classesToShow includes: self dummySuperclass).
self assert: (classesToShow includes: self dummySuperclass class) not.

self assertNoProtocolsNoSlotsNoMethods: aModel.

^ aModel
]

{ #category : #'examples - navigate to extensions' }
GtCoderNavigationPackagesTagsClassesModelExamples >> navigateToPackageWithExtensions_02_selectTag [
<gtExample>
| aModel aTag classesToShow |

aModel := self navigateToPackageWithExtensions_01_selectPackage.

aTag := GtCoderPackageExtensionTag forPackage: self packageWithExtensions.

aModel selectPackageTag: aTag.

self assert: aModel hasSelectedPackage.
self assert: aModel selectedPackage equals: self packageWithExtensions.
self assert: aModel hasSelectedTag.
self assert: aModel selectedTag equals: aTag.

self assert: aModel hasSelectedClass not.

classesToShow := aModel classesToShow.
self assert: (classesToShow includes: self dummySuperclass).
self assert: (classesToShow includes: self dummySuperclass class) not.

self assertNoProtocolsNoSlotsNoMethods: aModel.

^ aModel
]

{ #category : #utilities }
GtCoderNavigationPackagesTagsClassesModelExamples >> packageNameWithExtensions [
^ 'GT-PackageWithExtensions'
]

{ #category : #utilities }
GtCoderNavigationPackagesTagsClassesModelExamples >> packageNameWithSuperclasses [
^ 'GT-PackageWithSuperclasses'
]

{ #category : #utilities }
GtCoderNavigationPackagesTagsClassesModelExamples >> packageWithExtensions [
^ self packageNameWithExtensions asPackage
]

{ #category : #utilities }
GtCoderNavigationPackagesTagsClassesModelExamples >> packageWithSuperclasses [
^ self packageNameWithSuperclasses asPackage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ GtCoderNavigationPackagesTagsClassesModel >> classesToShow [
ifFalse: [ ^ #() ].

^ self hasSelectedTag
ifTrue: [ self selectedTag classes ]
ifFalse: [ self selectedPackage definedClasses ]
ifTrue: [ self privateClassesInPackageTag: self selectedTag ]
ifFalse: [ self privateClassesInPackage: self selectedPackage ]
]

{ #category : #'private - accessing' }
Expand Down Expand Up @@ -499,6 +499,26 @@ GtCoderNavigationPackagesTagsClassesModel >> packagesToShow [
^ RPackageOrganizer default gtSortedPackages
]

{ #category : #'private - accessing' }
GtCoderNavigationPackagesTagsClassesModel >> privateClassesInPackage: aPackage [
| allClasses |
allClasses := aPackage definedClasses asSet.
aPackage extendedClasses do: [ :eachClass |
allClasses add: eachClass instanceSide ].
^ allClasses asArray
]

{ #category : #'private - accessing' }
GtCoderNavigationPackagesTagsClassesModel >> privateClassesInPackageTag: aPackageTag [
aPackageTag = (GtCoderPackageExtensionTag forPackage: aPackageTag package)
ifTrue: [
^ (aPackageTag package extendedClasses
collect: [ :eachClass | eachClass instanceSide ])
copyWithoutDuplicates ].

^ aPackageTag classes
]

{ #category : #'private - selection' }
GtCoderNavigationPackagesTagsClassesModel >> privateJustDeselectClass [
"Just deselect any currently selected class and notify about the changes/
Expand Down

0 comments on commit c36ca3f

Please sign in to comment.