Fix our snippets to be text mate compatible

This commit is contained in:
Johannes Rieken 2016-11-11 17:13:29 +01:00
parent 613dd2eb19
commit cf5c011529
8 changed files with 193 additions and 258 deletions

View file

@ -2,27 +2,28 @@
"transition property": { "transition property": {
"prefix": "transition", "prefix": "transition",
"body": [ "body": [
"-webkit-transition: ${property} ${duration} ${timing-function} ${delay};", "-webkit-transition: ${1:property} ${2:duration} ${3:timing-function} ${4:delay};",
"-moz-transition: ${property} ${duration} ${timing-function} ${delay};", "-moz-transition: ${1:property} ${2:duration} ${3:timing-function} ${4:delay};",
"transition: ${property} ${duration} ${timing-function} ${delay};" "transition: ${1:property} ${2:duration} ${3:timing-function} ${4:delay};"
], ],
"description": "The transition property across browsers" "description": "The transition property across browsers"
}, },
"border": { "border": {
"prefix": "border", "prefix": "border",
"body": [ "body": [
"border: ${width} ${border-style} ${color};$0" "border: ${1:width} ${2:border-style} ${3:color};$0"
], ],
"description": "[width] [border-style] [color]" "description": "[width] [border-style] [color]"
}, },
"gradient": { "gradient": {
"prefix": "gradient", "prefix": "gradient",
"body": [ "body": [
"background-image: -webkit-gradient(linear, left top, left bottom, from(${start-color}), to(${end-color}));", "background-image: -webkit-gradient(linear, left top, left bottom, from(${1:start-color}), to(${2:end-color}));",
"background-image: -webkit-linear-gradient(top, ${start-color}, ${end-color});", "background-image: -webkit-linear-gradient(top, ${1:start-color}, ${2:end-color});",
"background-image: -moz-linear-gradient(top, ${start-color}, ${end-color});", "background-image: -moz-linear-gradient(top, ${1:start-color}, ${2:end-color});",
"background-image: linear-gradient(to bottom, ${start-color}, ${end-color});" "background-image: linear-gradient(to bottom, ${1:start-color}, ${2:end-color});"
], ],
"description": "Set the 'background-image' property to a linear gradient" "description": "Set the 'background-image' property to a linear gradient"
} }
} }

View file

