-
Notifications
You must be signed in to change notification settings - Fork 56
/
snippets.json
76 lines (76 loc) · 1.3 KB
/
snippets.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
"Module": {
"prefix": [
"module"
],
"body": [
"module ${1:Name} = {",
"\t${2:// Module contents}",
"}"
]
},
"Try": {
"prefix": [
"try"
],
"body": [
"try {",
"\t${1:expression}",
"} catch {",
"| ${2:MyException} => ${3:expression}",
"}"
]
},
"For Loop": {
"prefix": [
"for"
],
"body": [
"for ${1:i} in ${2:startValueInclusive} to ${3:endValueInclusive} {",
"\t${4:Js.log(${1:i})}",
"}"
]
},
"Reverse For Loop": {
"prefix": [
"for"
],
"body": [
"for ${1:i} in ${2:startValueInclusive} downto ${3:endValueInclusive} {",
"\t${4:Js.log(${1:i})}",
"}"
]
},
"Global External Object": {
"prefix": [
"external"
],
"body": [
"@val external ${1:setTimeout}: ${2:(unit => unit, int) => float} = \"${3:setTimeout}\""
]
},
"Global External Module": {
"prefix": [
"external"
],
"body": [
"@scope(\"${1:Math}\") @val external ${2:random}: ${3:unit => float} = \"${4:random}\""
]
},
"JS Module External": {
"prefix": [
"external"
],
"body": [
"@module(\"${1:path}\") external ${2:dirname}: ${3:string => string} = \"${4:dirname}\""
]
},
"JS Module Default External": {
"prefix": [
"external"
],
"body": [
"@module external ${1:leftPad}: ${2:(string, int) => string} = \"${3:leftPad}\""
]
}
}