mirror of
https://github.com/Microsoft/vscode
synced 2024-10-12 06:17:18 +00:00
Fix our snippets to be text mate compatible
This commit is contained in:
parent
613dd2eb19
commit
cf5c011529
|
@ -2,27 +2,28 @@
|
|||
"transition property": {
|
||||
"prefix": "transition",
|
||||
"body": [
|
||||
"-webkit-transition: ${property} ${duration} ${timing-function} ${delay};",
|
||||
"-moz-transition: ${property} ${duration} ${timing-function} ${delay};",
|
||||
"transition: ${property} ${duration} ${timing-function} ${delay};"
|
||||
"-webkit-transition: ${1:property} ${2:duration} ${3:timing-function} ${4:delay};",
|
||||
"-moz-transition: ${1:property} ${2:duration} ${3:timing-function} ${4:delay};",
|
||||
"transition: ${1:property} ${2:duration} ${3:timing-function} ${4:delay};"
|
||||
],
|
||||
"description": "The transition property across browsers"
|
||||
},
|
||||
"border": {
|
||||
"prefix": "border",
|
||||
"body": [
|
||||
"border: ${width} ${border-style} ${color};$0"
|
||||
"border: ${1:width} ${2:border-style} ${3:color};$0"
|
||||
],
|
||||
"description": "[width] [border-style] [color]"
|
||||
},
|
||||
"gradient": {
|
||||
"prefix": "gradient",
|
||||
"body": [
|
||||
"background-image: -webkit-gradient(linear, left top, left bottom, from(${start-color}), to(${end-color}));",
|
||||
"background-image: -webkit-linear-gradient(top, ${start-color}, ${end-color});",
|
||||
"background-image: -moz-linear-gradient(top, ${start-color}, ${end-color});",
|
||||
"background-image: linear-gradient(to bottom, ${start-color}, ${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, ${1:start-color}, ${2:end-color});",
|
||||
"background-image: -moz-linear-gradient(top, ${1:start-color}, ${2:end-color});",
|
||||
"background-image: linear-gradient(to bottom, ${1:start-color}, ${2:end-color});"
|
||||
],
|
||||
"description": "Set the 'background-image' property to a linear gradient"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
"body": [
|
||||
"define([",
|
||||
"\t'require',",
|
||||
"\t'${dependency}'",
|
||||
"], function(require, ${factory}) {",
|
||||
"\t'${1:dependency}'",
|
||||
"], function(require, ${2:factory}) {",
|
||||
"\t'use strict';",
|
||||
"\t$0",
|
||||
"});"
|
||||
|
@ -15,8 +15,8 @@
|
|||
"For Loop": {
|
||||
"prefix": "for",
|
||||
"body": [
|
||||
"for (var ${index} = 0; ${index} < ${array}.length; ${index}++) {",
|
||||
"\tvar ${element} = ${array}[${index}];",
|
||||
"for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
|
||||
"\tvar ${3:element} = ${2:array}[${1:index}];",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -25,7 +25,7 @@
|
|||
"For-Each Loop": {
|
||||
"prefix": "foreach",
|
||||
"body": [
|
||||
"${array}.forEach(function(${element}) {",
|
||||
"${1:array}.forEach(function(${2:element}) {",
|
||||
"\t$0",
|
||||
"}, this);"
|
||||
],
|
||||
|
@ -34,9 +34,9 @@
|
|||
"For-In Loop": {
|
||||
"prefix": "forin",
|
||||
"body": [
|
||||
"for (var ${key} in ${object}) {",
|
||||
"\tif (${object}.hasOwnProperty(${key})) {",
|
||||
"\t\tvar ${element} = ${object}[${key}];",
|
||||
"for (var ${1:key} in ${2:object}) {",
|
||||
"\tif (${2:object}.hasOwnProperty(${1:key})) {",
|
||||
"\t\tvar ${3:element} = ${2:object}[${1:key}];",
|
||||
"\t\t$0",
|
||||
"\t}",
|
||||
"}"
|
||||
|
@ -46,7 +46,7 @@
|
|||
"Function Statement": {
|
||||
"prefix": "function",
|
||||
"body": [
|
||||
"function ${name}(${params}) {",
|
||||
"function ${1:name}(${2:params}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -55,7 +55,7 @@
|
|||
"If Statement": {
|
||||
"prefix": "if",
|
||||
"body": [
|
||||
"if (${condition}) {",
|
||||
"if (${1:condition}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -64,7 +64,7 @@
|
|||
"If-Else Statement": {
|
||||
"prefix": "ifelse",
|
||||
"body": [
|
||||
"if (${condition}) {",
|
||||
"if (${1:condition}) {",
|
||||
"\t$0",
|
||||
"} else {",
|
||||
"\t",
|
||||
|
@ -75,15 +75,15 @@
|
|||
"New Statement": {
|
||||
"prefix": "new",
|
||||
"body": [
|
||||
"var ${name} = new ${type}(${arguments});$0"
|
||||
"var ${1:name} = new ${2:type}(${3:arguments});$0"
|
||||
],
|
||||
"description": "New Statement"
|
||||
},
|
||||
"Switch Statement": {
|
||||
"prefix": "switch",
|
||||
"body": [
|
||||
"switch (${key}) {",
|
||||
"\tcase ${value}:",
|
||||
"switch (${1:key}) {",
|
||||
"\tcase ${2:value}:",
|
||||
"\t\t$0",
|
||||
"\t\tbreak;",
|
||||
"",
|
||||
|
@ -96,7 +96,7 @@
|
|||
"While Statement": {
|
||||
"prefix": "while",
|
||||
"body": [
|
||||
"while (${condition}) {",
|
||||
"while (${1:condition}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -107,16 +107,16 @@
|
|||
"body": [
|
||||
"do {",
|
||||
"\t$0",
|
||||
"} while (${condition});"
|
||||
"} while (${1:condition});"
|
||||
],
|
||||
"description": "Do-While Statement"
|
||||
},
|
||||
"Try-Catch Statement":{
|
||||
"Try-Catch Statement": {
|
||||
"prefix": "trycatch",
|
||||
"body": [
|
||||
"try {",
|
||||
"\t$0",
|
||||
"} catch (${error}) {",
|
||||
"} catch (${1:error}) {",
|
||||
"\t",
|
||||
"}"
|
||||
],
|
||||
|
@ -127,7 +127,7 @@
|
|||
"body": [
|
||||
"setTimeout(function() {",
|
||||
"\t$0",
|
||||
"}, ${timeout});"
|
||||
"}, ${1:timeout});"
|
||||
],
|
||||
"description": "Set Timeout Function"
|
||||
},
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
"body": [
|
||||
"define([",
|
||||
"\t'require',",
|
||||
"\t'${dependency}'",
|
||||
"], function(require, ${factory}) {",
|
||||
"\t'${1:dependency}'",
|
||||
"], function(require, ${2:factory}) {",
|
||||
"\t'use strict';",
|
||||
"\t$0",
|
||||
"});"
|
||||
|
@ -15,8 +15,8 @@
|
|||
"For Loop": {
|
||||
"prefix": "for",
|
||||
"body": [
|
||||
"for (var ${index} = 0; ${index} < ${array}.length; ${index}++) {",
|
||||
"\tvar ${element} = ${array}[${index}];",
|
||||
"for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
|
||||
"\tvar ${3:element} = ${2:array}[${1:index}];",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -25,7 +25,7 @@
|
|||
"For-Each Loop": {
|
||||
"prefix": "foreach",
|
||||
"body": [
|
||||
"${array}.forEach(function(${element}) {",
|
||||
"${1:array}.forEach(function(${2:element}) {",
|
||||
"\t$0",
|
||||
"}, this);"
|
||||
],
|
||||
|
@ -34,9 +34,9 @@
|
|||
"For-In Loop": {
|
||||
"prefix": "forin",
|
||||
"body": [
|
||||
"for (var ${key} in ${object}) {",
|
||||
"\tif (${object}.hasOwnProperty(${key})) {",
|
||||
"\t\tvar ${element} = ${object}[${key}];",
|
||||
"for (var ${1:key} in ${2:object}) {",
|
||||
"\tif (${2:object}.hasOwnProperty(${1:key})) {",
|
||||
"\t\tvar ${3:element} = ${2:object}[${1:key}];",
|
||||
"\t\t$0",
|
||||
"\t}",
|
||||
"}"
|
||||
|
@ -46,7 +46,7 @@
|
|||
"Function Statement": {
|
||||
"prefix": "function",
|
||||
"body": [
|
||||
"function ${name}(${params}) {",
|
||||
"function ${1:name}(${2:params}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -55,7 +55,7 @@
|
|||
"If Statement": {
|
||||
"prefix": "if",
|
||||
"body": [
|
||||
"if (${condition}) {",
|
||||
"if (${1:condition}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -64,7 +64,7 @@
|
|||
"If-Else Statement": {
|
||||
"prefix": "ifelse",
|
||||
"body": [
|
||||
"if (${condition}) {",
|
||||
"if (${1:condition}) {",
|
||||
"\t$0",
|
||||
"} else {",
|
||||
"\t",
|
||||
|
@ -75,15 +75,15 @@
|
|||
"New Statement": {
|
||||
"prefix": "new",
|
||||
"body": [
|
||||
"var ${name} = new ${type}(${arguments});$0"
|
||||
"var ${1:name} = new ${2:type}(${3:arguments});$0"
|
||||
],
|
||||
"description": "New Statement"
|
||||
},
|
||||
"Switch Statement": {
|
||||
"prefix": "switch",
|
||||
"body": [
|
||||
"switch (${key}) {",
|
||||
"\tcase ${value}:",
|
||||
"switch (${1:key}) {",
|
||||
"\tcase ${2:value}:",
|
||||
"\t\t$0",
|
||||
"\t\tbreak;",
|
||||
"",
|
||||
|
@ -96,7 +96,7 @@
|
|||
"While Statement": {
|
||||
"prefix": "while",
|
||||
"body": [
|
||||
"while (${condition}) {",
|
||||
"while (${1:condition}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -107,16 +107,16 @@
|
|||
"body": [
|
||||
"do {",
|
||||
"\t$0",
|
||||
"} while (${condition});"
|
||||
"} while (${1:condition});"
|
||||
],
|
||||
"description": "Do-While Statement"
|
||||
},
|
||||
"Try-Catch Statement":{
|
||||
"Try-Catch Statement": {
|
||||
"prefix": "trycatch",
|
||||
"body": [
|
||||
"try {",
|
||||
"\t$0",
|
||||
"} catch (${error}) {",
|
||||
"} catch (${2:error}) {",
|
||||
"\t",
|
||||
"}"
|
||||
],
|
||||
|
@ -127,7 +127,7 @@
|
|||
"body": [
|
||||
"setTimeout(function() {",
|
||||
"\t$0",
|
||||
"}, ${timeout});"
|
||||
"}, ${1:timeout});"
|
||||
],
|
||||
"description": "Set Timeout Function"
|
||||
},
|
||||
|
|
|
@ -1,82 +1,71 @@
|
|||
{
|
||||
|
||||
"Insert bold text": {
|
||||
"prefix": "bold",
|
||||
"body": "**${text}**${}",
|
||||
"body": "**${1:text}**${}",
|
||||
"description": "Insert bold text"
|
||||
},
|
||||
|
||||
"Insert italic text": {
|
||||
"prefix": "italic",
|
||||
"body": "*${text}*${}",
|
||||
"body": "*${1:text}*${}",
|
||||
"description": "Insert italic text"
|
||||
},
|
||||
|
||||
"Insert quoted text": {
|
||||
"prefix": "quote",
|
||||
"body": "> ${text}",
|
||||
"body": "> ${1:text}",
|
||||
"description": "Insert quoted text"
|
||||
},
|
||||
|
||||
"Insert code": {
|
||||
"prefix": "code",
|
||||
"body": "`${text}`${}",
|
||||
"body": "`${1:text}`${}",
|
||||
"description": "Insert code"
|
||||
},
|
||||
|
||||
"Insert fenced code block": {
|
||||
"prefix": "fenced codeblock",
|
||||
"body": [
|
||||
"```${language}",
|
||||
"```${1:language}",
|
||||
"$0",
|
||||
"```"
|
||||
],
|
||||
"description": "Insert fenced code block"
|
||||
},
|
||||
|
||||
"Insert heading": {
|
||||
"prefix": "heading",
|
||||
"body": "# ${text}",
|
||||
"body": "# ${1:text}",
|
||||
"description": "Insert heading"
|
||||
},
|
||||
|
||||
"Insert unordered list": {
|
||||
"prefix": "unordered list",
|
||||
"body": [
|
||||
"- ${first}",
|
||||
"- ${second}",
|
||||
"- ${third}",
|
||||
"- ${1:first}",
|
||||
"- ${2:second}",
|
||||
"- ${3:third}",
|
||||
"$0"
|
||||
],
|
||||
"description": "Insert unordered list"
|
||||
},
|
||||
|
||||
"Insert ordered list": {
|
||||
"prefix": "ordered list",
|
||||
"body": [
|
||||
"1. ${first}",
|
||||
"2. ${second}",
|
||||
"3. ${third}",
|
||||
"1. ${1:first}",
|
||||
"2. ${2:second}",
|
||||
"3. ${3:third}",
|
||||
"$0"
|
||||
],
|
||||
"description": "Insert ordered list"
|
||||
},
|
||||
|
||||
"Insert horizontal rule": {
|
||||
"prefix": "horizontal rule",
|
||||
"body": "----------\n",
|
||||
"description": "Insert horizontal rule"
|
||||
},
|
||||
|
||||
"Insert link": {
|
||||
"prefix": "link",
|
||||
"body": "[${text}](http://${link})$0",
|
||||
"body": "[${1:text}](http://${2:link})$0",
|
||||
"description": "Insert link"
|
||||
},
|
||||
|
||||
"Insert image" : {
|
||||
"Insert image": {
|
||||
"prefix": "image",
|
||||
"body": "![${alt}](http://${link})$0",
|
||||
"body": "![${1:alt}](http://${2:link})$0",
|
||||
"description": "Insert image"
|
||||
}
|
||||
}
|
|
@ -7,86 +7,70 @@
|
|||
"prefix": "po",
|
||||
"body": "print(\"\\($1)\")$0"
|
||||
},
|
||||
|
||||
"repeat...while loop": {
|
||||
|
||||
"prefix": "repeat",
|
||||
"body": [
|
||||
"repeat {",
|
||||
" $0",
|
||||
"} while ${true}"
|
||||
"} while ${1:true}"
|
||||
],
|
||||
"description": "repeat...while loop"
|
||||
},
|
||||
|
||||
"While loop": {
|
||||
|
||||
"prefix": "while",
|
||||
"body": [
|
||||
"while ${true} {",
|
||||
"while ${1:true} {",
|
||||
" $0",
|
||||
"}"
|
||||
],
|
||||
"description": "While loop"
|
||||
},
|
||||
|
||||
"For-In statement": {
|
||||
|
||||
"prefix": "forin",
|
||||
"body": [
|
||||
"for ${item} in ${collection} {",
|
||||
"for ${1:item} in ${2:collection} {",
|
||||
" $0",
|
||||
"}"
|
||||
],
|
||||
"description": "For-In statement"
|
||||
},
|
||||
|
||||
"Reverse for loop": {
|
||||
|
||||
"prefix": "forr",
|
||||
"body": [
|
||||
"for var ${i} = ${length} - 1; ${i} >= 0; ${i}-- {",
|
||||
"for var ${1:i} = ${2:length} - 1; ${1:i} >= 0; ${1:i}-- {",
|
||||
" $0",
|
||||
"}"
|
||||
],
|
||||
"description": "Reverse for loop"
|
||||
},
|
||||
|
||||
"for loop": {
|
||||
|
||||
"prefix": "for",
|
||||
"body": [
|
||||
"for var ${i} = 0; ${i} < ${length}; ${i}++ {",
|
||||
"for var ${1:i} = 0; ${1:i} < ${2:length}; ${1:i}++ {",
|
||||
" $0",
|
||||
"}"
|
||||
],
|
||||
"description": "for loop"
|
||||
},
|
||||
|
||||
"if statement": {
|
||||
|
||||
"prefix": "if",
|
||||
"body": [
|
||||
"if ${true} {",
|
||||
"if ${1:true} {",
|
||||
" $0",
|
||||
"}"
|
||||
],
|
||||
"description": "if statement"
|
||||
},
|
||||
|
||||
"else-if statement": {
|
||||
|
||||
"prefix": "elif",
|
||||
"body": [
|
||||
"else if ${true} {",
|
||||
"else if ${1:true} {",
|
||||
" $0",
|
||||
"}"
|
||||
],
|
||||
"description": "if statement"
|
||||
},
|
||||
|
||||
"Else statement": {
|
||||
|
||||
"prefix": "else",
|
||||
"body": [
|
||||
"else {",
|
||||
|
@ -95,35 +79,29 @@
|
|||
],
|
||||
"description": "Else statement"
|
||||
},
|
||||
|
||||
"Guard statement": {
|
||||
|
||||
"prefix": "guard",
|
||||
"body": [
|
||||
"guard let ${a} = ${optional} else {",
|
||||
"guard let ${1:a} = ${2:optional} else {",
|
||||
" $0",
|
||||
"}"
|
||||
],
|
||||
"description": "Guard statement"
|
||||
},
|
||||
|
||||
"Optional Binding statement": {
|
||||
|
||||
"prefix": "ifnil",
|
||||
"body": [
|
||||
"if let ${a} = ${optional} {",
|
||||
"if let ${1:a} = ${2:optional} {",
|
||||
" $0",
|
||||
"}"
|
||||
],
|
||||
"description": "Optional Binding statement"
|
||||
},
|
||||
|
||||
"Switch statement": {
|
||||
|
||||
"prefix": "switch",
|
||||
"body": [
|
||||
"switch ${switch_on} {",
|
||||
"case ${a}:",
|
||||
"switch ${1:switch_on} {",
|
||||
"case ${2:a}:",
|
||||
" $0",
|
||||
"default:",
|
||||
" $1",
|
||||
|
@ -131,28 +109,25 @@
|
|||
],
|
||||
"description": "Switch statement"
|
||||
},
|
||||
|
||||
"Do catch": {
|
||||
|
||||
"prefix": "docatch",
|
||||
"body": [
|
||||
"do {",
|
||||
" try ${function that throws}",
|
||||
"} catch ${pattern} {",
|
||||
" try ${1:function that throws}",
|
||||
"} catch ${2:pattern} {",
|
||||
" $0",
|
||||
"}"
|
||||
],
|
||||
"description": "Try catch"
|
||||
},
|
||||
|
||||
"Enum": {
|
||||
|
||||
"prefix": "enum",
|
||||
"body": [
|
||||
"enum ${Name} {",
|
||||
"enum ${1:Name} {",
|
||||
" case $0",
|
||||
"}"
|
||||
],
|
||||
"description": "Enum"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
],
|
||||
"description": "jsdoc snippet"
|
||||
},
|
||||
|
||||
"Constructor": {
|
||||
"prefix": "ctor",
|
||||
"body": [
|
||||
|
@ -22,99 +21,90 @@
|
|||
],
|
||||
"description": "Constructor"
|
||||
},
|
||||
|
||||
"Class Definition": {
|
||||
"prefix": "class",
|
||||
"body": [
|
||||
"/**",
|
||||
" * ${name}",
|
||||
" * ${1:name}",
|
||||
" */",
|
||||
"class ${name} {",
|
||||
"\tconstructor(${parameters}) {",
|
||||
"class ${1:name} {",
|
||||
"\tconstructor(${2:parameters}) {",
|
||||
"\t\t$0",
|
||||
"\t}",
|
||||
"}"
|
||||
],
|
||||
"description": "Class Definition"
|
||||
},
|
||||
|
||||
"Public Method Definition": {
|
||||
"prefix": "public method",
|
||||
"body": [
|
||||
"/**",
|
||||
" * ${name}",
|
||||
" * ${1:name}",
|
||||
" */",
|
||||
"public ${name}() {",
|
||||
"public ${1:name}() {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Public Method Definition"
|
||||
},
|
||||
|
||||
"Private Method Definition": {
|
||||
"prefix": "private method",
|
||||
"body": [
|
||||
"private ${name}() {",
|
||||
"private ${1:name}() {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Private Method Definition"
|
||||
},
|
||||
|
||||
"Import external module.": {
|
||||
"prefix": "import statement",
|
||||
"body": [
|
||||
"import { $0 } from '${module}';"
|
||||
"import { $0 } from '${1:module}';"
|
||||
],
|
||||
"description": "Import external module."
|
||||
},
|
||||
|
||||
"Property getter": {
|
||||
"prefix": "get",
|
||||
"body": [
|
||||
"",
|
||||
"public get ${value}() : ${string} {",
|
||||
" ${return $0}",
|
||||
"public get ${1:value}() : ${2:string} {",
|
||||
" ${3:return $0}",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"description": "Property getter"
|
||||
},
|
||||
|
||||
"Log to the console": {
|
||||
"prefix": "log",
|
||||
"body": [
|
||||
"console.log(${_});",
|
||||
"console.log($1);",
|
||||
"$0"
|
||||
],
|
||||
"description": "Log to the console"
|
||||
},
|
||||
|
||||
"Define a full property": {
|
||||
"prefix": "prop",
|
||||
"body": [
|
||||
"",
|
||||
"private _${value} : ${string};",
|
||||
"public get ${value}() : ${string} {",
|
||||
" return this._${value};",
|
||||
"private _${1:value} : ${2:string};",
|
||||
"public get ${1:value}() : ${2:string} {",
|
||||
" return this._${1:value};",
|
||||
"}",
|
||||
"public set ${value}(v : ${string}) {",
|
||||
" this._${value} = v;",
|
||||
"public set ${1:value}(v : ${2:string}) {",
|
||||
" this._${1:value} = v;",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"description": "Define a full property"
|
||||
},
|
||||
|
||||
"Triple-slash reference": {
|
||||
"prefix": "ref",
|
||||
"body": [
|
||||
"/// <reference path=\"${_}\" />",
|
||||
"/// <reference path=\"$1\" />",
|
||||
"$0"
|
||||
],
|
||||
"description": "Triple-slash reference"
|
||||
},
|
||||
|
||||
"Return false": {
|
||||
"prefix": "ret0",
|
||||
"body": [
|
||||
|
@ -122,7 +112,6 @@
|
|||
],
|
||||
"description": "Return false"
|
||||
},
|
||||
|
||||
"Return true": {
|
||||
"prefix": "ret1",
|
||||
"body": [
|
||||
|
@ -130,41 +119,37 @@
|
|||
],
|
||||
"description": "Return true"
|
||||
},
|
||||
|
||||
"Return statement": {
|
||||
"prefix": "ret",
|
||||
"body": [
|
||||
"return ${_};$0"
|
||||
"return $1;$0"
|
||||
],
|
||||
"description": "Return statement"
|
||||
},
|
||||
|
||||
"Property setter": {
|
||||
"prefix": "set",
|
||||
"body": [
|
||||
"",
|
||||
"public set ${value}(v : ${string}) {",
|
||||
" this.${_} = v;",
|
||||
"public set ${1:value}(v : ${2:string}) {",
|
||||
" this.$3 = v;",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"description": "Property setter"
|
||||
},
|
||||
|
||||
"Throw Exception": {
|
||||
"prefix": "throw",
|
||||
"body": [
|
||||
"throw \"${_}\";",
|
||||
"throw \"$1\";",
|
||||
"$0"
|
||||
],
|
||||
"description": "Throw Exception"
|
||||
},
|
||||
|
||||
"For Loop": {
|
||||
"prefix": "for",
|
||||
"body": [
|
||||
"for (var ${index} = 0; ${index} < ${array}.length; ${index}++) {",
|
||||
"\tvar ${element} = ${array}[${index}];",
|
||||
"for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
|
||||
"\tvar ${3:element} = ${2:array}[${1:index}];",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -173,7 +158,7 @@
|
|||
"For-Each Loop using =>": {
|
||||
"prefix": "foreach =>",
|
||||
"body": [
|
||||
"${array}.forEach(${element} => {",
|
||||
"${1:array}.forEach(${2:element} => {",
|
||||
"\t$0",
|
||||
"});"
|
||||
],
|
||||
|
@ -182,9 +167,9 @@
|
|||
"For-In Loop": {
|
||||
"prefix": "forin",
|
||||
"body": [
|
||||
"for (var ${key} in ${object}) {",
|
||||
"\tif (${object}.hasOwnProperty(${key})) {",
|
||||
"\t\tvar ${element} = ${object}[${key}];",
|
||||
"for (var ${1:key} in ${2:object}) {",
|
||||
"\tif (${2:object}.hasOwnProperty(${1:key})) {",
|
||||
"\t\tvar ${3:element} = ${2:object}[${1:key}];",
|
||||
"\t\t$0",
|
||||
"\t}",
|
||||
"}"
|
||||
|
@ -194,7 +179,7 @@
|
|||
"Function Statement": {
|
||||
"prefix": "function",
|
||||
"body": [
|
||||
"function ${name}(${params}:${type}) {",
|
||||
"function ${1:name}(${2:params}:${3:type}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -203,7 +188,7 @@
|
|||
"If Statement": {
|
||||
"prefix": "if",
|
||||
"body": [
|
||||
"if (${condition}) {",
|
||||
"if (${1:condition}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -212,7 +197,7 @@
|
|||
"If-Else Statement": {
|
||||
"prefix": "ifelse",
|
||||
"body": [
|
||||
"if (${condition}) {",
|
||||
"if (${1:condition}) {",
|
||||
"\t$0",
|
||||
"} else {",
|
||||
"\t",
|
||||
|
@ -223,15 +208,15 @@
|
|||
"New Statement": {
|
||||
"prefix": "new",
|
||||
"body": [
|
||||
"var ${name} = new ${type}(${arguments});$0"
|
||||
"var ${1:name} = new ${2:type}(${3:arguments});$0"
|
||||
],
|
||||
"description": "New Statement"
|
||||
},
|
||||
"Switch Statement": {
|
||||
"prefix": "switch",
|
||||
"body": [
|
||||
"switch (${key}) {",
|
||||
"\tcase ${value}:",
|
||||
"switch (${1:key}) {",
|
||||
"\tcase ${2:value}:",
|
||||
"\t\t$0",
|
||||
"\t\tbreak;",
|
||||
"",
|
||||
|
@ -244,7 +229,7 @@
|
|||
"While Statement": {
|
||||
"prefix": "while",
|
||||
"body": [
|
||||
"while (${condition}) {",
|
||||
"while (${1:condition}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -255,16 +240,16 @@
|
|||
"body": [
|
||||
"do {",
|
||||
"\t$0",
|
||||
"} while (${condition});"
|
||||
"} while (${1:condition});"
|
||||
],
|
||||
"description": "Do-While Statement"
|
||||
},
|
||||
"Try-Catch Statement":{
|
||||
"Try-Catch Statement": {
|
||||
"prefix": "trycatch",
|
||||
"body": [
|
||||
"try {",
|
||||
"\t$0",
|
||||
"} catch (${error}) {",
|
||||
"} catch (${1:error}) {",
|
||||
"\t",
|
||||
"}"
|
||||
],
|
||||
|
@ -275,7 +260,7 @@
|
|||
"body": [
|
||||
"setTimeout(function() {",
|
||||
"\t$0",
|
||||
"}, ${timeout});"
|
||||
"}, ${1:timeout});"
|
||||
],
|
||||
"description": "Set Timeout Function"
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
],
|
||||
"description": "jsdoc snippet"
|
||||
},
|
||||
|
||||
"Constructor": {
|
||||
"prefix": "ctor",
|
||||
"body": [
|
||||
|
@ -22,99 +21,90 @@
|
|||
],
|
||||
"description": "Constructor"
|
||||
},
|
||||
|
||||
"Class Definition": {
|
||||
"prefix": "class",
|
||||
"body": [
|
||||
"/**",
|
||||
" * ${name}",
|
||||
" * ${1:name}",
|
||||
" */",
|
||||
"class ${name} {",
|
||||
"\tconstructor(${parameters}) {",
|
||||
"class ${1:name} {",
|
||||
"\tconstructor(${2:parameters}) {",
|
||||
"\t\t$0",
|
||||
"\t}",
|
||||
"}"
|
||||
],
|
||||
"description": "Class Definition"
|
||||
},
|
||||
|
||||
"Public Method Definition": {
|
||||
"prefix": "public method",
|
||||
"body": [
|
||||
"/**",
|
||||
" * ${name}",
|
||||
" * ${1:name}",
|
||||
" */",
|
||||
"public ${name}() {",
|
||||
"public ${1:name}() {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Public Method Definition"
|
||||
},
|
||||
|
||||
"Private Method Definition": {
|
||||
"prefix": "private method",
|
||||
"body": [
|
||||
"private ${name}() {",
|
||||
"private ${1:name}() {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Private Method Definition"
|
||||
},
|
||||
|
||||
"Import external module.": {
|
||||
"prefix": "import statement",
|
||||
"body": [
|
||||
"import ${name} = require('$0');"
|
||||
"import ${1:name} = require('$0');"
|
||||
],
|
||||
"description": "Import external module."
|
||||
},
|
||||
|
||||
"Property getter": {
|
||||
"prefix": "get",
|
||||
"body": [
|
||||
"",
|
||||
"public get ${value}() : ${string} {",
|
||||
" ${return $0}",
|
||||
"public get ${1:value}() : ${2:string} {",
|
||||
" ${3:return $0}",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"description": "Property getter"
|
||||
},
|
||||
|
||||
"Log to the console": {
|
||||
"prefix": "log",
|
||||
"body": [
|
||||
"console.log(${_});",
|
||||
"console.log($1);",
|
||||
"$0"
|
||||
],
|
||||
"description": "Log to the console"
|
||||
},
|
||||
|
||||
"Define a full property": {
|
||||
"prefix": "prop",
|
||||
"body": [
|
||||
"",
|
||||
"private _${value} : ${string};",
|
||||
"public get ${value}() : ${string} {",
|
||||
" return this._${value};",
|
||||
"private _${1:value} : ${2:string};",
|
||||
"public get ${1:value}() : ${2:string} {",
|
||||
" return this._${1:value};",
|
||||
"}",
|
||||
"public set ${value}(v : ${string}) {",
|
||||
" this._${value} = v;",
|
||||
"public set ${1:value}(v : ${2:string}) {",
|
||||
" this._${1:value} = v;",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"description": "Define a full property"
|
||||
},
|
||||
|
||||
"Triple-slash reference": {
|
||||
"prefix": "ref",
|
||||
"body": [
|
||||
"/// <reference path=\"${_}\" />",
|
||||
"/// <reference path=\"$1\" />",
|
||||
"$0"
|
||||
],
|
||||
"description": "Triple-slash reference"
|
||||
},
|
||||
|
||||
"Return false": {
|
||||
"prefix": "ret0",
|
||||
"body": [
|
||||
|
@ -122,7 +112,6 @@
|
|||
],
|
||||
"description": "Return false"
|
||||
},
|
||||
|
||||
"Return true": {
|
||||
"prefix": "ret1",
|
||||
"body": [
|
||||
|
@ -130,41 +119,37 @@
|
|||
],
|
||||
"description": "Return true"
|
||||
},
|
||||
|
||||
"Return statement": {
|
||||
"prefix": "ret",
|
||||
"body": [
|
||||
"return ${_};$0"
|
||||
"return $1;$0"
|
||||
],
|
||||
"description": "Return statement"
|
||||
},
|
||||
|
||||
"Property setter": {
|
||||
"prefix": "set",
|
||||
"body": [
|
||||
"",
|
||||
"public set ${value}(v : ${string}) {",
|
||||
" this.${_} = v;",
|
||||
"public set ${1:value}(v : ${2:string}) {",
|
||||
" this.$3 = v;",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"description": "Property setter"
|
||||
},
|
||||
|
||||
"Throw Exception": {
|
||||
"prefix": "throw",
|
||||
"body": [
|
||||
"throw \"${_}\";",
|
||||
"throw \"$1\";",
|
||||
"$0"
|
||||
],
|
||||
"description": "Throw Exception"
|
||||
},
|
||||
|
||||
"For Loop": {
|
||||
"prefix": "for",
|
||||
"body": [
|
||||
"for (var ${index} = 0; ${index} < ${array}.length; ${index}++) {",
|
||||
"\tvar ${element} = ${array}[${index}];",
|
||||
"for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
|
||||
"\tvar ${3:element} = ${2:array}[${1:index}];",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -173,7 +158,7 @@
|
|||
"For-Each Loop using =>": {
|
||||
"prefix": "foreach =>",
|
||||
"body": [
|
||||
"${array}.forEach(${element} => {",
|
||||
"${1:array}.forEach(${2:element} => {",
|
||||
"\t$0",
|
||||
"});"
|
||||
],
|
||||
|
@ -182,9 +167,9 @@
|
|||
"For-In Loop": {
|
||||
"prefix": "forin",
|
||||
"body": [
|
||||
"for (var ${key} in ${object}) {",
|
||||
"\tif (${object}.hasOwnProperty(${key})) {",
|
||||
"\t\tvar ${element} = ${object}[${key}];",
|
||||
"for (var ${1:key} in ${2:object}) {",
|
||||
"\tif (${2:object}.hasOwnProperty(${1:key})) {",
|
||||
"\t\tvar ${3:element} = ${2:object}[${1:key}];",
|
||||
"\t\t$0",
|
||||
"\t}",
|
||||
"}"
|
||||
|
@ -194,7 +179,7 @@
|
|||
"Function Statement": {
|
||||
"prefix": "function",
|
||||
"body": [
|
||||
"function ${name}(${params}:${type}) {",
|
||||
"function ${1:name}(${2:params}:${3:type}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -203,7 +188,7 @@
|
|||
"If Statement": {
|
||||
"prefix": "if",
|
||||
"body": [
|
||||
"if (${condition}) {",
|
||||
"if (${1:condition}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -212,7 +197,7 @@
|
|||
"If-Else Statement": {
|
||||
"prefix": "ifelse",
|
||||
"body": [
|
||||
"if (${condition}) {",
|
||||
"if (${1:condition}) {",
|
||||
"\t$0",
|
||||
"} else {",
|
||||
"\t",
|
||||
|
@ -223,15 +208,15 @@
|
|||
"New Statement": {
|
||||
"prefix": "new",
|
||||
"body": [
|
||||
"var ${name} = new ${type}(${arguments});$0"
|
||||
"var ${1:name} = new ${2:type}(${2:arguments});$0"
|
||||
],
|
||||
"description": "New Statement"
|
||||
},
|
||||
"Switch Statement": {
|
||||
"prefix": "switch",
|
||||
"body": [
|
||||
"switch (${key}) {",
|
||||
"\tcase ${value}:",
|
||||
"switch (${1:key}) {",
|
||||
"\tcase ${2:value}:",
|
||||
"\t\t$0",
|
||||
"\t\tbreak;",
|
||||
"",
|
||||
|
@ -244,7 +229,7 @@
|
|||
"While Statement": {
|
||||
"prefix": "while",
|
||||
"body": [
|
||||
"while (${condition}) {",
|
||||
"while (${1:condition}) {",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
|
@ -255,16 +240,16 @@
|
|||
"body": [
|
||||
"do {",
|
||||
"\t$0",
|
||||
"} while (${condition});"
|
||||
"} while (${1:condition});"
|
||||
],
|
||||
"description": "Do-While Statement"
|
||||
},
|
||||
"Try-Catch Statement":{
|
||||
"Try-Catch Statement": {
|
||||
"prefix": "trycatch",
|
||||
"body": [
|
||||
"try {",
|
||||
"\t$0",
|
||||
"} catch (${error}) {",
|
||||
"} catch (${1:error}) {",
|
||||
"\t",
|
||||
"}"
|
||||
],
|
||||
|
@ -275,7 +260,7 @@
|
|||
"body": [
|
||||
"setTimeout(function() {",
|
||||
"\t$0",
|
||||
"}, ${timeout});"
|
||||
"}, ${1:timeout});"
|
||||
],
|
||||
"description": "Set Timeout Function"
|
||||
}
|
||||
|
|
|
@ -1,57 +1,57 @@
|
|||
{
|
||||
"For Next Loop": {
|
||||
"prefix": "for",
|
||||
"body": [
|
||||
"For ${index} As ${ObjectType} = ${lower} To ${Upper}",
|
||||
"For Next Loop": {
|
||||
"prefix": "for",
|
||||
"body": [
|
||||
"For ${1:index} As ${2:ObjectType} = ${3:lower} To ${4:Upper}",
|
||||
"\t$0",
|
||||
"Next ${index}"
|
||||
"Next ${1:index}"
|
||||
],
|
||||
"description": "For Next Loop"
|
||||
},
|
||||
"For Each...Next": {
|
||||
"prefix": "fore",
|
||||
"body": [
|
||||
"For Each ${Variable} As ${ObjectType} In ${Collection}",
|
||||
},
|
||||
"For Each...Next": {
|
||||
"prefix": "fore",
|
||||
"body": [
|
||||
"For Each ${1:Variable} As ${2:ObjectType} In ${3:Collection}",
|
||||
"\t$0",
|
||||
"Next"
|
||||
],
|
||||
"description": "For Each...Next"
|
||||
},
|
||||
"For i...Next i": {
|
||||
"prefix": "fori",
|
||||
"body": [
|
||||
"For i As ${Integer} = ${Lower} To ${Upper}",
|
||||
},
|
||||
"For i...Next i": {
|
||||
"prefix": "fori",
|
||||
"body": [
|
||||
"For i As ${1:Integer} = ${2:Lower} To ${3:Upper}",
|
||||
"\t$0",
|
||||
"Next i"
|
||||
],
|
||||
"description": "For i...Next i"
|
||||
},
|
||||
"For j...Next j": {
|
||||
"prefix": "forj",
|
||||
"body": [
|
||||
"For j As ${Integer} = ${Lower} To ${Upper}",
|
||||
},
|
||||
"For j...Next j": {
|
||||
"prefix": "forj",
|
||||
"body": [
|
||||
"For j As ${1:Integer} = ${2:Lower} To ${3:Upper}",
|
||||
"\t$0",
|
||||
"Next j"
|
||||
],
|
||||
"description": "For j...Next j"
|
||||
},
|
||||
"Public Function...": {
|
||||
"prefix": "pf",
|
||||
"body": [
|
||||
"Public Function ${FunctionName}(${ParameterList}) As ${ReturnType}",
|
||||
},
|
||||
"Public Function...": {
|
||||
"prefix": "pf",
|
||||
"body": [
|
||||
"Public Function ${1:FunctionName}(${2:ParameterList}) As ${3:ReturnType}",
|
||||
"\tTry",
|
||||
"\t\t$0",
|
||||
"\tCatch ex As Exception",
|
||||
"\tEnd Try",
|
||||
"\tReturn ${ReturnValue}",
|
||||
"\tReturn ${3:ReturnValue}",
|
||||
"End Function"
|
||||
],
|
||||
"description": "Public Function..."
|
||||
},
|
||||
"Public Sub ...": {
|
||||
"prefix": "ps",
|
||||
"body": [
|
||||
"Public Sub ${ProcedureName}(${ParameterList})",
|
||||
},
|
||||
"Public Sub ...": {
|
||||
"prefix": "ps",
|
||||
"body": [
|
||||
"Public Sub ${1:ProcedureName}(${2:ParameterList})",
|
||||
"\tTry",
|
||||
"\t\t$0",
|
||||
"\tCatch ex As Exception",
|
||||
|
@ -59,14 +59,14 @@
|
|||
"End Sub"
|
||||
],
|
||||
"description": "Public Sub ..."
|
||||
},
|
||||
"While ... End While": {
|
||||
"prefix": "while",
|
||||
"body": [
|
||||
"While ${Boolean}",
|
||||
},
|
||||
"While ... End While": {
|
||||
"prefix": "while",
|
||||
"body": [
|
||||
"While ${1:Boolean}",
|
||||
"\t$0",
|
||||
"End While"
|
||||
],
|
||||
"description": "While ... End While"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue