InspectorView.st
branchjv
changeset 16760 6ce6b708f34d
parent 16714 b68566960d22
parent 16758 a5c09d35f59a
child 16805 d9fc8a187ec2
--- a/InspectorView.st	Wed Jul 27 07:06:54 2016 +0200
+++ b/InspectorView.st	Thu Jul 28 06:49:35 2016 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
               All Rights Reserved
@@ -233,7 +235,7 @@
 
     |lbl id|
 
-    (anObject isImmediate or:[anObject isBoolean]) ifTrue:[
+    (anObject isLazyValue not and:[anObject isImmediate or:[anObject isBoolean]]) ifTrue:[
         ^ self labelNameFor:anObject.
     ].
     lbl := '<%1> %2'.
@@ -269,6 +271,10 @@
 
     |s|
 
+    anObject isLazyValue ifTrue:[
+        ^ anObject displayString.
+    ].
+
     anObject isClass ifTrue:[
         s := anObject displayString
     ] ifFalse:[
@@ -1167,7 +1173,7 @@
 iconForValue: anObject
     |value|
 
-    anObject isNil ifTrue:[
+    anObject == nil ifTrue:[    "isNil is not defined in Lazy et al."
         ^ self imageFor_nil
     ].
     anObject == true ifTrue:[
@@ -2877,7 +2883,8 @@
             "/ displayStringMessage := #printString
 
             someValue isLazyValue ifTrue:[
-                ^ someValue class nameWithArticle    
+                "Lazy values redefine #displayOn: to stay layzy"
+                displayStringMessage := #displayString
             ].
 
             s := CharacterWriteStream on:(String new:10).
@@ -2918,7 +2925,9 @@
         sel := self listEntryAt:idx.
         sel isNil ifTrue:[^ someValue].
 
-        extraAttributes := object inspectorExtraAttributes.
+        object isLazyValue ifFalse:[
+            extraAttributes := object inspectorExtraAttributes.
+        ].
         (extraAttributes notNil and:[extraAttributes includesKey:sel]) ifTrue:[
             ^ someValue "(extraAttributes at:sel) value" printString
         ].
@@ -2961,7 +2970,7 @@
     Error handle:[:ex |
         ^ nameString
     ] do:[
-        entryString := nameString allBold,(self valueStringInListEntryForValue:value).
+        entryString := nameString allBold, (self valueStringInListEntryForValue:value).
         (value isLazyValue not and:[value isColor and:[value red notNil]]) ifTrue:[
             entryString := entryString
                          , '  ' , ('   '
@@ -2983,6 +2992,10 @@
 
     "/ UserPreferences current showTypeIndicatorInInspector ifFalse:[^ nil].
 
+    value isLazyValue ifTrue:[
+        "do not block on not yet finished Futures et al"
+        ^ '>>Lazy value<<'
+    ].
     value class == ValueHolder ifTrue:[
         "/ just in case...
         thisContext isRecursive ifTrue:[^ value inspectorValueStringInListFor:self].
@@ -2993,10 +3006,6 @@
         ].
         ^ nil
     ].
-    value isLazyValue ifTrue:[
-        "do not block on not yet finished Futures et al"
-        ^ '>>Lazy value<<'
-    ].
     (value isNumber or:[value isBoolean]) ifTrue:[
         ^ self basicDisplayStringForValue:value "value printString"
     ].
@@ -3321,31 +3330,33 @@
 
     |derivedFieldList namedFieldList fieldList cls indexedList extraNamedFieldList|
 
-    object isNil ifTrue:[
+    (object isNil" or:[object isLazyValue]") ifTrue:[
         ^ self hasSelfEntry ifFalse:[ #() ] ifTrue:[ #('-self') ]
     ].
 
-    cls := object class.
-
-    self topView withWaitCursorDo:[
-        namedFieldList := self namedFieldList.
-        indexedList := self indexedFieldList.
-        extraNamedFieldList := OrderedCollection new.
-
-        self hasSelfEntry ifTrue:[
-            self suppressPseudoSlots ifFalse:[
-                derivedFieldList := OrderedCollection new.
-                derivedFieldList addAll:(self pseudoFieldNamesWithIndexed:(indexedList notEmptyOrNil)).
-                derivedFieldList addAll:(self derivedFieldNames).
-                extraNamedFieldList addAll:(self extraNamedFieldNames).
+    IsDebuggingQuery answer:true do:[
+        cls := object class.
+
+        self topView withWaitCursorDo:[
+            namedFieldList := self namedFieldList.
+            indexedList := self indexedFieldList.
+            extraNamedFieldList := OrderedCollection new.
+
+            self hasSelfEntry ifTrue:[
+                self suppressPseudoSlots ifFalse:[
+                    derivedFieldList := OrderedCollection new.
+                    derivedFieldList addAll:(self pseudoFieldNamesWithIndexed:(indexedList notEmptyOrNil)).
+                    derivedFieldList addAll:(self derivedFieldNames).
+                    extraNamedFieldList addAll:(self extraNamedFieldNames).
+                ].
             ].
+
+            fieldList := OrderedCollection new.
+            derivedFieldList notNil ifTrue:[fieldList addAll:derivedFieldList].
+            namedFieldList notNil ifTrue:[fieldList addAll:namedFieldList].
+            extraNamedFieldList notNil ifTrue:[fieldList addAll:extraNamedFieldList].
+            indexedList notNil ifTrue:[fieldList addAll:indexedList].
         ].
-
-        fieldList := OrderedCollection new.
-        derivedFieldList notNil ifTrue:[fieldList addAll:derivedFieldList].
-        namedFieldList notNil ifTrue:[fieldList addAll:namedFieldList].
-        extraNamedFieldList notNil ifTrue:[fieldList addAll:extraNamedFieldList].
-        indexedList notNil ifTrue:[fieldList addAll:indexedList].
     ].
     ^ fieldList
 
@@ -3614,12 +3625,9 @@
                 keysAndValuesCollect:[:idx :nm |
                     |val|
 
-                    IsDebuggingQuery answer:true do:[
-                        val := object instVarAt:idx+offset
-                    ].        
+                    val := object instVarAt:idx+offset.
                     self listEntryForName:nm value:val
                 ].
-                
     sortOrder == SortOrderAlphabetical ifTrue:[
         aList sort:[:a :b | a string < b string].
     ].
@@ -3964,7 +3972,7 @@
 
     myClass := self class.
     (myClass == InspectorView
-    and:[anObject inspectorClass ~~ InspectorView]) ifTrue:[
+     and:[anObject isLazyValue not and:[anObject inspectorClass ~~ InspectorView]]) ifTrue:[
         lbl := 'BasicInspector on: '
     ] ifFalse:[
         lbl := 'Inspector on: '
@@ -4210,7 +4218,7 @@
 !
 
 tryToSelectKeyNamed:aString
-    "called from the debugger to try to select the previousöy selected
+    "called from the debugger to try to select the previousöy selected
      field (by name)"
      
     |list idx aStringWithSpace|