@ -4,8 +4,8 @@
"body": [ "body": [
"define([", "define([",
"\t'require',", "\t'require',",
"\t'${dependency}'", "\t'${1:dependency}'",
"], function(require, ${factory}) {", "], function(require, ${2:factory}) {",
"\t'use strict';", "\t'use strict';",
"\t$0", "\t$0",
"});" "});"
@ -15,8 +15,8 @@
"For Loop": { "For Loop": {
"prefix": "for", "prefix": "for",
"body": [ "body": [
"for (var ${index} = 0; ${index} < ${array}.length; ${index}++) {", "for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
"\tvar ${element} = ${array}[${index}];", "\tvar ${3:element} = ${2:array}[${1:index}];",
"\t$0", "\t$0",
"}" "}"
], ],
@ -25,7 +25,7 @@
"For-Each Loop": { "For-Each Loop": {
"prefix": "foreach", "prefix": "foreach",
"body": [ "body": [
"${array}.forEach(function(${element}) {", "${1:array}.forEach(function(${2:element}) {",
"\t$0", "\t$0",
"}, this);" "}, this);"
], ],
@ -34,9 +34,9 @@
"For-In Loop": { "For-In Loop": {
"prefix": "forin", "prefix": "forin",
"body": [ "body": [
"for (var ${key} in ${object}) {", "for (var ${1:key} in ${2:object}) {",
"\tif (${object}.hasOwnProperty(${key})) {", "\tif (${2:object}.hasOwnProperty(${1:key})) {",
"\t\tvar ${element} = ${object}[${key}];", "\t\tvar ${3:element} = ${2:object}[${1:key}];",
"\t\t$0", "\t\t$0",
"\t}", "\t}",
"}" "}"
@ -46,7 +46,7 @@
"Function Statement": { "Function Statement": {
"prefix": "function", "prefix": "function",
"body": [ "body": [
"function ${name}(${params}) {", "function ${1:name}(${2:params}) {",
"\t$0", "\t$0",
"}" "}"
], ],
@ -55,7 +55,7 @@
"If Statement": { "If Statement": {
"prefix": "if", "prefix": "if",
"body": [ "body": [
"if (${condition}) {", "if (${1:condition}) {",
"\t$0", "\t$0",
"}" "}"
], ],
@ -64,7 +64,7 @@
"If-Else Statement": { "If-Else Statement": {
"prefix": "ifelse", "prefix": "ifelse",
"body": [ "body": [
"if (${condition}) {", "if (${1:condition}) {",
"\t$0", "\t$0",
"} else {", "} else {",
"\t", "\t",
@ -75,15 +75,15 @@
"New Statement": { "New Statement": {
"prefix": "new", "prefix": "new",
"body": [ "body": [
"var ${name} = new ${type}(${arguments});$0" "var ${1:name} = new ${2:type}(${3:arguments});$0"
], ],
"description": "New Statement" "description": "New Statement"
}, },
"Switch Statement": { "Switch Statement": {
"prefix": "switch", "prefix": "switch",
"body": [ "body": [
"switch (${key}) {", "switch (${1:key}) {",
"\tcase ${value}:", "\tcase ${2:value}:",
"\t\t$0", "\t\t$0",
"\t\tbreak;", "\t\tbreak;",
"", "",
@ -96,7 +96,7 @@
"While Statement": { "While Statement": {
"prefix": "while", "prefix": "while",
"body": [ "body": [
"while (${condition}) {", "while (${1:condition}) {",
"\t$0", "\t$0",
"}" "}"
], ],
@ -107,16 +107,16 @@
"body": [ "body": [
"do {", "do {",
"\t$0", "\t$0",
"} while (${condition});" "} while (${1:condition});"
], ],
"description": "Do-While Statement" "description": "Do-While Statement"
}, },
"Try-Catch Statement":{ "Try-Catch Statement": {
"prefix": "trycatch", "prefix": "trycatch",
"body": [ "body": [
"try {", "try {",
"\t$0", "\t$0",
"} catch (${error}) {", "} catch (${1:error}) {",
"\t", "\t",
"}" "}"
], ],
@ -127,7 +127,7 @@
"body": [ "body": [
"setTimeout(function() {", "setTimeout(function() {",
"\t$0", "\t$0",
"}, ${timeout});" "}, ${1:timeout});"
], ],
"description": "Set Timeout Function" "description": "Set Timeout Function"
}, },

View file

@ -4,8 +4,8 @@
"body": [ "body": [
"define([", "define([",
"\t'require',", "\t'require',",
"\t'${dependency}'", "\t'${1:dependency}'",
"], function(require, ${factory}) {", "], function(require, ${2:factory}) {",
"\t'use strict';", "\t'use strict';",
"\t$0", "\t$0",
"});" "});"
@ -15,8 +15,8 @@
"For Loop": { "For Loop": {
"prefix": "for", "prefix": "for",
"body": [ "body": [
"for (var ${index} = 0; ${index} < ${array}.length; ${index}++) {", "for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
"\tvar ${element} = ${array}[${index}];", "\tvar ${3:element} = ${2:array}[${1:index}];",
"\t$0", "\t$0",
"}" "}"
], ],
@ -25,7 +25,7 @@
"For-Each Loop": { "For-Each Loop": {
"prefix": "foreach", "prefix": "foreach",
"body": [ "body": [
"${array}.forEach(function(${element}) {", "${1:array}.forEach(function(${2:element}) {",
"\t$0", "\t$0",
"}, this);" "}, this);"
], ],
@ -34,9 +34,9 @@
"For-In Loop": { "For-In Loop": {
"prefix": "forin", "prefix": "forin",
"body": [ "body": [
"for (var ${key} in ${object}) {", "for (var ${1:key} in ${2:object}) {",
"\tif (${object}.hasOwnProperty(${key})) {", "\tif (${2:object}.hasOwnProperty(${1:key})) {",
"\t\tvar ${element} = ${object}[${key}];", "\t\tvar ${3:element} = ${2:object}[${1:key}];",
"\t\t$0", "\t\t$0",
"\t}", "\t}",
"}" "}"
@ -46,7 +46,7 @@
"Function Statement": { "Function Statement": {
"prefix": "function", "prefix": "function",
"body": [ "body": [
"function ${name}(${params}) {", "function ${1:name}(${2:params}) {",
"\t$0", "\t$0",
"}" "}"
], ],
@ -55,7 +55,7 @@
"If Statement": { "If Statement": {
"prefix": "if", "prefix": "if",
"body": [ "body": [
"if (${condition}) {", "if (${1:condition}) {",
"\t$0", "\t$0",
"}" "}"
], ],
@ -64,7 +64,7 @@
"If-Else Statement": { "If-Else Statement": {
"prefix": "ifelse", "prefix": "ifelse",
"body": [ "body": [
"if (${condition}) {", "if (${1:condition}) {",
"\t$0", "\t$0",
"} else {", "} else {",
"\t", "\t",
@ -75,15 +75,15 @@
"New Statement": { "New Statement": {
"prefix": "new", "prefix": "new",
"body": [ "body": [
"var ${name} = new ${type}(${arguments});$0" "var ${1:name} = new ${2:type}(${3:arguments});$0"
], ],
"description": "New Statement" "description": "New Statement"
}, },
"Switch Statement": { "Switch Statement": {
"prefix": "switch", "prefix": "switch",
"body": [ "body": [
"switch (${key}) {", "switch (${1:key}) {",
"\tcase ${value}:", "\tcase ${2:value}:",
"\t\t$0", "\t\t$0",
"\t\tbreak;", "\t\tbreak;",
"", "",
@ -96,7 +96,7 @@
"While Statement": { "While Statement": {
"prefix": "while", "prefix": "while",
"body": [ "body": [
"while (${condition}) {", "while (${1:condition}) {",
"\t$0", "\t$0",
"}" "}"
], ],
@ -107,16 +107,16 @@
"body": [ "body": [
"do {", "do {",
"\t$0", "\t$0",
"} while (${condition});" "} while (${1:condition});"
], ],
"description": "Do-While Statement" "description": "Do-While Statement"
}, },
"Try-Catch Statement":{ "Try-Catch Statement": {
"prefix": "trycatch", "prefix": "trycatch",
"body": [ "body": [
"try {", "try {",
"\t$0", "\t$0",
"} catch (${error}) {", "} catch (${2:error}) {",
"\t", "\t",
"}" "}"
], ],
@ -127,7 +127,7 @@
"body": [ "body": [
"setTimeout(function() {", "setTimeout(function() {",
"\t$0", "\t$0",
"}, ${timeout});" "}, ${1:timeout});"
], ],
"description": "Set Timeout Function" "description": "Set Timeout Function"
}, },

View file

@ -1,82 +1,71 @@
{ {
"Insert bold text": { "Insert bold text": {
"prefix": "bold", "prefix": "bold",
"body": "**${text}**${}", "body": "**${1:text}**${}",
"description": "Insert bold text" "description": "Insert bold text"
}, },
"Insert italic text": { "Insert italic text": {
"prefix": "italic", "prefix": "italic",
"body": "*${text}*${}", "body": "*${1:text}*${}",
"description": "Insert italic text" "description": "Insert italic text"
}, },
"Insert quoted text": { "Insert quoted text": {
"prefix": "quote", "prefix": "quote",
"body": "> ${text}", "body": "> ${1:text}",
"description": "Insert quoted text" "description": "Insert quoted text"
}, },
"Insert code": { "Insert code": {
"prefix": "code", "prefix": "code",
"body": "`${text}`${}", "body": "`${1:text}`${}",
"description": "Insert code" "description": "Insert code"
}, },
"Insert fenced code block": { "Insert fenced code block": {
"prefix": "fenced codeblock", "prefix": "fenced codeblock",
"body": [ "body": [
"```${language}", "```${1:language}",
"$0", "$0",
"```" "```"
], ],
"description": "Insert fenced code block" "description": "Insert fenced code block"
}, },
"Insert heading": { "Insert heading": {
"prefix": "heading", "prefix": "heading",
"body": "# ${text}", "body": "# ${1:text}",
"description": "Insert heading" "description": "Insert heading"
}, },
"Insert unordered list": { "Insert unordered list": {
"prefix": "unordered list", "prefix": "unordered list",
"body": [ "body": [
"- ${first}", "- ${1:first}",
"- ${second}", "- ${2:second}",
"- ${third}", "- ${3:third}",
"$0" "$0"
], ],
"description": "Insert unordered list" "description": "Insert unordered list"
}, },
"Insert ordered list": { "Insert ordered list": {
"prefix": "ordered list", "prefix": "ordered list",
"body": [ "body": [
"1. ${first}", "1. ${1:first}",
"2. ${second}", "2. ${2:second}",
"3. ${third}", "3. ${3:third}",
"$0" "$0"
], ],
"description": "Insert ordered list" "description": "Insert ordered list"
}, },
"Insert horizontal rule": { "Insert horizontal rule": {
"prefix": "horizontal rule", "prefix": "horizontal rule",
"body": "----------\n", "body": "----------\n",
"description": "Insert horizontal rule" "description": "Insert horizontal rule"
}, },
"Insert link": { "Insert link": {
"prefix": "link", "prefix": "link",
"body": "[${text}](http://${link})$0", "body": "[${1:text}](http://${2:link})$0",
"description": "Insert link" "description": "Insert link"
}, },
"Insert image": {
"Insert image" : {
"prefix": "image", "prefix": "image",
"body": "![${alt}](http://${link})$0", "body": "![${1:alt}](http://${2:link})$0",
"description": "Insert image" "description": "Insert image"
} }
} }

View file

@ -7,86 +7,70 @@
"prefix": "po", "prefix": "po",
"body": "print(\"\\($1)\")$0" "body": "print(\"\\($1)\")$0"
}, },
"repeat...while loop": { "repeat...while loop": {
"prefix": "repeat", "prefix": "repeat",
"body": [ "body": [
"repeat {", "repeat {",
" $0", " $0",
"} while ${true}" "} while ${1:true}"
], ],
"description": "repeat...while loop" "description": "repeat...while loop"
}, },
"While loop": { "While loop": {
"prefix": "while", "prefix": "while",
"body": [ "body": [
"while ${true} {", "while ${1:true} {",
" $0", " $0",
"}" "}"
], ],
"description": "While loop" "description": "While loop"
}, },
"For-In statement": { "For-In statement": {
"prefix": "forin", "prefix": "forin",
"body": [ "body": [
"for ${item} in ${collection} {", "for ${1:item} in ${2:collection} {",
" $0", " $0",
"}" "}"
], ],
"description": "For-In statement" "description": "For-In statement"
}, },
"Reverse for loop": { "Reverse for loop": {
"prefix": "forr", "prefix": "forr",
"body": [ "body": [
"for var ${i} = ${length} - 1; ${i} >= 0; ${i}-- {", "for var ${1:i} = ${2:length} - 1; ${1:i} >= 0; ${1:i}-- {",
" $0", " $0",
"}" "}"
], ],
"description": "Reverse for loop" "description": "Reverse for loop"
}, },
"for loop": { "for loop": {
"prefix": "for", "prefix": "for",
"body": [ "body": [
"for var ${i} = 0; ${i} < ${length}; ${i}++ {", "for var ${1:i} = 0; ${1:i} < ${2:length}; ${1:i}++ {",
" $0", " $0",
"}" "}"
], ],
"description": "for loop" "description": "for loop"
}, },
"if statement": { "if statement": {
"prefix": "if", "prefix": "if",
"body": [ "body": [
"if ${true} {", "if ${1:true} {",
" $0", " $0",
"}" "}"
], ],
"description": "if statement" "description": "if statement"
}, },
"else-if statement": { "else-if statement": {
"prefix": "elif", "prefix": "elif",
"body": [ "body": [
"else if ${true} {", "else if ${1:true} {",
" $0", " $0",
"}" "}"
], ],
"description": "if statement" "description": "if statement"
}, },
"Else statement": { "Else statement": {
"prefix": "else", "prefix": "else",
"body": [ "body": [
"else {", "else {",
@ -95,35 +79,29 @@
], ],
"description": "Else statement" "description": "Else statement"
}, },
"Guard statement": { "Guard statement": {
"prefix": "guard", "prefix": "guard",
"body": [ "body": [
"guard let ${a} = ${optional} else {", "guard let ${1:a} = ${2:optional} else {",
" $0", " $0",
"}" "}"
], ],
"description": "Guard statement" "description": "Guard statement"
}, },
"Optional Binding statement": { "Optional Binding statement": {
"prefix": "ifnil", "prefix": "ifnil",
"body": [ "body": [
"if let ${a} = ${optional} {", "if let ${1:a} = ${2:optional} {",
" $0", " $0",
"}" "}"
], ],
"description": "Optional Binding statement" "description": "Optional Binding statement"
}, },
"Switch statement": { "Switch statement": {
"prefix": "switch", "prefix": "switch",
"body": [ "body": [
"switch ${switch_on} {", "switch ${1:switch_on} {",
"case ${a}:", "case ${2:a}:",
" $0", " $0",
"default:", "default:",
" $1", " $1",
@ -131,28 +109,25 @@
], ],
"description": "Switch statement" "description": "Switch statement"
}, },
"Do catch": { "Do catch": {
"prefix": "docatch", "prefix": "docatch",
"body": [ "body": [
"do {", "do {",
" try ${function that throws}", " try ${1:function that throws}",
"} catch ${pattern} {", "} catch ${2:pattern} {",
" $0", " $0",
"}" "}"
], ],
"description": "Try catch" "description": "Try catch"
}, },
"Enum": { "Enum": {
"prefix": "enum", "prefix": "enum",
"body": [ "body": [
"enum ${Name} {", "enum ${1:Name} {",
" case $0", " case $0",
"}" "}"
], ],
"description": "Enum" "description": "Enum"
} }
} }

View file

@ -8,7 +8,6 @@
], ],
"description": "jsdoc snippet" "description": "jsdoc snippet"
}, },
"Constructor": { "Constructor": {
"prefix": "ctor", "prefix": "ctor",
"body": [ "body": [
@ -22,99 +21,90 @@
], ],
"description": "Constructor" "description": "Constructor"
}, },
"Class Definition": { "Class Definition": {
"prefix": "class", "prefix": "class",
"body": [ "body": [
"/**", "/**",
" * ${name}", " * ${1:name}",
" */", " */",
"class ${name} {", "class ${1:name} {",
"\tconstructor(${parameters}) {", "\tconstructor(${2:parameters}) {",
"\t\t$0", "\t\t$0",
"\t}", "\t}",
"}" "}"
], ],
"description": "Class Definition" "description": "Class Definition"
}, },
"Public Method Definition": { "Public Method Definition": {
"prefix": "public method", "prefix": "public method",
"body": [ "body": [
"/**", "/**",
" * ${name}", " * ${1:name}",
" */", " */",
"public ${name}() {", "public ${1:name}() {",
"\t$0", "\t$0",
"}" "}"
], ],
"description": "Public Method Definition" "description": "Public Method Definition"
}, },
"Private Method Definition": { "Private Method Definition": {
"prefix": "private method", "prefix": "private method",
"body": [ "body": [
"private ${name}() {", "private ${1:name}() {",
"\t$0", "\t$0",
"}" "}"
], ],
"description": "Private Method Definition" "description": "Private Method Definition"
}, },
"Import external module.": { "Import external module.": {
"prefix": "import statement", "prefix": "import statement",
"body": [ "body": [
"import { $0 } from '${module}';" "import { $0 } from '${1:module}';"
], ],
"description": "Import external module." "description": "Import external module."
}, },
"Property getter": { "Property getter": {
"prefix": "get", "prefix": "get",
"body": [ "body": [
"", "",
"public get ${value}() : ${string} {", "public get ${1:value}() : ${2:string} {",
" ${return $0}", " ${3:return $0}",
"}", "}",
"" ""
], ],
"description": "Property getter" "description": "Property getter"
}, },
"Log to the console": { "Log to the console": {
"prefix": "log", "prefix": "log",
"body": [ "body": [
"console.log(${_});", "console.log($1);",
"$0" "$0"
], ],
"description": "Log to the console" "description": "Log to the console"
}, },
"Define a full property": { "Define a full property": {
"prefix": "prop", "prefix": "prop",
"body": [ "body": [
"", "",
"private _${value} : ${string};", "private _${1:value} : ${2:string};",
"public get ${value}() : ${string} {", "public get ${1:value}() : ${2:string} {",
" return this._${value};", " return this._${1:value};",
"}", "}",
"public set ${value}(v : ${string}) {", "public set ${1:value}(v : ${2:string}) {",
" this._${value} = v;", " this._${1:value} = v;",
"}", "}",
"" ""
], ],
"description": "Define a full property" "description": "Define a full property"
}, },
"Triple-slash reference": { "Triple-slash reference": {
"prefix": "ref", "prefix": "ref",
"body": [ "body": [
"/// <reference path=\"${_}\" />", "/// <reference path=\"$1\" />",
"$0" "$0"
], ],
"description": "Triple-slash reference" "description": "Triple-slash reference"
}, },
"Return false": { "Return false": {
"prefix": "ret0", "prefix": "ret0",
"body": [ "body": [
@ -122,7 +112,6 @@
], ],
"description": "Return false" "description": "Return false"
}, },
"Return true": { "Return true": {
"prefix": "ret1", "prefix": "ret1",
"body": [ "body": [
@ -130,41 +119,37 @@
], ],
"description": "Return true" "description": "Return true"
}, },
"Return statement": { "Return statement": {
"prefix": "ret", "prefix": "ret",
"body": [ "body": [
"return ${_};$0" "return $1;$0"
], ],
"description": "Return statement" "description": "Return statement"
}, },
"Property setter": { "Property setter": {
"prefix": "set", "prefix": "set",
"body": [ "body": [
"", "",
"public set ${value}(v : ${string}) {", "public set ${1:value}(v : ${2:string}) {",
" this.${_} = v;", " this.$3 = v;",
"}", "}",
"" ""
], ],
"description": "Property setter" "description": "Property setter"
}, },
"Throw Exception": { "Throw Exception": {
"prefix": "throw", "prefix": "throw",
"body": [ "body": [
"throw \"${_}\";", "throw \"$1\";",
"$0" "$0"
], ],
"description": "Throw Exception" "description": "Throw Exception"
}, },
"For Loop": { "For Loop": {
"prefix": "for", "prefix": "for",
"body": [ "body": [
"for (var ${index} = 0; ${index} < ${array}.length; ${index}++) {", "for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
"\tvar ${element} = ${array}[${index}];", "\tvar ${3:element} = ${2:array}[${1:index}];",
"\t$0", "\t$0",
"}" "}"
], ],
@ -173,7 +158,7 @@
"For-Each Loop using =>": { "For-Each Loop using =>": {
"prefix": "foreach =>", "prefix": "foreach =>",
"body": [ "body": [
"${array}.forEach(${element} => {", "${1:array}.forEach(${2:element} => {",
"\t$0", "\t$0",
"});" "});"
], ],
@ -182,9 +167,9 @@
"For-In Loop": { "For-In Loop": {
"prefix": "forin", "prefix": "forin",
"body": [ "body": [
"for (var ${key} in ${object}) {", "for (var ${1:key} in ${2:object}) {",
"\tif (${object}.hasOwnProperty(${key})) {", "\tif (${2:object}.hasOwnProperty(${1:key})) {",
"\t\tvar ${element} = ${object}[${key}];", "\t\tvar ${3:element} = ${2:object}[${1:key}];",
"\t\t$0", "\t\t$0",
"\t}", "\t}",
"}" "}"
@ -194,7 +179,7 @@
"Function Statement": { "Function Statement": {
"prefix": "function", "prefix": "function",
"body": [ "body": [
"function ${name}(${params}:${type}) {", "function ${1:name}(${2:params}:${3:type}) {",
"\t$0", "\t$0",
"}" "}"
], ],
@ -203,7 +188,7 @@
"If Statement": { "If Statement": {
"prefix": "if", "prefix": "if",
"body": [ "body": [
"if (${condition}) {", "if (${1:condition}) {",
"\t$0", "\t$0",
"}" "}"
], ],
@ -212,7 +197,7 @@
"If-Else Statement": { "If-Else Statement": {
"prefix": "ifelse", "prefix": "ifelse",
"body": [ "body": [
"if (${condition}) {", "if (${1:condition}) {",
"\t$0", "\t$0",
"} else {", "} else {",
"\t", "\t",
@ -223,15 +208,15 @@
"New Statement": { "New Statement": {
"prefix": "new", "prefix": "new",
"body": [ "body": [
"var ${name} = new ${type}(${arguments});$0" "var ${1:name} = new ${2:type}(${3:arguments});$0"
], ],
"description": "New Statement" "description": "New Statement"
}, },
"Switch Statement": { "Switch Statement": {
"prefix": "switch", "prefix": "switch",
"body": [ "body": [
"switch (${key}) {", "switch (${1:key}) {",
"\tcase ${value}:", "\tcase ${2:value}:",
"\t\t$0", "\t\t$0",
"\t\tbreak;", "\t\tbreak;",
"", "",
@ -244,7 +229,7 @@
"While Statement": { "While Statement": {
"prefix": "while", "prefix": "while",
"body": [ "body": [
"while (${condition}) {", "while (${1:condition}) {",
"\t$0", "\t$0",
"}" "}"
], ],
@ -255,16 +240,16 @@
"body": [ "body": [
"do {", "do {",
"\t$0", "\t$0",
"} while (${condition});" "} while (${1:condition});"
], ],
"description": "Do-While Statement" "description": "Do-While Statement"
}, },
"Try-Catch Statement":{ "Try-Catch Statement": {
"prefix": "trycatch", "prefix": "trycatch",
"body": [ "body": [
"try {", "try {",
"\t$0", "\t$0",
"} catch (${error}) {", "} catch (${1:error}) {",
"\t", "\t",
"}" "}"
], ],
@ -275,8 +260,8 @@
"body": [ "body": [
"setTimeout(function() {", "setTimeout(function() {",
"\t$0", "\t$0",
"}, ${timeout});" "}, ${1:timeout});"
], ],
"description": "Set Timeout Function" "description": "Set Timeout Function"
} }
} }

View file

@ -8,7 +8,6 @@
], ],
"description": "jsdoc snippet" "description": "jsdoc snippet"
}, },
"Constructor": { "Constructor": {
"prefix": "ctor", "prefix": "ctor",
"body": [ "body": [
@ -22,99 +21,90 @@
], ],
"description": "Constructor" "description": "Constructor"
}, },
"Class Definition": { "Class Definition": {
"prefix": "class", "prefix": "class",
"body": [ "body": [
"/**", "/**",
" * ${name}", " * ${1:name}",
" */", " */",
"class ${name} {", "class ${1:name} {",
"\tconstructor(${parameters}) {", "\tconstructor(${2:parameters}) {",
"\t\t$0", "\t\t$0",
"\t}", "\t}",
"}" "}"
], ],
"description": "Class Definition" "description": "Class Definition"
}, },
"Public Method Definition": { "Public Method Definition": {
"prefix": "public method", "prefix": "public method",
"body": [ "body": [
"/**", "/**",
" * ${name}", " * ${1:name}",
" */", " */",
"public ${name}() {", "public ${1:name}() {",
"\t$0", "\t$0",
"}" "}"
], ],
"description": "Public Method Definition" "description": "Public Method Definition"
}, },
"Private Method Definition": { "Private Method Definition": {
"prefix": "private method", "prefix": "private method",
"body": [ "body": [
"private ${name}() {", "private ${1:name}() {",
"\t$0", "\t$0",
"}" "}"
], ],
"description": "Private Method Definition" "description": "Private Method Definition"
}, },
"Import external module.": { "Import external module.": {
"prefix": "import statement", "prefix": "import statement",
"body": [ "body": [
"import ${name} = require('$0');" "import ${1:name} = require('$0');"
], ],
"description": "Import external module." "description": "Import external module."
}, },
"Property getter": { "Property getter": {
"prefix": "get", "prefix": "get",
"body": [ "body": [
"", "",
"public get ${value}() : ${string} {", "public get ${1:value}() : ${2:string} {",
" ${return $0}", " ${3:return $0}",
"}", "}",
"" ""
], ],
"description": "Property getter" "description": "Property getter"
}, },
"Log to the console": { "Log to the console": {
"prefix": "log", "prefix": "log",
"body": [ "body": [
"console.log(${_});", "console.log($1);",
"$0" "$0"
], ],
"description": "Log to the console" "description": "Log to the console"
}, },
"Define a full property": { "Define a full property": {
"prefix": "prop", "prefix": "prop",
"body": [ "body": [
"", "",
"private _${value} : ${string};", "private _${1:value} : ${2:string};",
"public get ${value}() : ${string} {", "public get ${1:value}() : ${2:string} {",
" return this._${value};", " return this._${1:value};",
"}", "}",
"public set ${value}(v : ${string}) {", "public set ${1:value}(v : ${2:string}) {",
" this._${value} = v;", " this._${1:value} = v;",
"}", "}",
"" ""
], ],
"description": "Define a full property" "description": "Define a full property"
}, },
"Triple-slash reference": { "Triple-slash reference": {
"prefix": "ref", "prefix": "ref",
"body": [ "body": [
"/// <reference path=\"${_}\" />", "/// <reference path=\"$1\" />",
"$0" "$0"
], ],
"description": "Triple-slash reference" "description": "Triple-slash reference"
}, },
"Return false": { "Return false": {
"prefix": "ret0", "prefix": "ret0",
"body": [ "body": [
@ -122,7 +112,6 @@
], ],
"description": "Return false" "description": "Return false"
}, },
"Return true": { "Return true": {
"prefix": "ret1", "prefix": "ret1",
"body": [ "body": [
@ -130,41 +119,37 @@
], ],
"description": "Return true" "description": "Return true"
}, },
"Return statement": { "Return statement": {
"prefix": "ret", "prefix": "ret",
"body": [ "body": [
"return ${_};$0" "return $1;$0"
], ],
"description": "Return statement" "description": "Return statement"
}, },
"Property setter": { "Property setter": {
"prefix": "set", "prefix": "set",
"body": [ "body": [
"", "",
"public set ${value}(v : ${string}) {", "public set ${1:value}(v : ${2:string}) {",
" this.${_} = v;", " this.$3 = v;",
"}", "}",
"" ""
], ],
"description": "Property setter" "description": "Property setter"
}, },
"Throw Exception": { "Throw Exception": {
"prefix": "throw", "prefix": "throw",
"body": [ "body": [
"throw \"${_}\";", "throw \"$1\";",
"$0" "$0"
], ],
"description": "Throw Exception" "description": "Throw Exception"
}, },
"For Loop": { "For Loop": {
"prefix": "for", "prefix": "for",
"body": [ "body": [
"for (var ${index} = 0; ${index} < ${array}.length; ${index}++) {", "for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
"\tvar ${element} = ${array}[${index}];", "\tvar ${3:element} = ${2:array}[${1:index}];",
"\t$0", "\t$0",
"}" "}"
], ],
@ -173,18 +158,18 @@
"For-Each Loop using =>": { "For-Each Loop using =>": {
"prefix": "foreach =>", "prefix": "foreach =>",
"body": [ "body": [
"${array}.forEach(${element} => {", "${1:array}.forEach(${2:element} => {",
"\t$0", "\t$0",
"});" "});"
], ],
"description": "For-Each Loop using =>" "description": "For-Each Loop using =>"
}, },
"For-In Loop": { "For-In Loop": {
"prefix": "forin", "prefix": "forin",
"body": [ "body": [
"for (var ${key} in ${object}) {", "for (var ${1:key} in ${2:object}) {",
"\tif (${object}.hasOwnProperty(${key})) {", "\tif (${2:object}.hasOwnProperty(${1:key})) {",
"\t\tvar ${element} = ${object}[${key}];", "\t\tvar ${3:element} = ${2:object}[${1:key}];",
"\t\t$0", "\t\t$0",
"\t}", "\t}",
"}" "}"
@ -194,7 +179,7 @@
"Function Statement": { "Function Statement": {
"prefix": "function", "prefix": "function",
"body": [ "body": [
"function ${name}(${params}:${type}) {", "function ${1:name}(${2:params}:${3:type}) {",
"\t$0", "\t$0",
"}" "}"
], ],
@ -203,7 +188,7 @@
"If Statement": { "If Statement": {
"prefix": "if", "prefix": "if",
"body": [ "body": [
"if (${condition}) {", "if (${1:condition}) {",
"\t$0", "\t$0",
"}" "}"
], ],
@ -212,7 +197,7 @@
"If-Else Statement": { "If-Else Statement": {
"prefix": "ifelse", "prefix": "ifelse",
"body": [ "body": [
"if (${condition}) {", "if (${1:condition}) {",
"\t$0", "\t$0",
"} else {", "} else {",
"\t", "\t",
@ -223,15 +208,15 @@
"New Statement": { "New Statement": {
"prefix": "new", "prefix": "new",
"body": [ "body": [
"var ${name} = new ${type}(${arguments});$0" "var ${1:name} = new ${2:type}(${2:arguments});$0"
], ],
"description": "New Statement" "description": "New Statement"
}, },
"Switch Statement": { "Switch Statement": {
"prefix": "switch", "prefix": "switch",
"body": [ "body": [
"switch (${key}) {", "switch (${1:key}) {",
"\tcase ${value}:", "\tcase ${2:value}:",
"\t\t$0", "\t\t$0",
"\t\tbreak;", "\t\tbreak;",
"", "",
@ -244,7 +229,7 @@
"While Statement": { "While Statement": {
"prefix": "while", "prefix": "while",
"body": [ "body": [
"while (${condition}) {", "while (${1:condition}) {",
"\t$0", "\t$0",
"}" "}"
], ],
@ -255,16 +240,16 @@
"body": [ "body": [
"do {", "do {",
"\t$0", "\t$0",
"} while (${condition});" "} while (${1:condition});"
], ],
"description": "Do-While Statement" "description": "Do-While Statement"
}, },
"Try-Catch Statement":{ "Try-Catch Statement": {
"prefix": "trycatch", "prefix": "trycatch",
"body": [ "body": [
"try {", "try {",
"\t$0", "\t$0",
"} catch (${error}) {", "} catch (${1:error}) {",
"\t", "\t",
"}" "}"
], ],
@ -275,8 +260,8 @@
"body": [ "body": [
"setTimeout(function() {", "setTimeout(function() {",
"\t$0", "\t$0",
"}, ${timeout});" "}, ${1:timeout});"
], ],
"description": "Set Timeout Function" "description": "Set Timeout Function"
} }
} }

View file

@ -1,57 +1,57 @@
{ {
"For Next Loop": { "For Next Loop": {
"prefix": "for", "prefix": "for",
"body": [ "body": [
"For ${index} As ${ObjectType} = ${lower} To ${Upper}", "For ${1:index} As ${2:ObjectType} = ${3:lower} To ${4:Upper}",
"\t$0", "\t$0",
"Next ${index}" "Next ${1:index}"
], ],
"description": "For Next Loop" "description": "For Next Loop"
}, },
"For Each...Next": { "For Each...Next": {
"prefix": "fore", "prefix": "fore",
"body": [ "body": [
"For Each ${Variable} As ${ObjectType} In ${Collection}", "For Each ${1:Variable} As ${2:ObjectType} In ${3:Collection}",
"\t$0", "\t$0",
"Next" "Next"
], ],
"description": "For Each...Next" "description": "For Each...Next"
}, },
"For i...Next i": { "For i...Next i": {
"prefix": "fori", "prefix": "fori",
"body": [ "body": [
"For i As ${Integer} = ${Lower} To ${Upper}", "For i As ${1:Integer} = ${2:Lower} To ${3:Upper}",
"\t$0", "\t$0",
"Next i" "Next i"
], ],
"description": "For i...Next i" "description": "For i...Next i"
}, },
"For j...Next j": { "For j...Next j": {
"prefix": "forj", "prefix": "forj",
"body": [ "body": [
"For j As ${Integer} = ${Lower} To ${Upper}", "For j As ${1:Integer} = ${2:Lower} To ${3:Upper}",
"\t$0", "\t$0",
"Next j" "Next j"
], ],
"description": "For j...Next j" "description": "For j...Next j"
}, },
"Public Function...": { "Public Function...": {
"prefix": "pf", "prefix": "pf",
"body": [ "body": [
"Public Function ${FunctionName}(${ParameterList}) As ${ReturnType}", "Public Function ${1:FunctionName}(${2:ParameterList}) As ${3:ReturnType}",
"\tTry", "\tTry",
"\t\t$0", "\t\t$0",
"\tCatch ex As Exception", "\tCatch ex As Exception",
"\tEnd Try", "\tEnd Try",
"\tReturn ${ReturnValue}", "\tReturn ${3:ReturnValue}",
"End Function" "End Function"
], ],
"description": "Public Function..." "description": "Public Function..."
}, },
"Public Sub ...": { "Public Sub ...": {
"prefix": "ps", "prefix": "ps",
"body": [ "body": [
"Public Sub ${ProcedureName}(${ParameterList})", "Public Sub ${1:ProcedureName}(${2:ParameterList})",
"\tTry", "\tTry",
"\t\t$0", "\t\t$0",
"\tCatch ex As Exception", "\tCatch ex As Exception",
@ -59,14 +59,14 @@
"End Sub" "End Sub"
], ],
"description": "Public Sub ..." "description": "Public Sub ..."
}, },
"While ... End While": { "While ... End While": {
"prefix": "while", "prefix": "while",
"body": [ "body": [
"While ${Boolean}", "While ${1:Boolean}",
"\t$0", "\t$0",
"End While" "End While"
], ],
"description": "While ... End While" "description": "While ... End While"
} }
} }