[Cuis-dev] Protocol Browser on the class side

Szabolcs Komáromi cuis at mnqpr.com
Fri Aug 4 05:46:44 PDT 2023


Hi,

The Protocol Browser doesn't work on metaclasses and from the selectedClassOrMetaClass' comment ("I ignore metaClass, so..") looks like this is the intended behavior. Is there any particular reason not to support this scenario?

Adding a test to the ProtoclolBrowser's selectedClass method to check whether the looked up class is a metaclass ("baseClass isMeta") seemingly works.
> *selectedClass*
> "Answer the class that is currently selected. 
> Answer base if no selection exists."
> | className class |
> className := self selectiveClassListIndex = 0
> ifTrue: [ self selectiveClassList last ]
> ifFalse: [ self selectiveClassList at: self selectiveClassListIndex ].
> class := Smalltalk at: (className findTokens: ' ') first asSymbol.
> baseClass isMeta
> ifTrue: [ ^ class class ]
> ifFalse: [ ^ class ]. 

Regards,
Szabolcs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230804/5f0d4d1d/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 142691 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230804/5f0d4d1d/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5968-ProtocolBrowserOnClassSide-SzabolcsKomaromi-2023Aug04-12h09m-mnqpr.001.cs.st
Type: application/vnd.sailingtracker.track
Size: 575 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230804/5f0d4d1d/attachment-0001.bin>


More information about the Cuis-dev mailing list