vscode/extensions/typescript/snippets/typescriptreact.json
Matt Bierner 5b1a6f4155 Use CompletionItem for JsDoc Comment auto fill (#21025)
Fixes #20990

Switches back to using a completion item provider for jsdoc auto complete.

The completion list will be automatically shown when you are in a potentially valid jsdoc completion context
2017-02-21 16:02:53 -08:00

259 lines
4.5 KiB
JSON

{
"Constructor": {
"prefix": "ctor",
"body": [
"/**",
" *",
" */",
"constructor() {",
"\tsuper();",
"\t$0",
"}"
],
"description": "Constructor"
},
"Class Definition": {
"prefix": "class",
"body": [
"/**",
" * ${1:name}",
" */",
"class ${1:name} {",
"\tconstructor(${2:parameters}) {",
"\t\t$0",
"\t}",
"}"
],
"description": "Class Definition"
},
"Public Method Definition": {
"prefix": "public method",
"body": [
"/**",
" * ${1:name}",
" */",
"public ${1:name}() {",
"\t$0",
"}"
],
"description": "Public Method Definition"
},
"Private Method Definition": {
"prefix": "private method",
"body": [
"private ${1:name}() {",
"\t$0",
"}"
],
"description": "Private Method Definition"
},
"Import external module.": {
"prefix": "import statement",
"body": [
"import ${1:name} = require('$0');"
],
"description": "Import external module."
},
"Property getter": {
"prefix": "get",
"body": [
"",
"public get ${1:value}() : ${2:string} {",
" ${3:return $0}",
"}",
""
],
"description": "Property getter"
},
"Log to the console": {
"prefix": "log",
"body": [
"console.log($1);",
"$0"
],
"description": "Log to the console"
},
"Define a full property": {
"prefix": "prop",
"body": [
"",
"private _${1:value} : ${2:string};",
"public get ${1:value}() : ${2:string} {",
" return this._${1:value};",
"}",
"public set ${1:value}(v : ${2:string}) {",
" this._${1:value} = v;",
"}",
""
],
"description": "Define a full property"
},
"Triple-slash reference": {
"prefix": "ref",
"body": [
"/// <reference path=\"$1\" />",
"$0"
],
"description": "Triple-slash reference"
},
"Return false": {
"prefix": "ret0",
"body": [
"return false;$0"
],
"description": "Return false"
},
"Return true": {
"prefix": "ret1",
"body": [
"return true;$0"
],
"description": "Return true"
},
"Return statement": {
"prefix": "ret",
"body": [
"return $1;$0"
],
"description": "Return statement"
},
"Property setter": {
"prefix": "set",
"body": [
"",
"public set ${1:value}(v : ${2:string}) {",
" this.$3 = v;",
"}",
""
],
"description": "Property setter"
},
"Throw Exception": {
"prefix": "throw",
"body": [
"throw \"$1\";",
"$0"
],
"description": "Throw Exception"
},
"For Loop": {
"prefix": "for",
"body": [
"for (var ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
"\tvar ${3:element} = ${2:array}[${1:index}];",
"\t$0",
"}"
],
"description": "For Loop"
},
"For-Each Loop using =>": {
"prefix": "foreach =>",
"body": [
"${1:array}.forEach(${2:element} => {",
"\t$0",
"});"
],
"description": "For-Each Loop using =>"
},
"For-In Loop": {
"prefix": "forin",
"body": [
"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}",
"}"
],
"description": "For-In Loop"
},
"Function Statement": {
"prefix": "function",
"body": [
"function ${1:name}(${2:params}:${3:type}) {",
"\t$0",
"}"
],
"description": "Function Statement"
},
"If Statement": {
"prefix": "if",
"body": [
"if (${1:condition}) {",
"\t$0",
"}"
],
"description": "If Statement"
},
"If-Else Statement": {
"prefix": "ifelse",
"body": [
"if (${1:condition}) {",
"\t$0",
"} else {",
"\t",
"}"
],
"description": "If-Else Statement"
},
"New Statement": {
"prefix": "new",
"body": [
"var ${1:name} = new ${2:type}(${2:arguments});$0"
],
"description": "New Statement"
},
"Switch Statement": {
"prefix": "switch",
"body": [
"switch (${1:key}) {",
"\tcase ${2:value}:",
"\t\t$0",
"\t\tbreak;",
"",
"\tdefault:",
"\t\tbreak;",
"}"
],
"description": "Switch Statement"
},
"While Statement": {
"prefix": "while",
"body": [
"while (${1:condition}) {",
"\t$0",
"}"
],
"description": "While Statement"
},
"Do-While Statement": {
"prefix": "dowhile",
"body": [
"do {",
"\t$0",
"} while (${1:condition});"
],
"description": "Do-While Statement"
},
"Try-Catch Statement": {
"prefix": "trycatch",
"body": [
"try {",
"\t$0",
"} catch (${1:error}) {",
"\t",
"}"
],
"description": "Try-Catch Statement"
},
"Set Timeout Function": {
"prefix": "settimeout",
"body": [
"setTimeout(function() {",
"\t$0",
"}, ${1:timeout});"
],
"description": "Set Timeout Function"
}
}