Преглед изворни кода

Merge pull request #1140 from amber-smalltalk/feature/1132-heliosClass-classTag

removes heliosClass and adds classTag with a better comment
Herbert Vojčík пре 9 година
родитељ
комит
f1a056dccc

+ 2 - 0
API-CHANGES.txt

@@ -1,5 +1,7 @@
 0.14.3:
 
+* #heliosClass is now #classTag
+
 + Compiler >>
   + eval:forPackage:
 + Behavior >>

+ 3 - 3
src/Kernel-Announcements.js

@@ -656,8 +656,8 @@ $globals.SystemAnnouncement.comment="I am the superclass of all system announcem
 
 $core.addMethod(
 $core.method({
-selector: "heliosClass",
-protocol: 'helios',
+selector: "classTag",
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return "announcement";
@@ -665,7 +665,7 @@ return "announcement";
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "heliosClass\x0a\x09^ 'announcement'",
+source: "classTag\x0a\x09\x22Returns a tag or general category for this class.\x0a\x09Typically used to help tools do some reflection.\x0a\x09Helios, for example, uses this to decide what icon the class should display.\x22\x0a\x09\x0a\x09^ 'announcement'",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []

+ 6 - 2
src/Kernel-Announcements.st

@@ -189,9 +189,13 @@ Object subclass: #SystemAnnouncement
 !SystemAnnouncement commentStamp!
 I am the superclass of all system announcements!
 
-!SystemAnnouncement class methodsFor: 'helios'!
+!SystemAnnouncement class methodsFor: 'accessing'!
 
-heliosClass
+classTag
+	"Returns a tag or general category for this class.
+	Typically used to help tools do some reflection.
+	Helios, for example, uses this to decide what icon the class should display."
+	
 	^ 'announcement'
 ! !
 

+ 18 - 18
src/Kernel-Classes.js

@@ -1748,6 +1748,24 @@ messageSends: ["ifNil:ifNotNil:", "package", "name"]
 }),
 $globals.Class);
 
