Skip to content

Commit da2c8b6

Browse files
hopehadfieldrgrunber
authored andcommitted
Use choice syntax as placeholder for method/field snippets.
1 parent 14612c2 commit da2c8b6

File tree

1 file changed

+8
-44
lines changed

1 file changed

+8
-44
lines changed

snippets/java.json

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -38,50 +38,14 @@
3838
"}"
3939
]
4040
},
41-
"private_method": {
42-
"prefix": "private_method",
41+
"method": {
42+
"prefix": "method",
4343
"body": [
44-
"private ${1:void} ${2:name}($3) {",
44+
"${1|public,protected,private|}${2| , static |}${3:void} ${4:name}($5) {",
4545
"\t$0",
4646
"}"
4747
],
48-
"description": "private method"
49-
},
50-
"Public method": {
51-
"prefix": "public_method",
52-
"body": [
53-
"public ${1:void} ${2:name}(${3}) {",
54-
"\t$0",
55-
"}"
56-
],
57-
"description": "public method"
58-
},
59-
"Private static method": {
60-
"prefix": "private_static_method",
61-
"body": [
62-
"private static ${1:Type} ${2:name}(${3}) {",
63-
"\t$0",
64-
"}"
65-
],
66-
"description": "private static method"
67-
},
68-
"Public static method": {
69-
"prefix": "public_static_method",
70-
"body": [
71-
"public static ${1:void} ${2:name}(${3}) {",
72-
"\t$0",
73-
"}"
74-
],
75-
"description": "public static method"
76-
},
77-
"Protected Method": {
78-
"prefix": "protected_method",
79-
"body": [
80-
"protected ${1:void} ${2:name}(${3}) {",
81-
"\t$0",
82-
"}"
83-
],
84-
"description": "Protected method"
48+
"description": "Method"
8549
},
8650
"Switch Statement": {
8751
"prefix": "switch",
@@ -105,11 +69,11 @@
10569
],
10670
"description": "Create new Object"
10771
},
108-
"Private field": {
109-
"prefix": "prf",
72+
"Field": {
73+
"prefix": "field",
11074
"body": [
111-
"private ${1:String} ${2:name};"
75+
"${1|public,protected,private|} ${2:String} ${3:name};"
11276
],
113-
"description": "Private field"
77+
"description": "Field"
11478
}
11579
}

0 commit comments

Comments
 (0)