Skip to content

Commit

Permalink
[feenkcom/gtoolkit#4120] start with slots view in coder navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
syrel committed Oct 25, 2024
1 parent 91b7dda commit 81bec82
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/GT-PackageWithSubclasses/GtCoderDummySubclass.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Class {
#name : #GtCoderDummySubclass,
#superclass : #GtCoderDummySuperclass,
#instVars : [
'varB'
],
#category : #'GT-PackageWithSubclasses-Classes'
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Class {
#name : #GtCoderDummySuperclass,
#superclass : #Object,
#instVars : [
'varA'
],
#category : #'GT-PackageWithSuperclasses-Classes'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ GtCoderNavigationPackagesTagsClassesModelExamples >> navigateToClass_02_selectTa
{ #category : #'examples - navigate to class' }
GtCoderNavigationPackagesTagsClassesModelExamples >> navigateToClass_03_selectClass [
<gtExample>
| aModel classesToShow protocolsToShow aClassToSelect methodsToShow |
| aModel classesToShow protocolsToShow aClassToSelect methodsToShow slotsToShow |

aClassToSelect := self dummySuperclass.

Expand All @@ -200,11 +200,15 @@ GtCoderNavigationPackagesTagsClassesModelExamples >> navigateToClass_03_selectCl
self assert: aModel hasSelectedProtocol.
self assert: aModel selectedProtocol name equals: 'All'.

self assert: aModel hasSelectedSlot not.

methodsToShow := aModel methodsToShow.

self assert: (methodsToShow includes: aClassToSelect >> #unclassifiedMethod).
self assert: (methodsToShow includes: aClassToSelect >> #methodInApiProtocol).
self assert: (methodsToShow includes: aClassToSelect class >> #instanceCreationMethod).

slotsToShow := aModel slotsToShow.

^ aModel
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,23 @@ GtCoderNavigationPackagesTagsClassesModel >> showPackage: anRPackage [
^ true
]

{ #category : #'api - accessing' }
GtCoderNavigationPackagesTagsClassesModel >> slotsToShow [
<return: #Collection of: #GtPharoProtocol>
| currentClass instanceSlots classInstanceSlots classSlots |

self hasSelectedClass
ifFalse: [ ^ #() ].

currentClass := self selectedClass.

instanceSlots := currentClass instanceSide instanceVariables.
classInstanceSlots := currentClass classSide instanceVariables.
classSlots := currentClass classVariables.

^ instanceSlots, classInstanceSlots, classSlots
]

{ #category : #'api - subscriptions' }
GtCoderNavigationPackagesTagsClassesModel >> subscribeToSystem [
SystemAnnouncer uniqueInstance weak
Expand Down

0 comments on commit 81bec82

Please sign in to comment.