+$core.addMethod(
+$core.method({
+selector: "classTag",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return "class";
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "classTag\x0a\x09\x22Returns a tag or general category for this class.\x0a\x09Typically used to help tools do some reflection.\x0a\x09Helios, for example, uses this to decide what icon the class should display.\x22\x0a\x09\x0a\x09^ 'class'",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.Class);
+
 $core.addMethod(
 $core.method({
 selector: "definition",
@@ -1855,24 +1873,6 @@ messageSends: ["streamContents:", "nextPutAll:", "asString", "superclass", "name
 }),
 $globals.Class);
 
-$core.addMethod(
-$core.method({
-selector: "heliosClass",
-protocol: 'accessing',
-fn: function (){
-var self=this;
-return "class";
-
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "heliosClass\x0a\x09\x22Should be an Helios extension. Unfortunately, since helios can browse remote\x0a\x09environments, we can't extend base classes\x22\x0a\x09\x0a\x09^ 'class'",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: []
-}),
-$globals.Class);
-
 $core.addMethod(
 $core.method({
 selector: "isClass",

+ 8 - 7
src/Kernel-Classes.st

@@ -378,6 +378,14 @@ category
 	^ self package ifNil: [ 'Unclassified' ] ifNotNil: [ self package name ]
 !
 
+classTag
+	"Returns a tag or general category for this class.
+	Typically used to help tools do some reflection.
+	Helios, for example, uses this to decide what icon the class should display."
+	
+	^ 'class'
+!
+
 definition
 	^ String streamContents: [ :stream |
 		stream
@@ -396,13 +404,6 @@ definition
 			nextPutAll: '''' ]
 !
 
-heliosClass
-	"Should be an Helios extension. Unfortunately, since helios can browse remote
-	environments, we can't extend base classes"
-	
-	^ 'class'
-!
-
 package
 	^ self basicAt: 'pkg'
 !

+ 3 - 3
src/Kernel-Collections.js

@@ -1649,8 +1649,8 @@ $globals.Collection);
 
 $core.addMethod(
 $core.method({
-selector: "heliosClass",
-protocol: 'helios',
+selector: "classTag",
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return "collection";
@@ -1658,7 +1658,7 @@ return "collection";
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "heliosClass\x0a\x09^ 'collection'",
+source: "classTag\x0a\x09\x22Returns a tag or general category for this class.\x0a\x09Typically used to help tools do some reflection.\x0a\x09Helios, for example, uses this to decide what icon the class should display.\x22\x0a\x09\x0a\x09^ 'collection'",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []

+ 6 - 2
src/Kernel-Collections.st

@@ -392,9 +392,13 @@ notEmpty
 	^ self isEmpty not
 ! !
 
-!Collection class methodsFor: 'helios'!
+!Collection class methodsFor: 'accessing'!
 
-heliosClass
+classTag
+	"Returns a tag or general category for this class.
+	Typically used to help tools do some reflection.
+	Helios, for example, uses this to decide what icon the class should display."
+	
 	^ 'collection'
 ! !
 

+ 3 - 3
src/Kernel-Exceptions.js

@@ -374,8 +374,8 @@ $globals.Error);
 
 $core.addMethod(
 $core.method({
-selector: "heliosClass",
-protocol: 'helios',
+selector: "classTag",
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return "exception";
@@ -383,7 +383,7 @@ return "exception";
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "heliosClass\x0a\x09^ 'exception'",
+source: "classTag\x0a\x09\x22Returns a tag or general category for this class.\x0a\x09Typically used to help tools do some reflection.\x0a\x09Helios, for example, uses this to decide what icon the class should display.\x22\x0a\x09\x0a\x09^ 'exception'",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []

+ 6 - 2
src/Kernel-Exceptions.st

@@ -92,9 +92,13 @@ wasHandled
 	<return self.amberHandled || false>
 ! !
 
-!Error class methodsFor: 'helios'!
+!Error class methodsFor: 'accessing'!
 
-heliosClass
+classTag
+	"Returns a tag or general category for this class.
+	Typically used to help tools do some reflection.
+	Helios, for example, uses this to decide what icon the class should display."
+	
 	^ 'exception'
 ! !
 

+ 37 - 37
src/Kernel-Objects.js

@@ -3038,6 +3038,24 @@ messageSends: []
 $globals.Date);
 
 
+$core.addMethod(
+$core.method({
+selector: "classTag",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return "magnitude";
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "classTag\x0a\x09\x22Returns a tag or general category for this class.\x0a\x09Typically used to help tools do some reflection.\x0a\x09Helios, for example, uses this to decide what icon the class should display.\x22\x0a\x09\x0a\x09^ 'magnitude'",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.Date.klass);
+
 $core.addMethod(
 $core.method({
 selector: "fromMilliseconds:",
@@ -3113,24 +3131,6 @@ messageSends: ["new:"]
 }),
 $globals.Date.klass);
 
-$core.addMethod(
-$core.method({
-selector: "heliosClass",
-protocol: 'helios',
-fn: function (){
-var self=this;
-return "magnitude";
-
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "heliosClass\x0a\x09^ 'magnitude'",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: []
-}),
-$globals.Date.klass);
-
 $core.addMethod(
 $core.method({
 selector: "millisecondsToRun:",
@@ -4870,22 +4870,16 @@ $globals.Number);
 
 $core.addMethod(
 $core.method({
-selector: "e",
-protocol: 'instance creation',
+selector: "classTag",
+protocol: 'accessing',
 fn: function (){
 var self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-return Math.E;;
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"e",{},$globals.Number.klass)});
-//>>excludeEnd("ctx");
+return "magnitude";
+
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "e\x0a\x09<return Math.E;>",
+source: "classTag\x0a\x09\x22Returns a tag or general category for this class.\x0a\x09Typically used to help tools do some reflection.\x0a\x09Helios, for example, uses this to decide what icon the class should display.\x22\x0a\x09\x0a\x09^ 'magnitude'",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
@@ -4894,16 +4888,22 @@ $globals.Number.klass);
 
 $core.addMethod(
 $core.method({
-selector: "heliosClass",
-protocol: 'helios',
+selector: "e",
+protocol: 'instance creation',
 fn: function (){
 var self=this;
-return "magnitude";
-
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+return Math.E;;
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"e",{},$globals.Number.klass)});
+//>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "heliosClass\x0a\x09^ 'magnitude'",
+source: "e\x0a\x09<return Math.E;>",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
@@ -5555,8 +5555,8 @@ $globals.Point);
 
 $core.addMethod(
 $core.method({
-selector: "heliosClass",
-protocol: 'helios',
+selector: "classTag",
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return "magnitude";
@@ -5564,7 +5564,7 @@ return "magnitude";
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "heliosClass\x0a\x09^ 'magnitude'",
+source: "classTag\x0a\x09\x22Returns a tag or general category for this class.\x0a\x09Typically used to help tools do some reflection.\x0a\x09Helios, for example, uses this to decide what icon the class should display.\x22\x0a\x09\x0a\x09^ 'magnitude'",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []

+ 18 - 6
src/Kernel-Objects.st

@@ -712,9 +712,13 @@ printOn: aStream
 	aStream nextPutAll: self asString
 ! !
 
-!Date class methodsFor: 'helios'!
+!Date class methodsFor: 'accessing'!
 
-heliosClass
+classTag
+	"Returns a tag or general category for this class.
+	Typically used to help tools do some reflection.
+	Helios, for example, uses this to decide what icon the class should display."
+	
 	^ 'magnitude'
 ! !
 
@@ -1094,9 +1098,13 @@ positive
 	^ self >= 0
 ! !
 
-!Number class methodsFor: 'helios'!
+!Number class methodsFor: 'accessing'!
 
-heliosClass
+classTag
+	"Returns a tag or general category for this class.
+	Typically used to help tools do some reflection.
+	Helios, for example, uses this to decide what icon the class should display."
+	
 	^ 'magnitude'
 ! !
 
@@ -1233,9 +1241,13 @@ translateBy: delta
 	^ (delta x + x) @ (delta y + y)
 ! !
 
-!Point class methodsFor: 'helios'!
+!Point class methodsFor: 'accessing'!
 
-heliosClass
+classTag
+	"Returns a tag or general category for this class.
+	Typically used to help tools do some reflection.
+	Helios, for example, uses this to decide what icon the class should display."
+	
 	^ 'magnitude'
 ! !
 

+ 3 - 3
src/SUnit.js

@@ -658,8 +658,8 @@ $globals.TestCase.klass);
 
 $core.addMethod(
 $core.method({
-selector: "heliosClass",
-protocol: 'helios',
+selector: "classTag",
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return "test";
@@ -667,7 +667,7 @@ return "test";
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "heliosClass\x0a\x09^ 'test'",
+source: "classTag\x0a\x09\x22Returns a tag or general category for this class.\x0a\x09Typically used to help tools do some reflection.\x0a\x09Helios, for example, uses this to decide what icon the class should display.\x22\x0a\x09\x0a\x09^ 'test'",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []

+ 8 - 6
src/SUnit.st

@@ -160,6 +160,14 @@ buildSuite
 	^ self allTestSelectors collect: [ :each | self selector: each ]
 !
 
+classTag
+	"Returns a tag or general category for this class.
+	Typically used to help tools do some reflection.
+	Helios, for example, uses this to decide what icon the class should display."
+	
+	^ 'test'
+!
+
 lookupHierarchyRoot
 	^ TestCase
 !
@@ -174,12 +182,6 @@ testSelectors
 	^ self methodDictionary keys select: [ :each | each match: '^test' ]
 ! !
 
-!TestCase class methodsFor: 'helios'!
-
-heliosClass
-	^ 'test'
-! !
-
 !TestCase class methodsFor: 'testing'!
 
 isAbstract

+ 3 - 3
src/Web.js

@@ -5334,8 +5334,8 @@ $globals.Widget);
 
 $core.addMethod(
 $core.method({
-selector: "heliosClass",
-protocol: 'helios',
+selector: "classTag",
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return "widget";
@@ -5343,7 +5343,7 @@ return "widget";
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "heliosClass\x0a\x09^ 'widget'",
+source: "classTag\x0a\x09\x22Returns a tag or general category for this class.\x0a\x09Typically used to help tools do some reflection.\x0a\x09Helios, for example, uses this to decide what icon the class should display.\x22\x0a\x09\x0a\x09^ 'widget'",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []

+ 6 - 2
src/Web.st

@@ -1096,9 +1096,13 @@ renderOn: html
 	self
 ! !
 
-!Widget class methodsFor: 'helios'!
+!Widget class methodsFor: 'accessing'!
 
-heliosClass
+classTag
+	"Returns a tag or general category for this class.
+	Typically used to help tools do some reflection.
+	Helios, for example, uses this to decide what icon the class should display."
+	
 	^ 'widget'
 ! !