Skip to content

Commit

Permalink
Use proper placeholder syntax in snippets. Fixes #217
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon committed May 18, 2017
1 parent 351dfc9 commit 671b263
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions snippets/java.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
"foreach": {
"prefix": "foreach",
"body": [
"for (${type} ${var} : ${iterable}) {",
"\t$4",
"for (${0:type} ${1:var} : ${2:iterable}) {",
"\t$3",
"}"
],
"description": "Enhanced for loop"
},
"Public constructor": {
"prefix": "ctor",
"body": [
"public ${name}($1) {",
"public ${1:name}($2) {",
"\tsuper();",
"\t$0",
"}"
Expand All @@ -45,11 +45,11 @@
"prefix": "class",
"body": [
"/**",
" * ${name}",
" * ${1:name}",
" */",
"public class ${name} {",
"public class ${1:name} {",
"",
"\tpublic ${name} (${parameters}) {",
"\tpublic ${1:name} (${2:parameters}) {",
"\t\t$0",
"\t}",
"}"
Expand All @@ -60,9 +60,9 @@
"prefix": "interface",
"body": [
"/**",
" * ${name}",
" * ${1:name}",
" */",
"public interface ${name} {",
"public interface ${1:name} {",
"\t$0",
"}"
],
Expand All @@ -71,16 +71,16 @@
"if": {
"prefix": "if",
"body": [
"if (${condition}) {",
"\t$2",
"if (${1:condition}) {",
"\t$0",
"}"
],
"description": "if statement"
},
"ifelse": {
"prefix": "ifelse",
"body": [
"if (${condition}) {",
"if (${1:condition}) {",
"\t$2",
"} else {",
"\t$3",
Expand All @@ -91,7 +91,7 @@
"ifnull": {
"prefix": "ifnull",
"body": [
"if (${condition} == null) {",
"if (${1:condition} == null) {",
"\t$2",
"}"
],
Expand All @@ -100,7 +100,7 @@
"ifnotnull": {
"prefix": "ifnotnull",
"body": [
"if (${condition} != null) {",
"if (${1:condition} != null) {",
"\t$2",
"}"
],
Expand All @@ -111,16 +111,16 @@
"body": [
"try {",
"\t$1",
"} catch (${Exception} ${e}) {",
"\t$4//${TODO}: handle exception",
"} catch (${2:Exception} ${3:e}) {",
"\t$4//${5:TODO}: handle exception",
"}"
],
"description": "try/catch block"
},
"private_method": {
"prefix": "private_method",
"body": [
"private ${Type} ${name}(${3}) {",
"private ${1:Type} ${2:name}($3) {",
"\t$4",
"}"
],
Expand All @@ -129,7 +129,7 @@
"Public method": {
"prefix": "public_method",
"body": [
"public ${Type} ${name}(${3}) {",
"public ${1:Type} ${2:name}(${3}) {",
"\t$4",
"}"
],
Expand All @@ -138,7 +138,7 @@
"Private static method": {
"prefix": "private_static_method",
"body": [
"private static ${Type} ${name}(${3}) {",
"private static ${1:Type} ${2:name}(${3}) {",
"\t$4",
"}"
],
Expand All @@ -147,7 +147,7 @@
"Public static method": {
"prefix": "public_static_method",
"body": [
"public static ${Type} ${name}(${3}) {",
"public static ${1:Type} ${2:name}(${3}) {",
"\t$4",
"}"
],
Expand All @@ -156,7 +156,7 @@
"Protected Method": {
"prefix": "protected_method",
"body": [
"protected ${Type} ${name}(${3}) {",
"protected ${1:Type} ${2:name}(${3}) {",
"\t$4",
"}"
],
Expand All @@ -165,8 +165,8 @@
"Switch Statement": {
"prefix": "switch",
"body": [
"switch (${key}) {",
"\tcase ${value}:",
"switch (${1:key}) {",
"\tcase ${2:value}:",
"\t\t$0",
"\t\tbreak;",
"",
Expand All @@ -179,7 +179,7 @@
"While Statement": {
"prefix": "while",
"body": [
"while (${condition}) {",
"while (${1:condition}) {",
"\t$0",
"}"
],
Expand All @@ -190,7 +190,7 @@
"body": [
"do {",
"\t$0",
"} while (${condition});"
"} while (${1:condition});"
],
"description": "Do-While Statement"
}
Expand Down

0 comments on commit 671b263

Please sign in to comment.