#DOCUMENTATION by exept
authorClaus Gittinger <cg@exept.de>
Tue, 27 Aug 2019 11:14:19 +0200
changeset 6687 0cccc4bffe67
parent 6686 0e2f231411ff
child 6688 e2c2e797ab21
#DOCUMENTATION by exept class: Workspace comment/format in: #editedLanguage #executeDoIt: #printIt changed: #browseImplementorsOf:
Workspace.st
--- a/Workspace.st	Tue Aug 27 00:00:43 2019 +0200
+++ b/Workspace.st	Tue Aug 27 11:14:19 2019 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -651,7 +653,7 @@
     editedLanguage notNil ifTrue:[
         ^ editedLanguage
     ].
-    (mthd := self editedMethod )notNil ifTrue:[
+    (mthd := self editedMethod) notNil ifTrue:[
         ^ mthd programmingLanguage.
     ].
     (cls := self editedClass) notNil ifTrue:[
@@ -1506,10 +1508,9 @@
     [
         compiler := (self compilerClass ? Compiler) new.
         result := compiler
-                    currentNameSpace:namespaceForDoits;
-                    moreSharedPools:poolsConsideredInDoIts;
-                    evaluate:theCode in:nil
-                    receiver:simulatedSelf
+                    currentNameSpace:namespaceForDoits; moreSharedPools:poolsConsideredInDoIts;
+
+                    evaluate:theCode in:nil receiver:simulatedSelf
                     notifying:self logged:true
                     ifFail:nil
     ] on:(Parser undefinedVariableNotification) do:[:ex|
@@ -1685,15 +1686,15 @@
      or - if I support syntax elements, on the syntax element at the cursor position"
 
     |methodName selector browserClass na browser 
-     cls node dwim targetClass targetImplClass| 
+     cls node dwim targetClass targetImplClass lang| 
 
     methodName := methodNameArg.
 
     self windowGroup withWaitCursorDo:[
         "/ hack, for now and expecco; must ask the Parser eventually...
         ((compilerClass notNil and:[compilerClass includesBehavior:JavaScriptParser])
-        or:[ self editedLanguage notNil 
-             and:[ self editedLanguage isSTXJavaScript]]) ifTrue:[
+          or:[ (lang := self editedLanguage) notNil and:[ lang isSTXJavaScript]]
+        ) ifTrue:[
             "/ selector is in one piece anyway
             (methodName includes:$_) ifFalse:[
                 "/ zero or one args - sigh (need to parse more to figure this out)
@@ -1790,7 +1791,7 @@
 
     "/ check for expr >> selector...
     "/ i.e. given a whoString
-    idx := codeToEvaluate indexOf:'»'.
+    idx := codeToEvaluate indexOf:'»'.
     idx ~~ 0 ifTrue:[
         possibleSelectorString := codeToEvaluate copyFrom:idx+1.
         codeToEvaluate := codeToEvaluate copyTo:idx-1.
@@ -2430,8 +2431,9 @@
 !
 
 printIt
-    "user selected 'printIt' from menu; use doIt to evaluate the code
-     and insert result of evaluation into my text.
+    "user selected 'printIt' from menu; 
+     use doIt to evaluate the code
+     and insert the result of evaluation into my text.
      If the text is readOnly, do nothing."
 
     self isReadOnly ifTrue:[