-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathgleam.snippets
58 lines (58 loc) · 1.12 KB
/
gleam.snippets
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
snippet fn "fn"
fn ${1:function_name}(${2}) -> ${3:Nil} {
${0:${VISUAL:todo}}
}
snippet pfn "pub fn"
pub fn ${1:function_name}(${2}) -> ${3:Nil} {
${0:${VISUAL:todo}}
}
snippet test "test fn"
pub fn ${1:name}_test() {
${0}
}
snippet af "anonymous fn"
fn(${1}) { ${0:${VISUAL}} }
snippet let "let binding"
let ${1} = ${0}
snippet l "let binding"
let ${1} = ${0}
snippet as "assert binding"
let assert ${1} = ${0}
snippet - "->"
-> ${0}
snippet case "case expression"
case ${1} {
${2} -> ${0}
}
snippet ty "type"
type ${1:Name} {
${0:$1}
}
snippet pty "pub type"
pub type ${1:Name} {
${0:$1}
}
snippet tya "type alias"
type ${1:Name} =
${0:$1}
snippet ptya "pub type alias"
pub type ${1:Name} =
${0:$1}
snippet im "import"
import ${0:gleam/result}
snippet im. "import exposing"
import ${1:gleam/result}.{${0}}
snippet p "|>"
|> ${0}
snippet bl "block"
{
${0:${VISUAL}}
}
snippet tf "fn(Type) -> Type"
fn(${1}) -> ${0}
snippet seq "should.equal"
should.equal(${0:${VISUAL}})
snippet strue "should.be_true"
should.be_true(${0:${VISUAL}})
snippet sfalse "should.be_false"
should.be_false(${0:${VISUAL}})