Skip to content

Commit af386c1

Browse files
committed
Small formatting changes
Also added some descriptions
1 parent e3163bc commit af386c1

File tree

2 files changed

+55
-56
lines changed

2 files changed

+55
-56
lines changed

snippets/objectscript-class.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"body": ["Method $1($2) As ${3:%Status}", "{", "\tset $4 = \\$\\$\\$OK", "\t$0", "\treturn $4", "}"]
1717
},
1818
"Property": {
19-
"prefix": "property",
19+
"prefix": "Property",
2020
"body": "Property $1 As ${2:%String};"
2121
},
2222
"Unique Property": {
@@ -40,34 +40,34 @@
4040
"body": "Index $1 On ${2:Name};"
4141
},
4242
"Unique Index": {
43-
"prefix": "Index",
44-
"body": "Index $1 On ${2:property} [Unique];",
45-
"description": "Unique Index"
43+
"prefix": "Index",
44+
"body": "Index $1 On ${2:property} [Unique];",
45+
"description": "Unique Index"
4646
},
4747
"Query": {
48-
"prefix":["Query"],
49-
"body":["Query $1($2) As %SQLQuery [ SqlProc ]","{","\tSELECT $3", "\tFROM $4", "\tWHERE $5", "\tORDER BY $6", "}"],
50-
"description": "SQL statement"
48+
"prefix":["Query"],
49+
"body":["Query $1($2) As %SQLQuery [ SqlProc ]","{","\tSELECT $3", "\tFROM $4", "\tWHERE $5", "\tORDER BY $6", "}"],
50+
"description": "SQL statement"
5151
},
5252
"Trigger": {
53-
"prefix": "Trigger",
54-
"body": [
53+
"prefix": "Trigger",
54+
"body": [
5555
"Trigger $1 [Event=${2|INSERT,UPDATE,DELETE|}, Time=${3|BEFORE,AFTER|}, Foreach=${4|row/object,row,statement|}]",
5656
"{",
5757
"\t$5",
5858
"}"
5959
],
60-
"description": "Trigger"
61-
},
62-
"ForeignKey": {
63-
"prefix": "Foreignkey",
64-
"body": "ForeignKey $1 (${2:property}) References ${3:referencedClass}(${4:refIndex});",
65-
"description": "ForeignKey"
66-
},
67-
"Relationship": {
68-
"prefix": ["Relationship"],
69-
"body": "Relationship $1 As ${2:classname} [ Cardinality = ${3|one,many,parent,children|}, Inverse = ${4:correspondingProperty} ];",
70-
"description": "Relationship"
60+
"description": "Trigger"
61+
},
62+
"ForeignKey": {
63+
"prefix": "Foreignkey",
64+
"body": "ForeignKey $1 (${2:property}) References ${3:referencedClass}(${4:refIndex});",
65+
"description": "ForeignKey"
66+
},
67+
"Relationship": {
68+
"prefix": ["Relationship"],
69+
"body": "Relationship $1 As ${2:classname} [ Cardinality = ${3|one,many,parent,children|}, Inverse = ${4:correspondingProperty} ];",
70+
"description": "Relationship"
7171
},
7272
"BusinessService": {
7373
"prefix": ["BusinessService","Interoperability"],

snippets/objectscript.json

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
11
{
2-
"ForOrder": {
3-
"prefix": ["For"],
4-
"body": [
2+
"ForOrder": {
3+
"prefix": ["For"],
4+
"body": [
55
"Set ${1:key} = \"\"",
66
"For {",
77
"\tSet ${1:key} = \\$ORDER(${2:array}(${1:key}))",
88
"\tQuit:${1:key}=\"\"",
99
"\t$3 // process ${2:array}(${1:key})",
1010
"}"
11-
],
12-
"description": "Looping Array with $Order"
13-
},
14-
"SQL Statement": {
15-
"prefix": ["sql"],
16-
"body": [
17-
"Set rs = ##class(%SQL.Statement).%ExecDirect(,\"SELECT * FROM\")",
18-
"While rs.%Next() {",
19-
"\twrite rs.ID, !",
20-
"}"],
21-
"description": "Prepare and execute SQL Query"
22-
},
23-
"For": {
24-
"prefix": ["For"],
25-
"body": ["for $1 = $2:$3:$4 {", "\t$0", "}"]
26-
},
27-
28-
"For Each": {
29-
"prefix": ["For"],
30-
"body": ["for $1 = \"$2\",\"$3\",\"$4\" {", "\t$0", "}"]
31-
},
32-
33-
"Do While": {
34-
"prefix": ["Do"],
35-
"body": ["do {", "\t$0", "} while ($1)"]
36-
},
37-
38-
"While": {
39-
"prefix": ["While"],
40-
"body": ["while ($1) {", "\t$0", "}"]
41-
}
42-
43-
11+
],
12+
"description": "Looping Array with $Order"
13+
},
14+
"SQL Statement": {
15+
"prefix": ["sql"],
16+
"body": [
17+
"Set rs = ##class(%SQL.Statement).%ExecDirect(,\"SELECT * FROM\")",
18+
"While rs.%Next() {",
19+
"\twrite rs.ID, !",
20+
"}"],
21+
"description": "Prepare and execute SQL Query"
22+
},
23+
"For": {
24+
"prefix": ["For"],
25+
"body": ["for $1 = $2:$3:$4 {", "\t$0", "}"],
26+
"description": "Typical for loop"
27+
},
28+
"For Each": {
29+
"prefix": ["For"],
30+
"body": ["for $1 = \"$2\",\"$3\",\"$4\" {", "\t$0", "}"],
31+
"description": "Loop through list of values"
32+
},
33+
"Do While": {
34+
"prefix": ["Do", "While"],
35+
"body": ["do {", "\t$0", "} while ($1)"],
36+
"description": "Do While loop"
37+
},
38+
"While": {
39+
"prefix": ["While"],
40+
"body": ["while ($1) {", "\t$0", "}"],
41+
"description": "While loop"
42+
}
4443
}

0 commit comments

Comments
 (0)