Browse Source

Merge pull request #43 from amber-smalltalk/fixes

Fixes for issues 21 and 42 isolated
Sebastian Sastre 10 years ago
parent
commit
46c31b94c9
4 changed files with 24 additions and 8 deletions
  1. 12 4
      src/Helios-Browser.js
  2. 1 0
      src/Helios-Browser.st
  3. 9 3
      src/Helios-Core.js
  4. 2 1
      src/Helios-Core.st

+ 12 - 4
src/Helios-Browser.js

@@ -349,7 +349,7 @@ var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
-var $1,$2,$4,$3,$5;
+var $1,$2,$4,$3,$5,$8,$7,$6,$9;
 $1=self._model();
 $recv($1)._focusOnSourceCode();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -362,10 +362,18 @@ $ctx1.sendIdx["methodClass"]=1;
 //>>excludeEnd("ctx");
 $3=$recv($4)._package();
 $recv($2)._selectedPackage_($3);
+$5=$1;
+$8=$recv(aCompiledMethod)._methodClass();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["methodClass"]=2;
+//>>excludeEnd("ctx");
+$7=$recv($8)._isMetaclass();
+$6=$recv($7)._not();
+$recv($5)._showInstance_($6);
 $recv($1)._selectedClass_($recv(aCompiledMethod)._methodClass());
 $recv($1)._selectedProtocol_($recv(aCompiledMethod)._protocol());
 $recv($1)._selectedMethod_(aCompiledMethod);
-$5=$recv($1)._focusOnSourceCode();
+$9=$recv($1)._focusOnSourceCode();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"openMethod:",{aCompiledMethod:aCompiledMethod},$globals.HLBrowser)});
@@ -373,10 +381,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aCompiledMethod"],
-source: "openMethod: aCompiledMethod\x0a\x09self model\x0a\x09\x09\x22Workaround for the package selection announcement when the package list is focused\x22\x09\x0a\x09\x09focusOnSourceCode;\x0a\x09\x09selectedPackage: aCompiledMethod methodClass package;\x0a\x09\x09selectedClass: aCompiledMethod methodClass;\x0a\x09\x09selectedProtocol: aCompiledMethod protocol;\x0a\x09\x09selectedMethod: aCompiledMethod;\x0a\x09\x09focusOnSourceCode",
+source: "openMethod: aCompiledMethod\x0a\x09self model\x0a\x09\x09\x22Workaround for the package selection announcement when the package list is focused\x22\x09\x0a\x09\x09focusOnSourceCode;\x0a\x09\x09selectedPackage: aCompiledMethod methodClass package;\x0a\x09\x09showInstance: aCompiledMethod methodClass isMetaclass not;\x0a\x09\x09selectedClass: aCompiledMethod methodClass;\x0a\x09\x09selectedProtocol: aCompiledMethod protocol;\x0a\x09\x09selectedMethod: aCompiledMethod;\x0a\x09\x09focusOnSourceCode",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["focusOnSourceCode", "model", "selectedPackage:", "package", "methodClass", "selectedClass:", "selectedProtocol:", "protocol", "selectedMethod:"]
+messageSends: ["focusOnSourceCode", "model", "selectedPackage:", "package", "methodClass", "showInstance:", "not", "isMetaclass", "selectedClass:", "selectedProtocol:", "protocol", "selectedMethod:"]
 }),
 $globals.HLBrowser);
 

+ 1 - 0
src/Helios-Browser.st

@@ -47,6 +47,7 @@ openMethod: aCompiledMethod
 		"Workaround for the package selection announcement when the package list is focused"	
 		focusOnSourceCode;
 		selectedPackage: aCompiledMethod methodClass package;
+		showInstance: aCompiledMethod methodClass isMetaclass not;
 		selectedClass: aCompiledMethod methodClass;
 		selectedProtocol: aCompiledMethod protocol;
 		selectedMethod: aCompiledMethod;

+ 9 - 3
src/Helios-Core.js

@@ -688,11 +688,17 @@ var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
+var $1;
 self._withChangesDo_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return $recv(self._environment())._copyClass_to_($recv(self._selectedClass())._theNonMetaClass(),aClassName);
+$1=self._environment();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["environment"]=1;
+//>>excludeEnd("ctx");
+$recv($1)._copyClass_to_($recv(self._selectedClass())._theNonMetaClass(),aClassName);
+return self._selectedClass_($recv(self._environment())._classNamed_(aClassName));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
 //>>excludeEnd("ctx");
@@ -704,10 +710,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aClassName"],
-source: "copyClassTo: aClassName\x0a\x09self withChangesDo: [ \x0a\x09\x09self environment \x0a\x09\x09\x09copyClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09to: aClassName ]",
+source: "copyClassTo: aClassName\x0a\x09self withChangesDo: [ \x0a\x09\x09self environment \x0a\x09\x09\x09copyClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09to: aClassName.\x0a\x09\x09self selectedClass: (self environment classNamed: aClassName) ]",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["withChangesDo:", "copyClass:to:", "environment", "theNonMetaClass", "selectedClass"]
+messageSends: ["withChangesDo:", "copyClass:to:", "environment", "theNonMetaClass", "selectedClass", "selectedClass:", "classNamed:"]
 }),
 $globals.HLToolModel);
 

+ 2 - 1
src/Helios-Core.st

@@ -268,7 +268,8 @@ copyClassTo: aClassName
 	self withChangesDo: [ 
 		self environment 
 			copyClass: self selectedClass theNonMetaClass
-			to: aClassName ]
+			to: aClassName.
+		self selectedClass: (self environment classNamed: aClassName) ]
 !
 
 moveClassToPackage: aPackageName