Skip to content

Commit ea80cb7

Browse files
committed
Add some keywords
1 parent fa7fea7 commit ea80cb7

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

snippets/scala.json

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
{
22
".source.scala": {
33
"main": {
4-
"prefix": "def main",
4+
"prefix": "main",
55
"body": "def main(args: Array[String]): Unit = {\n\t${1:expr}\n}",
66
"description": "Snippet for if expression"
77
},
8+
89
"match": {
910
"prefix": "match",
10-
"body": "match {\n\tcase ${1:pattern} => $2 \n}",
11-
"description": "Snippet for else branch"
12-
},
13-
"case": {
14-
"prefix": "case",
15-
"body": "case ${1:pattern} => $2",
11+
"body": "match {\n\tcase ${1:pattern} => ${2:doSomething} \n}",
1612
"description": "Snippet for else branch"
1713
},
14+
1815
"try catch": {
19-
"prefix": "try catch",
20-
"body": "try {\n\t${1:expression}\n} catch {\n\tcase ex: ${2:ExeptionClass} => $3 \n}",
16+
"prefix": "try",
17+
"body": "try {\n\t${1:expression}\n} catch {\n\tcase ex: ${2:ExeptionClass} => ${3:doSomething} \n}",
2118
"description": "Snippet for try/catch expression"
22-
}
19+
},
20+
21+
"class": { "prefix": "class", "body": "class ", "description": "class keyword" },
22+
"trait": { "prefix": "trait", "body": "trait ", "description": "trait keyword" },
23+
"object": { "prefix": "object", "body": "object ", "description": "object keyword" },
24+
"override": { "prefix": "override", "body": "override ", "description": "override keyword" },
25+
"catch": { "prefix": "catch", "body": "catch ", "description": "catch keyword" },
26+
"finally": { "prefix": "finally", "body": "finally ", "description": "finally keyword" }
2327
}
2428
}

0 commit comments

Comments
 (0)