`NewSystemBrowser`: Improve support for "alien" classes / methods jv
authorJan Vrany <jan.vrany@labware.com>
Thu, 23 Mar 2023 18:50:44 +0000
branchjv
changeset 19644 4a417ccbd1ae
parent 19643 b3148ab32c03
child 19645 346f10c81090
`NewSystemBrowser`: Improve support for "alien" classes / methods ...such as RING2 models. This is far from complete, just few things here and there. Over time, code should be overhauled to use some indirection for most queries about the code...
Tools__NewSystemBrowser.st
--- a/Tools__NewSystemBrowser.st	Wed Mar 08 16:40:41 2023 +0000
+++ b/Tools__NewSystemBrowser.st	Thu Mar 23 18:50:44 2023 +0000
@@ -1,7 +1,7 @@
 "
  COPYRIGHT (c) 2000 by eXept Software AG
  COPYRIGHT (c) 2015-2018 Jan Vrany
- COPYRIGHT (c) 2020-2022 LabWare
+ COPYRIGHT (c) 2020-2023 LabWare
  COPYRIGHT (c) 2021 Patrik Svestka
               All Rights Reserved
 
@@ -85,7 +85,7 @@
 "
  COPYRIGHT (c) 2000 by eXept Software AG
  COPYRIGHT (c) 2015-2018 Jan Vrany
- COPYRIGHT (c) 2020-2022 LabWare
+ COPYRIGHT (c) 2020-2023 LabWare
  COPYRIGHT (c) 2021 Patrik Svestka
               All Rights Reserved
 
@@ -52897,7 +52897,7 @@
 
         "/ JV: Following code should be language-specific. For Smalltalk, use the old code.
         "/ For the rest, delegate to the language's toolbox (if any)
-        mthd programmingLanguage isSmalltalk ifFalse:[
+        mthd programmingLanguage ~~ SmalltalkLanguage instance ifTrue:[
             | toolbox |
 
             toolbox := mthd programmingLanguage toolbox.
@@ -53138,6 +53138,7 @@
     "Created: / 27-04-2010 / 15:05:52 / cg"
     "Modified: / 06-09-2013 / 19:37:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 25-11-2016 / 15:56:37 / cg"
+    "Modified: / 23-03-2023 / 18:27:20 / Jan Vrany <jan.vrany@labware.com>"
 !
 
 messagesMenuFor:actionSelector withSenderChain:withSenderChain withImplementorChain:withImplementorChain
@@ -56597,7 +56598,7 @@
         "/ packageLabel := 'Base: ' , (aClass package ? '?').
 
         cls := aClass theNonMetaclass.
-        packageLabel := (aClass package ? '?') allBold.
+        packageLabel := (aClass package ? '?') asString allBold.
 
         aClass isLoaded ifTrue:[
             sourceCodeManager := self sourceCodeManagerOfClass:aClass.
@@ -56632,6 +56633,7 @@
 
     "Modified: / 06-10-2011 / 09:34:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 22-11-2011 / 16:19:18 / cg"
+    "Modified: / 23-03-2023 / 17:24:11 / Jan Vrany <jan.vrany@labware.com>"
 !
 
 updatePackageInfoForMethod:aMethod
@@ -56647,7 +56649,7 @@
     mClass isNil ifTrue:[
         info := 'Unassigned'
     ] ifFalse:[
-        mpkg := aMethod package.
+        mpkg := aMethod package asSymbol.
         info := mpkg allBold.
         extensionOrNot := ''.
 
@@ -56693,6 +56695,7 @@
 
     "Modified (format): / 25-11-2011 / 14:48:14 / cg"
     "Modified: / 02-05-2014 / 17:55:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 23-03-2023 / 17:28:26 / Jan Vrany <jan.vrany@labware.com>"
 ! !
 
 !NewSystemBrowser methodsFor:'private-dialogs'!
@@ -59434,6 +59437,13 @@
         ^ 'oops - this method is not attached to any class'.
     ].
 
+   "Explainer can really only work fine with Smalltalk code loaded
+    in the image, so short-circuit here for everything else (Java, 
+    Javascript, RING2 models, ...)"
+    method programmingLanguage ~~ SmalltalkLanguage instance ifTrue: [ 
+        ^ ''.
+    ].
+
     msg := Explainer methodSpecialInfoFor:method.
     msg isNil ifTrue:[
         msg := Explainer methodInheritanceInfoFor:method.
@@ -59462,6 +59472,8 @@
     ].
 
     ^ msg.
+
+    "Modified: / 23-03-2023 / 18:47:46 / Jan Vrany <jan.vrany@labware.com>"
 !
 
 nameListEntryForALL