Skip to content

Commit 8d29337

Browse files
committed
add /// description tabstop at start of all class snippets
1 parent 2f11663 commit 8d29337

File tree

1 file changed

+82
-43
lines changed

1 file changed

+82
-43
lines changed

snippets/objectscript-class.json

Lines changed: 82 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"Class definition without superclass": {
33
"prefix": "Class",
44
"body": [
5-
"Class ${1:PackageName.ClassName}",
5+
"/// ${1:Description}",
6+
"Class ${2:PackageName.ClassName}",
67
"{",
78
"$0",
89
"}"
@@ -11,7 +12,8 @@
1112
"Class definition with one superclass": {
1213
"prefix": "Class",
1314
"body": [
14-
"Class ${1:PackageName.ClassName} Extends ${2|%Persistent,%SerialObject,%RegisteredObject|}",
15+
"/// ${1:Description}",
16+
"Class ${2:PackageName.ClassName} Extends ${3|%Persistent,%SerialObject,%RegisteredObject|}",
1517
"{",
1618
"$0",
1719
"}"
@@ -20,7 +22,8 @@
2022
"Class definition with multiple superclasses": {
2123
"prefix": "Class",
2224
"body": [
23-
"Class ${1:PackageName.ClassName} Extends (${2|%Persistent,%SerialObject,%RegisteredObject|}, ${3:%XML.Adaptor})",
25+
"/// ${1:Description}",
26+
"Class ${2:PackageName.ClassName} Extends (${3|%Persistent,%SerialObject,%RegisteredObject|}, ${4:%XML.Adaptor})",
2427
"{",
2528
"$0",
2629
"}"
@@ -29,83 +32,107 @@
2932
"ClassMethod definition": {
3033
"prefix": "ClassMethod",
3134
"body": [
32-
"ClassMethod ${1:MethodName}($2) As ${3:%Status}",
35+
"/// ${1:Description}",
36+
"ClassMethod ${2:MethodName}($3) As ${4:%Status}",
3337
"{",
34-
"\tSet ${4:sc} = \\$\\$\\$OK",
38+
"\tSet ${5:sc} = \\$\\$\\$OK",
3539
"\t${0:// do something}",
36-
"\tReturn $4",
40+
"\tReturn $5",
3741
"}"
3842
]
3943
},
4044
"Method definition": {
4145
"prefix": "Method",
4246
"body": [
43-
"Method ${1:MethodName}($2) As ${3:%Status}",
47+
"/// ${1:Description}",
48+
"Method ${2:MethodName}($3) As ${4:%Status}",
4449
"{",
45-
"\tSet ${4:sc} = \\$\\$\\$OK",
50+
"\tSet ${5:sc} = \\$\\$\\$OK",
4651
"\t${0:// do something}",
47-
"\tReturn $4",
52+
"\tReturn $5",
4853
"}"
4954
]
5055
},
5156
"Property": {
5257
"prefix": "Property",
53-
"body": "Property ${1:PropertyName} As ${2:%String};"
58+
"body": [
59+
"/// ${1:Description}",
60+
"Property ${2:PropertyName} As ${3:%String};"
61+
]
5462
},
5563
"Projection": {
5664
"prefix": "Projection",
57-
"body": "Projection ${1:ProjectionName} As ${2:PackageName.ProjectionClassName};"
65+
"body": [
66+
"/// ${1:Description}",
67+
"Projection ${2:ProjectionName} As ${3:PackageName.ProjectionClassName};"
68+
]
5869
},
5970
"Unique Property": {
6071
"prefix": ["Unique", "Property"],
6172
"body": [
62-
"Property ${1:PropertyName} As ${2:%String};",
73+
"/// ${1:Description}",
74+
"Property ${2:PropertyName} As ${3:%String};",
6375
"",
64-
"Index $1Index On $1 [Unique];"
76+
"Index $2Index On $2 [Unique];"
6577
]
6678
},
6779
"Always-Computed Property": {
6880
"prefix": ["Computed", "Property"],
6981
"body" : [
70-
"Property ${1:PropertyName} As ${2:%String} [Calculated, SqlComputed, SqlComputeCode =",
71-
"\t{Set {$1} = {${3:expression}}}",
82+
"/// ${1:Description}",
83+
"Property ${2:PropertyName} As ${3:%String} [Calculated, SqlComputed, SqlComputeCode =",
84+
"\t{Set {$2} = {${4:expression}}}",
7285
"];"
7386
]
7487
},
7588
"Date/Time Property": {
7689
"prefix": ["Date", "Time", "Property"],
77-
"body" : ["Property ${1:PropertyName} As ${2|%Date,%Time|}(MINVAL = $3, MAXVAL = $4);"]
90+
"body" : [
91+
"/// ${1:Description}",
92+
"Property ${2:PropertyName} As ${3|%Date,%Time|}(MINVAL = $4, MAXVAL = $5);"
93+
]
7894
},
7995
"Parameter": {
8096
"prefix": "Parameter",
81-
"body": "Parameter ${1:PARAMETERNAME} = \"$0\";"
97+
"body": [
98+
"/// ${1:Description}",
99+
"Parameter ${2:PARAMETERNAME} = \"$0\";"
100+
]
82101
},
83102
"Index": {
84103
"prefix": "Index",
85-
"body": "Index ${1:IndexName} On ${2:property};"
104+
"body": [
105+
"/// ${1:Description}",
106+
"Index ${2:IndexName} On ${3:property};"
107+
]
86108
},
87109
"Unique Index": {
88110
"prefix": "Index",
89-
"body": "Index ${1:IndexName} On ${2:property} [Unique];",
111+
"body": [
112+
"/// ${1:Description}",
113+
"Index ${2:IndexName} On ${3:property} [Unique];"
114+
],
90115
"description": "Unique Index"
91116
},
92117
"Query": {
93118
"prefix":["Query"],
94119
"body":[
95-
"Query ${1:QueryName}($2) As %SQLQuery [ SqlProc ]",
120+
"/// ${1:Description}",
121+
"Query ${2:QueryName}($3) As %SQLQuery [ SqlProc ]",
96122
"{",
97-
"\tSELECT ${3:select-items}",
98-
"\tFROM ${4:table-refs}",
99-
"\tWHERE ${5:condition-expression}",
100-
"\tORDER BY ${6:ordering-items}",
123+
"\tSELECT ${4:select-items}",
124+
"\tFROM ${5:table-refs}",
125+
"\tWHERE ${6:condition-expression}",
126+
"\tORDER BY ${7:ordering-items}",
101127
"}"
102128
],
103129
"description": "SQL statement"
104130
},
105131
"Trigger": {
106132
"prefix": "Trigger",
107133
"body": [
108-
"Trigger ${1:TriggerName} [Event=${2|INSERT,UPDATE,DELETE|}, Time=${3|BEFORE,AFTER|}, Foreach=${4|row/object,row,statement|}]",
134+
"/// ${1:Description}",
135+
"Trigger ${2:TriggerName} [Event=${3|INSERT,UPDATE,DELETE|}, Time=${4|BEFORE,AFTER|}, Foreach=${5|row/object,row,statement|}]",
109136
"{",
110137
"\t${0:// do something}",
111138
"}"
@@ -114,18 +141,25 @@
114141
},
115142
"ForeignKey": {
116143
"prefix": "ForeignKey",
117-
"body": "ForeignKey ${1:ForeignKeyName}(${2:property}) References ${3:referencedClass}(${4:refIndex});",
144+
"body": [
145+
"/// ${1:Description}",
146+
"ForeignKey ${2:ForeignKeyName}(${3:property}) References ${4:referencedClass}(${5:refIndex});"
147+
],
118148
"description": "ForeignKey"
119149
},
120150
"Relationship": {
121151
"prefix": ["Relationship"],
122-
"body": "Relationship ${1:RelationshipName} As ${2:classname} [ Cardinality = ${3|one,many,parent,children|}, Inverse = ${4:correspondingProperty} ];",
152+
"body": [
153+
"/// ${1:Description}",
154+
"Relationship ${2:RelationshipName} As ${3:classname} [ Cardinality = ${4|one,many,parent,children|}, Inverse = ${5:correspondingProperty} ];"
155+
],
123156
"description": "Relationship"
124157
},
125158
"XData": {
126159
"prefix": "XData",
127160
"body": [
128-
"XData ${1:XDataName}",
161+
"/// ${1:Description}",
162+
"XData ${2:XDataName}",
129163
"{",
130164
"$0",
131165
"}"
@@ -135,16 +169,17 @@
135169
"BusinessService": {
136170
"prefix": ["BusinessService","Interoperability","ClassService"],
137171
"body": [
138-
"Class ${1:${TM_DIRECTORY/^.+\\/(.*)$/$1/}.$TM_FILENAME_BASE} Extends Ens.BusinessService",
172+
"/// ${1:Description}",
173+
"Class ${2:${TM_DIRECTORY/^.+\\/(.*)$/$1/}.$TM_FILENAME_BASE} Extends Ens.BusinessService",
139174
"{",
140175
"",
141-
"Property Adapter As ${2:Ens.InboundAdapter};",
176+
"Property Adapter As ${3:Ens.InboundAdapter};",
142177
"",
143-
"Parameter ADAPTER = \"$2\";",
178+
"Parameter ADAPTER = \"$3\";",
144179
"",
145180
"Method OnProcessInput(pInput As %RegisteredObject, pOutput As %RegisteredObject) As %Status",
146181
"{",
147-
"\t$3",
182+
"\t$0",
148183
"\tReturn \\$\\$\\$ERROR(\\$\\$\\$NotImplemented)",
149184
"}",
150185
"}"
@@ -154,25 +189,26 @@
154189
"BusinessOperation": {
155190
"prefix":["BusinessOperation","Interoperability","ClassOperation"],
156191
"body": [
157-
"Class ${1:${TM_DIRECTORY/^.+\\/(.*)$/$1/}.$TM_FILENAME_BASE} Extends Ens.BusinessOperation",
192+
"/// ${1:Description}",
193+
"Class ${2:${TM_DIRECTORY/^.+\\/(.*)$/$1/}.$TM_FILENAME_BASE} Extends Ens.BusinessOperation",
158194
"{",
159195
"",
160-
"Property Adapter As ${2:Ens.OutboundAdapter};",
196+
"Property Adapter As ${3:Ens.OutboundAdapter};",
161197
"",
162-
"Parameter ADAPTER = \"$2\";",
198+
"Parameter ADAPTER = \"$3\";",
163199
"",
164200
"Parameter INVOCATION = \"Queue\";",
165201
"",
166-
"Method SampleCall(pRequest As ${3:Ens.Request}, Output pResponse As ${4:Ens.Response} ) As %Status",
202+
"Method SampleCall(pRequest As ${4:Ens.Request}, Output pResponse As ${5:Ens.Response} ) As %Status",
167203
"{",
168-
"\t$5",
204+
"\t$0",
169205
"\tReturn \\$\\$\\$ERROR(\\$\\$\\$NotImplemented)",
170206
"}",
171207
"",
172208
"XData MessageMap",
173209
"{",
174210
"<MapItems>",
175-
"\t<MapItem MessageType=\"$3\">",
211+
"\t<MapItem MessageType=\"$4\">",
176212
"\t\t<Method>SampleCall</Method>",
177213
"\t</MapItem>",
178214
"</MapItems>",
@@ -184,14 +220,15 @@
184220
"Production": {
185221
"prefix": ["Production","Interoperability","ClassProduction"],
186222
"body": [
187-
"Class ${1:${TM_DIRECTORY/^.+\\/(.*)$/$1/}.$TM_FILENAME_BASE} Extends Ens.Production",
223+
"/// ${1:Description}",
224+
"Class ${2:${TM_DIRECTORY/^.+\\/(.*)$/$1/}.$TM_FILENAME_BASE} Extends Ens.Production",
188225
"{",
189226
"",
190227
"XData ProductionDefinition",
191228
"{",
192-
"\t<Production Name=\"$1\">",
229+
"\t<Production Name=\"$2\">",
193230
"\t\t<ActorPoolSize>2</ActorPoolSize>",
194-
"\t\t<Item ClassName=\"$2\" Name=\"$3\" PoolSize=\"1\"/>",
231+
"\t\t<Item ClassName=\"$3\" Name=\"$4\" PoolSize=\"1\"/>",
195232
"\t</Production>",
196233
"}",
197234
"}"
@@ -201,7 +238,8 @@
201238
"Request": {
202239
"prefix": ["Request","Interoperability","ClassRequest"],
203240
"body": [
204-
"Class ${1:${TM_DIRECTORY/^.+\\/(.*)$/$1/}.$TM_FILENAME_BASE} Extends Ens.Request",
241+
"/// ${1:Description}",
242+
"Class ${2:${TM_DIRECTORY/^.+\\/(.*)$/$1/}.$TM_FILENAME_BASE} Extends Ens.Request",
205243
"{",
206244
"$0",
207245
"}"
@@ -211,7 +249,8 @@
211249
"Response": {
212250
"prefix": ["Response","Interoperability","ClassResponse"],
213251
"body": [
214-
"Class ${1:${TM_DIRECTORY/^.+\\/(.*)$/$1/}.$TM_FILENAME_BASE} Extends Ens.Response",
252+
"/// ${1:Description}",
253+
"Class ${2:${TM_DIRECTORY/^.+\\/(.*)$/$1/}.$TM_FILENAME_BASE} Extends Ens.Response",
215254
"{",
216255
"$0",
217256
"}"

0 commit comments

Comments
 (0)