updates
This commit is contained in:
1 parent
dd4e5e0cc4
commit
bd932cf5e1
21 files changed
+7107
-55
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,266 @@
|
||||
{
|
||||
"autoescape": {
|
||||
"prefix": "autoescape",
|
||||
"body": "\r\n{% autoescape ${1:off} %}\r\n\t${2:$SELECTION}\r\n{% endautoescape %}\r\n",
|
||||
"description": "autoescape",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"block": {
|
||||
"prefix": "block",
|
||||
"body": "\r\n{% block ${1:blockname} %}\r\n\t${2:$SELECTION}\r\n{% endblock ${1:blockname} %}\r\n\t",
|
||||
"description": "block",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"blocktrans": {
|
||||
"prefix": "blocktrans",
|
||||
"body": "\r\n{% blocktrans %}\r\n\t${1:$SELECTION}\r\n{% endblocktrans %}\r\n",
|
||||
"description": "blocktrans",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"comment": {
|
||||
"prefix": "comment",
|
||||
"body": "\r\n{% comment %}\r\n\t${1:$SELECTION}\r\n{% endcomment %}\r\n\t",
|
||||
"description": "comment",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"var": {
|
||||
"prefix": "var",
|
||||
"body": "{{ ${1:$SELECTION} }}",
|
||||
"description": "context variable (var)",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"csrf": {
|
||||
"prefix": "csrf",
|
||||
"body": "{% csrf_token %}",
|
||||
"description": "csrf_token",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"cycle": {
|
||||
"prefix": "cycle",
|
||||
"body": "{% cycle $1 %}",
|
||||
"description": "cycle",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"debug": {
|
||||
"prefix": "debug",
|
||||
"body": "{% debug %}",
|
||||
"description": "debug",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"elif": {
|
||||
"prefix": "elif",
|
||||
"body": "{% elif %}",
|
||||
"description": "elif",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"else": {
|
||||
"prefix": "else",
|
||||
"body": "{% else %}",
|
||||
"description": "else",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"ext": {
|
||||
"prefix": "ext",
|
||||
"body": "{% extends '${1:$SELECTION}' %}",
|
||||
"description": "extends (ext)",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"extends": {
|
||||
"prefix": "extends",
|
||||
"body": "{% extends '${1:$SELECTION}' %}",
|
||||
"description": "extends",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"extrahead": {
|
||||
"prefix": "extrahead",
|
||||
"body": "\r\n{% block extrahead %}\r\n\t${1:$SELECTION}\r\n{% endblock extrahead %}\r\n\t",
|
||||
"description": "block extrahead",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"extrastyle": {
|
||||
"prefix": "extrastyle",
|
||||
"body": "\r\n{% block extrastyle %}\r\n\t${1:$SELECTION}\r\n{% endblock extrastyle %}\r\n\t",
|
||||
"description": "block extrastyle",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"filter": {
|
||||
"prefix": "filter",
|
||||
"body": "\r\n{% filter $1 %}\r\n\t${2:$SELECTION}\r\n{% endfilter %}\r\n",
|
||||
"description": "filter",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"firstof": {
|
||||
"prefix": "firstof",
|
||||
"body": "{% firstof $1 %}",
|
||||
"description": "firstof",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"for": {
|
||||
"prefix": "for",
|
||||
"body": "\r\n{% for $1 in $2 %}\r\n\t${3:$SELECTION}\r\n{% endfor %}\r\n\t",
|
||||
"description": "for",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"fore": {
|
||||
"prefix": "fore",
|
||||
"body": "\r\n{% for $1 in $2 %}\r\n\t$3\r\n{% empty %}\r\n\t$4\r\n{% endfor %}\r\n\t",
|
||||
"description": "for... empty...",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"iblock": {
|
||||
"prefix": "iblock",
|
||||
"body": "{% block ${1:blockname} %}${2:$SELECTION}{% endblock ${1:blockname} %}",
|
||||
"description": "inline block",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"if": {
|
||||
"prefix": "if",
|
||||
"body": "\r\n{% if $1 %}\r\n\t${2:$SELECTION}\r\n{% endif %}\r\n\t",
|
||||
"description": "if",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"ifchanged": {
|
||||
"prefix": "ifchanged",
|
||||
"body": "\r\n{% ifchanged $1 %}\r\n\t${2:$SELECTION}\r\n{% endifchanged %}\r\n\t",
|
||||
"description": "ifchanged",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"ife": {
|
||||
"prefix": "ife",
|
||||
"body": "\r\n{% if $1 %}\r\n\t$2\r\n{% else %}\r\n\t$3\r\n{% endif %}\r\n\t",
|
||||
"description": "if... else...",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"ifelse": {
|
||||
"prefix": "ifelse",
|
||||
"body": "\r\n{% if $1 %}\r\n\t$2\r\n{% else %}\r\n\t$3\r\n{% endif %}\r\n\t",
|
||||
"description": "if... else...",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"ifeq": {
|
||||
"prefix": "ifeq",
|
||||
"body": "\r\n{% ifequal $1 $2 %}\r\n\t${3:$SELECTION}\r\n{% endifequal %}\r\n\t",
|
||||
"description": "ifequal (ifeq)",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"ifequal": {
|
||||
"prefix": "ifequal",
|
||||
"body": "\r\n{% ifequal $1 $2 %} \r\n\t${3:$SELECTION}\r\n{% endifequal %}\r\n\t",
|
||||
"description": "ifequal",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"ifnotequal": {
|
||||
"prefix": "ifnotequal",
|
||||
"body": "\r\n{% ifnotequal $1 $2 %}\r\n\t${3:$SELECTION}\r\n{% endifnotequal %}\r\n\t",
|
||||
"description": "ifnotequal",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"inc": {
|
||||
"prefix": "inc",
|
||||
"body": "{% include ${1:'$2'} %}",
|
||||
"description": "include (inc)",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"include": {
|
||||
"prefix": "include",
|
||||
"body": "{% include ${1:'$2'} %}",
|
||||
"description": "include",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"load": {
|
||||
"prefix": "load",
|
||||
"body": "{% load $1 %}",
|
||||
"description": "load",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"media": {
|
||||
"prefix": "media",
|
||||
"body": "{{ MEDIA_URL }} ",
|
||||
"description": "media",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"now": {
|
||||
"prefix": "now",
|
||||
"body": "{% now '$1' %}",
|
||||
"description": "now",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"regroup": {
|
||||
"prefix": "regroup",
|
||||
"body": "{% regroup $1 by $2 as $3 %}",
|
||||
"description": "regroup",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"spaceless": {
|
||||
"prefix": "spaceless",
|
||||
"body": "\r\n{% spaceless %}\r\n\t${1:$SELECTION}\r\n{% endspaceless %}\r\n\t",
|
||||
"description": "spaceless",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"ssi": {
|
||||
"prefix": "ssi",
|
||||
"body": "{% ssi $1 ${2:parsed} %}",
|
||||
"description": "ssi",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"static": {
|
||||
"prefix": "static",
|
||||
"body": "{% static '${1:$SELECTION}' %}",
|
||||
"description": "static",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"staticu": {
|
||||
"prefix": "staticu",
|
||||
"body": "{{ STATIC_URL }} ",
|
||||
"description": "static URL",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"super": {
|
||||
"prefix": "super",
|
||||
"body": "{{ block.super }}",
|
||||
"description": "block.super",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"tag": {
|
||||
"prefix": "tag",
|
||||
"body": "{% $1 %}",
|
||||
"description": "tag braces",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"templatetag": {
|
||||
"prefix": "templatetag",
|
||||
"body": "{% templatetag $1 %}",
|
||||
"description": "templatetag",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"trans": {
|
||||
"prefix": "trans",
|
||||
"body": "{% trans '${1:$SELECTION}' %}",
|
||||
"description": "trans",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"url": {
|
||||
"prefix": "url",
|
||||
"body": "{% url $1 %}",
|
||||
"description": "url",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"verbatim": {
|
||||
"prefix": "verbatim",
|
||||
"body": "\r\n{% verbatim %}\r\n\t${1:$SELECTION}\r\n{% endverbatim %}\r\n\t",
|
||||
"description": "verbatim",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"widthratio": {
|
||||
"prefix": "widthratio",
|
||||
"body": "{% widthratio ${1:this_value} ${2:max_value} ${3:100} %}",
|
||||
"description": "widthratio",
|
||||
"scope": "text.html.django"
|
||||
},
|
||||
"with": {
|
||||
"prefix": "with",
|
||||
"body": "\r\n{% with $1 as $2 %}\r\n\t${3:$SELECTION}\r\n{% endwith %}\r\n\t",
|
||||
"description": "with",
|
||||
"scope": "text.html.django"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,349 @@
|
||||
{
|
||||
"addEventListener": {
|
||||
"prefix": "ae",
|
||||
"body": "${1:document}.addEventListener('${2:event}', ${3:ev} => {\n\t${0}\n})"
|
||||
},
|
||||
"removeEventListener": {
|
||||
"prefix": "rel",
|
||||
"body": "${1:document}.removeEventListener('${2:event}', ${3:listener})"
|
||||
},
|
||||
"getElementById": {
|
||||
"prefix": "gi",
|
||||
"body": "${1:document}.getElementById('${2:id}')"
|
||||
},
|
||||
"getElementsByClassName": {
|
||||
"prefix": "gc",
|
||||
"body": "Array.from(${1:document}.getElementsByClassName('${2:class}'))"
|
||||
},
|
||||
"getElementsByTagName": {
|
||||
"prefix": "gt",
|
||||
"body": "Array.from(${1:document}.getElementsByTagName('${2:tag}'))"
|
||||
},
|
||||
"querySelector": {
|
||||
"prefix": "qs",
|
||||
"body": "${1:document}.querySelector('${2:selector}')"
|
||||
},
|
||||
"querySelectorAll": {
|
||||
"prefix": "qsa",
|
||||
"body": "Array.from(${1:document}.querySelectorAll('${2:selector}'))"
|
||||
},
|
||||
"createDocumentFragment": {
|
||||
"prefix": "cdf",
|
||||
"body": "${1:document}.createDocumentFragment(${2:elem})"
|
||||
},
|
||||
"createElement": {
|
||||
"prefix": "cel",
|
||||
"body": "${1:document}.createElement(${2:elem})"
|
||||
},
|
||||
"await Promise.all": {
|
||||
"prefix": "apa",
|
||||
"body": "await Promise.all(${1:value})"
|
||||
},
|
||||
"await Promise.all with destructuring": {
|
||||
"prefix": "apad",
|
||||
"body": "const [${0}] = await Promise.all(${1:value})"
|
||||
},
|
||||
"await Promise.all map": {
|
||||
"prefix": "apm",
|
||||
"body": "await Promise.all(${1:array}.map(async (${2:value}) => {\n\t${0}\n}))"
|
||||
},
|
||||
"await sleep": {
|
||||
"prefix": "ast",
|
||||
"body": "await new Promise((r) => setTimeout(r, ${0}))"
|
||||
},
|
||||
"Node callback": {
|
||||
"prefix": "cb",
|
||||
"body": "function (err, ${1:value}) {\n\tif (err) throw err\n\t${0}\n}"
|
||||
},
|
||||
"process.env": {
|
||||
"prefix": "pe",
|
||||
"body": "process.env"
|
||||
},
|
||||
"Promise.all": {
|
||||
"prefix": "pa",
|
||||
"body": "Promise.all(${1:value})"
|
||||
},
|
||||
"Promise.resolve": {
|
||||
"prefix": "prs",
|
||||
"body": "Promise.resolve(${1:value})"
|
||||
},
|
||||
"Promise.reject": {
|
||||
"prefix": "prj",
|
||||
"body": "Promise.reject(${1:value})"
|
||||
},
|
||||
"Promise": {
|
||||
"prefix": "p",
|
||||
"body": "Promise"
|
||||
},
|
||||
"new Promise": {
|
||||
"prefix": "np",
|
||||
"body": "new Promise((resolve, reject) => {\n\t${0}\n})"
|
||||
},
|
||||
"Promise.then": {
|
||||
"prefix": "pt",
|
||||
"body": "${1:promise}.then((${2:value}) => {\n\t${0}\n})"
|
||||
},
|
||||
"Promise.catch": {
|
||||
"prefix": "pc",
|
||||
"body": "${1:promise}.catch(error => {\n\t${0}\n})"
|
||||
},
|
||||
"await": {
|
||||
"prefix": "a",
|
||||
"body": "await ${0}"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"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": {
|
||||
"prefix": "tc",
|
||||
"body": "try {\n\t${0}\n} catch (${1:err}) {\n\t\n}"
|
||||
},
|
||||
"Function Statement": {
|
||||
"prefix": "fun",
|
||||
"body": ["function ${1:name}(${2:params}) {", "\t$0", "}"],
|
||||
"description": "Function Statement"
|
||||
},
|
||||
"console.log a variable": {
|
||||
"prefix": "cv",
|
||||
"body": "console.log('${1}:', ${1})"
|
||||
},
|
||||
"Express GET": {
|
||||
"prefix": "eget",
|
||||
"body": ["router.get('${1:route}', ${2:unimplemented!})"]
|
||||
},
|
||||
|
||||
"Express POST": {
|
||||
"prefix": "epost",
|
||||
"body": ["router.post('${1:route}', ${2:unimplemented!})"]
|
||||
},
|
||||
|
||||
"Express DELETE": {
|
||||
"prefix": "edel",
|
||||
"body": ["router.delete('${1:route}', ${2:unimplemented!})"]
|
||||
},
|
||||
|
||||
"Express PUT": {
|
||||
"prefix": "eput",
|
||||
"body": ["router.put('${1:route}', ${2:unimplemented!})"]
|
||||
},
|
||||
"consoleAssert": {
|
||||
"prefix": "cas",
|
||||
"body": ["console.assert(${1:first}, ${2:second})"],
|
||||
"description": "If the specified expression is false, the message is written to the console along with a stack trace"
|
||||
},
|
||||
"consoleClear": {
|
||||
"prefix": "ccl",
|
||||
"body": ["console.clear()"],
|
||||
"description": "Clears the console"
|
||||
},
|
||||
"consoleCount": {
|
||||
"prefix": "cco",
|
||||
"body": ["console.count(${1:first})"],
|
||||
"description": "Writes the the number of times that count() has been invoked at the same line and with the same label"
|
||||
},
|
||||
"consoleDir": {
|
||||
"prefix": "cdi",
|
||||
"body": ["console.dir(${1:first})"],
|
||||
"description": "Prints a JavaScript representation of the specified object"
|
||||
},
|
||||
"consoleError": {
|
||||
"prefix": "cer",
|
||||
"body": ["console.error(${1:first})"],
|
||||
"description": "Displays a message in the console and also includes a stack trace from where the method was called"
|
||||
},
|
||||
"consoleGroup": {
|
||||
"prefix": "cgr",
|
||||
"body": ["console.group('${1:first}')"],
|
||||
"description": "Groups and indents all following output by an additional level, until console.groupEnd() is called."
|
||||
},
|
||||
"consoleGroupEnd": {
|
||||
"prefix": "cge",
|
||||
"body": ["console.groupEnd()"],
|
||||
"description": "Closes out the corresponding console.group()."
|
||||
},
|
||||
"consoleLog": {
|
||||
"prefix": "clg",
|
||||
"body": ["console.log(${1:first})"],
|
||||
"description": "Displays a message in the console"
|
||||
},
|
||||
"consoleTrace": {
|
||||
"prefix": "ctr",
|
||||
"body": ["console.trace(${1:first})"],
|
||||
"description": "Prints a stack trace from the point where the method was called"
|
||||
},
|
||||
"consoleLogObject": {
|
||||
"prefix": "clo",
|
||||
"body": ["console.log('${1:first}', ${1:first})"],
|
||||
"description": "Logs property with name."
|
||||
},
|
||||
"consoleLogJson": {
|
||||
"prefix": "clj",
|
||||
"body": ["console.log('${1:first}', JSON.stringify(${1:first}, null, 2))"],
|
||||
"description": "Logs stringified JSON property with name."
|
||||
},
|
||||
"consoleTime": {
|
||||
"prefix": "ctm",
|
||||
"body": ["console.time('${1:first}')"],
|
||||
"description": "Console time wrapper"
|
||||
},
|
||||
"consoleTimeEnd": {
|
||||
"prefix": "cte",
|
||||
"body": ["console.timeEnd('${1:first}')"],
|
||||
"description": "Console time end wrapper"
|
||||
},
|
||||
"consoleWarn": {
|
||||
"prefix": "cwa",
|
||||
"body": ["console.warn(${1:first})"],
|
||||
"description": "Displays a message in the console but also displays a yellow warning icon along with the logged message"
|
||||
},
|
||||
"consoleInfo": {
|
||||
"prefix": "cin",
|
||||
"body": ["console.info(${1:first})"],
|
||||
"description": "Displays a message in the console but also displays a blue information icon along with the logged message"
|
||||
},
|
||||
"consoleTable": {
|
||||
"prefix": "ctl",
|
||||
"body": ["console.table([${1:first}])"],
|
||||
"description": "Logs table to console"
|
||||
},
|
||||
"importAs": {
|
||||
"prefix": "ima",
|
||||
"body": ["import { ${2:second} as ${3:third} } from '${1:first}'"]
|
||||
},
|
||||
"importDestructing": {
|
||||
"prefix": "imd",
|
||||
"body": ["import { ${2:second} } from '${1:first}'"]
|
||||
},
|
||||
"importEverything": {
|
||||
"prefix": "ime",
|
||||
"body": ["import * as ${2:second} from '${1:first}'"]
|
||||
},
|
||||
"importNoModuleName": {
|
||||
"prefix": "imn",
|
||||
"body": ["import '${1:first}'"]
|
||||
},
|
||||
"import": {
|
||||
"prefix": "imp",
|
||||
"body": ["import ${2:second} from '${1:first}'"]
|
||||
},
|
||||
"destructingObject": {
|
||||
"prefix": "dob",
|
||||
"body": ["const {${2:second}} = ${1:first}"],
|
||||
"description": "Creates and assigns a local variable using object destructing"
|
||||
},
|
||||
"destructingArray": {
|
||||
"prefix": "dar",
|
||||
"body": ["const [${2:second}] = ${1:first}"],
|
||||
"description": "Creates and assigns a local variable using array destructing"
|
||||
},
|
||||
"forOf": {
|
||||
"prefix": "fof",
|
||||
"body": ["for(let ${1:first} of ${2:second}) {${3:third}}"],
|
||||
"description": "Iterating over property names of iterable objects"
|
||||
},
|
||||
"forIn": {
|
||||
"prefix": "fin",
|
||||
"body": ["for(let ${1:first} in ${2:second}) {${3:third}}"],
|
||||
"description": "Iterating over property values of iterable objects"
|
||||
},
|
||||
"try/catch/finally": {
|
||||
"prefix": "tcf",
|
||||
"body": "try {\n\t${0}\n} catch (${1:err}) {\n\t\n} finally {\n\t\n}"
|
||||
},
|
||||
"anonymousFunction": {
|
||||
"prefix": "anfn",
|
||||
"body": ["(${1:first}) => { ${2:second} }"],
|
||||
"description": "Creates an anonymous function"
|
||||
},
|
||||
"namedFunction": {
|
||||
"prefix": "nfn",
|
||||
"body": ["const ${1:first} = (${2:second}) => { ${3:third} }"],
|
||||
"description": "Creates a named function"
|
||||
},
|
||||
"forEach": {
|
||||
"prefix": "fre",
|
||||
"body": ["${1:first}.forEach(${2:second} => {${3:third}})"],
|
||||
"description": "Creates a forEach statement"
|
||||
},
|
||||
"map": {
|
||||
"prefix": "map",
|
||||
"body": "${1:iterable}.map((${2:item}) => {\n\t${0}\n})"
|
||||
},
|
||||
"reduce": {
|
||||
"prefix": "reduce",
|
||||
"body": "${1:iterable}.reduce((${2:previous}, ${3:current}) => {\n\t${0}\n}${4:, initial})"
|
||||
},
|
||||
"filter": {
|
||||
"prefix": "filter",
|
||||
"body": "${1:iterable}.filter((${2:item}) => {\n\t${0}\n})"
|
||||
},
|
||||
"find": {
|
||||
"prefix": "find",
|
||||
"body": "${1:iterable}.find((${2:item}) => {\n\t${0}\n})"
|
||||
},
|
||||
"every": {
|
||||
"prefix": "every",
|
||||
"body": "${1:iterable}.every((${2:item}) => {\n\t${0}\n})"
|
||||
},
|
||||
"some": {
|
||||
"prefix": "some",
|
||||
"body": "${1:iterable}.some((${2:item}) => {\n\t${0}\n})"
|
||||
},
|
||||
"appendChild": {
|
||||
"prefix": "heac",
|
||||
"body": "${1:el}.appendChild(${2:elem})"
|
||||
},
|
||||
"removeChild": {
|
||||
"prefix": "herc",
|
||||
"body": "${1:el}.removeChild(${2:elem})"
|
||||
},
|
||||
"exportDefault": {
|
||||
"prefix": "exp",
|
||||
"body": ["export default ${1:first}"]
|
||||
},
|
||||
"exportDestructing": {
|
||||
"prefix": "exd",
|
||||
"body": ["export { ${2:second} } from '${1:first}'"]
|
||||
},
|
||||
"exportAs": {
|
||||
"prefix": "exa",
|
||||
"body": ["export { ${2:second} as ${3:third} } from '${1:first}'"]
|
||||
},
|
||||
"exportNamedFunction": {
|
||||
"prefix": "enf",
|
||||
"body": ["export const ${1:first} = (${2:second}) => {${3:third}}"],
|
||||
"description": "Export named function"
|
||||
},
|
||||
"exportDefaultFunction": {
|
||||
"prefix": "edf",
|
||||
"body": ["export default (${1:first}) => {${2:second}}"],
|
||||
"description": "Export default function"
|
||||
},
|
||||
"exportDefaultNamedFunction": {
|
||||
"prefix": "ednf",
|
||||
"body": ["export default function ${1:first}(${2:second}) {${3:third}}"],
|
||||
"description": "Export default named function"
|
||||
},
|
||||
"method": {
|
||||
"prefix": "met",
|
||||
"body": ["${1:first} = (${2:second}) => {${3:third}}"],
|
||||
"description": "Creates a method inside a class"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,734 @@
|
||||
{
|
||||
"exportType": {
|
||||
"body": ["export type ${1:first} = {${2:second}}"],
|
||||
"prefix": "exptp"
|
||||
},
|
||||
"exportInterface": {
|
||||
"prefix": "expint",
|
||||
"body": ["export interface ${1:first} {${2:second}}"]
|
||||
},
|
||||
"reactArrowFunctionComponent": {
|
||||
"prefix": "rafc",
|
||||
"body": [
|
||||
"export const ${1:${TM_FILENAME_BASE}} = () => {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"description": "Creates a React Arrow Function Component with ES7 module system"
|
||||
},
|
||||
"reactArrowFunctionComponentWithPropTypes": {
|
||||
"prefix": "rafcp",
|
||||
"body": [
|
||||
"import PropTypes from 'prop-types'",
|
||||
"",
|
||||
"const ${1:${TM_FILENAME_BASE}} = props => {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
"}",
|
||||
"",
|
||||
"${1:${TM_FILENAME_BASE}}.propTypes = {}",
|
||||
"",
|
||||
"export default ${1:${TM_FILENAME_BASE}}"
|
||||
],
|
||||
"description": "Creates a React Arrow Function Component with ES7 module system with PropTypes"
|
||||
},
|
||||
"reactArrowFunctionExportComponent": {
|
||||
"prefix": "rafce",
|
||||
"body": [
|
||||
"const ${1:${TM_FILENAME_BASE}} = () => {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
"}",
|
||||
"",
|
||||
"export default ${1:${TM_FILENAME_BASE}}"
|
||||
],
|
||||
"description": "Creates a React Arrow Function Component with ES7 module system"
|
||||
},
|
||||
"reactClassComponent": {
|
||||
"prefix": "rcc",
|
||||
"body": [
|
||||
"import { Component } from 'react'",
|
||||
"",
|
||||
"export default class ${1:${TM_FILENAME_BASE}} extends Component {",
|
||||
" render() {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"description": "Creates a React component class with ES7 module system"
|
||||
},
|
||||
"reactClassComponentPropTypes": {
|
||||
"prefix": "rccp",
|
||||
"body": [
|
||||
"import PropTypes from 'prop-types'",
|
||||
"import { Component } from 'react'",
|
||||
"",
|
||||
"export default class ${1:${TM_FILENAME_BASE}} extends Component {",
|
||||
" static propTypes = {${2:second}: ${3:third}}",
|
||||
"",
|
||||
" render() {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"description": "Creates a React component class with PropTypes and ES7 module system"
|
||||
},
|
||||
"reactClassComponentRedux": {
|
||||
"prefix": "rcredux",
|
||||
"body": [
|
||||
"import { Component } from 'react'",
|
||||
"import { connect } from 'react-redux'",
|
||||
"",
|
||||
"export class ${1:${TM_FILENAME_BASE}} extends Component {",
|
||||
" render() {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"const mapStateToProps = (state) => ({})",
|
||||
"",
|
||||
"const mapDispatchToProps = {}",
|
||||
"",
|
||||
"export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})"
|
||||
],
|
||||
"description": "Creates a React component class with connected redux and ES7 module system"
|
||||
},
|
||||
"reactClassComponentReduxPropTypes": {
|
||||
"prefix": "rcreduxp",
|
||||
"body": [
|
||||
"import PropTypes from 'prop-types'",
|
||||
"import { Component } from 'react'",
|
||||
"import { connect } from 'react-redux'",
|
||||
"",
|
||||
"export class ${1:${TM_FILENAME_BASE}} extends Component {",
|
||||
" static propTypes = {",
|
||||
" ${2:second}: ${3:third}",
|
||||
" }",
|
||||
"",
|
||||
" render() {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"const mapStateToProps = (state) => ({})",
|
||||
"",
|
||||
"const mapDispatchToProps = {}",
|
||||
"",
|
||||
"export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})"
|
||||
],
|
||||
"description": "Creates a React component class with PropTypes with connected redux and ES7 module system"
|
||||
},
|
||||
"reactClassExportComponent": {
|
||||
"prefix": "rce",
|
||||
"body": [
|
||||
"import { Component } from 'react'",
|
||||
"",
|
||||
"export class ${1:${TM_FILENAME_BASE}} extends Component {",
|
||||
" render() {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"export default ${1:${TM_FILENAME_BASE}}"
|
||||
],
|
||||
"description": "Creates a React component class with ES7 module system"
|
||||
},
|
||||
"reactClassExportComponentWithPropTypes": {
|
||||
"prefix": "rcep",
|
||||
"body": [
|
||||
"import PropTypes from 'prop-types'",
|
||||
"import { Component } from 'react'",
|
||||
"",
|
||||
"export class ${1:${TM_FILENAME_BASE}} extends Component {",
|
||||
" static propTypes = {}",
|
||||
"",
|
||||
" render() {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"export default ${1:${TM_FILENAME_BASE}}"
|
||||
],
|
||||
"description": "Creates a React component class with ES7 module system"
|
||||
},
|
||||
"reactClassExportPureComponent": {
|
||||
"prefix": "rpce",
|
||||
"body": [
|
||||
"import { PureComponent } from 'react'",
|
||||
"",
|
||||
"export class ${1:${TM_FILENAME_BASE}} extends PureComponent {",
|
||||
" render() {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
"export default ${1:${TM_FILENAME_BASE}}"
|
||||
],
|
||||
"description": "Creates a React pure component class with ES7 module system export"
|
||||
},
|
||||
"reactClassPureComponent": {
|
||||
"prefix": "rpc",
|
||||
"body": [
|
||||
"import { PureComponent } from 'react'",
|
||||
"",
|
||||
"export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {",
|
||||
" render() {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"description": "Creates a React pure component class with ES7 module system"
|
||||
},
|
||||
"reactClassPureComponentWithPropTypes": {
|
||||
"prefix": "rpcp",
|
||||
"body": [
|
||||
"import PropTypes from 'prop-types'",
|
||||
"import { PureComponent } from 'react'",
|
||||
"",
|
||||
"export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {",
|
||||
" static propTypes = {}",
|
||||
"",
|
||||
" render() {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
" }",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"description": "Creates a React component class with ES7 module system"
|
||||
},
|
||||
"reactFunctionMemoComponent": {
|
||||
"prefix": "rmc",
|
||||
"body": [
|
||||
"import { memo } from 'react'",
|
||||
"",
|
||||
"const ${1:${TM_FILENAME_BASE}} = memo(() => {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
"})",
|
||||
"",
|
||||
"export default ${1:${TM_FILENAME_BASE}}"
|
||||
],
|
||||
"description": "Creates a React Memo Function Component with ES7 module system"
|
||||
},
|
||||
"reactFunctionMemoComponentWithPropTypes": {
|
||||
"prefix": "rmcp",
|
||||
"body": [
|
||||
"import PropTypes from 'prop-types'",
|
||||
"import { memo } from 'react'",
|
||||
"",
|
||||
"const ${1:${TM_FILENAME_BASE}} = memo((props) => {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
"})",
|
||||
"",
|
||||
"${1:${TM_FILENAME_BASE}}.propTypes = {}",
|
||||
"",
|
||||
"export default ${1:${TM_FILENAME_BASE}}"
|
||||
],
|
||||
"description": "Creates a React Memo Function Component with ES7 module system with PropTypes"
|
||||
},
|
||||
"reactFunctionalComponent": {
|
||||
"prefix": "rfc",
|
||||
"body": [
|
||||
"import React from 'react'",
|
||||
"",
|
||||
"export default function ${1:${TM_FILENAME_BASE}}() {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
"}",
|
||||
""
|
||||
],
|
||||
"description": "Creates a React Functional Component with ES7 module system"
|
||||
},
|
||||
"reactFunctionalComponentRedux": {
|
||||
"prefix": "rfcredux",
|
||||
"body": [
|
||||
"import { connect } from 'react-redux'",
|
||||
"",
|
||||
"export const ${1:${TM_FILENAME_BASE}} = (props) => {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
"}",
|
||||
"",
|
||||
"const mapStateToProps = (state) => ({})",
|
||||
"",
|
||||
"const mapDispatchToProps = {}",
|
||||
"",
|
||||
"export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})"
|
||||
],
|
||||
"description": "Creates a React functional component with connected redux and ES7 module system"
|
||||
},
|
||||
"reactFunctionalComponentReduxPropTypes": {
|
||||
"prefix": "rfcreduxp",
|
||||
"body": [
|
||||
"import PropTypes from 'prop-types'",
|
||||
"import { connect } from 'react-redux'",
|
||||
"",
|
||||
"export const ${1:${TM_FILENAME_BASE}} = (props) => {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
"}",
|
||||
"",
|
||||
"${1:${TM_FILENAME_BASE}}.propTypes = {",
|
||||
" ${2:second}: PropTypes.${3:third}",
|
||||
"}",
|
||||
"",
|
||||
"const mapStateToProps = (state) => ({})",
|
||||
"",
|
||||
"const mapDispatchToProps = {}",
|
||||
"",
|
||||
"export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})"
|
||||
],
|
||||
"description": "DEPRECATED: Creates a React functional component with PropTypes with connected redux and ES7 module system"
|
||||
},
|
||||
"reactFunctionalComponentWithPropTypes": {
|
||||
"prefix": "rfcp",
|
||||
"body": [
|
||||
"import PropTypes from 'prop-types'",
|
||||
"",
|
||||
"function ${1:${TM_FILENAME_BASE}}(props) {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
"}",
|
||||
"",
|
||||
"${1:${TM_FILENAME_BASE}}.propTypes = {}",
|
||||
"",
|
||||
"export default ${1:${TM_FILENAME_BASE}}",
|
||||
""
|
||||
],
|
||||
"description": "Creates a React Functional Component with ES7 module system with PropTypes"
|
||||
},
|
||||
"reactFunctionalExportComponent": {
|
||||
"prefix": "rfce",
|
||||
"body": [
|
||||
"function ${1:${TM_FILENAME_BASE}}() {",
|
||||
" return (",
|
||||
" <div>${1:first}</div>",
|
||||
" )",
|
||||
"}",
|
||||
"",
|
||||
"export default ${1:${TM_FILENAME_BASE}}"
|
||||
],
|
||||
"description": "Creates a React Functional Component with ES7 module system"
|
||||
},
|
||||
"useCallback": {
|
||||
"prefix": "useCallbackSnippet",
|
||||
"body": [
|
||||
"useCallback(",
|
||||
" () => {",
|
||||
" ${1:first}",
|
||||
" },",
|
||||
" [${2:second}],",
|
||||
")",
|
||||
""
|
||||
]
|
||||
},
|
||||
"useContext": {
|
||||
"prefix": "useContextSnippet",
|
||||
"body": ["const ${1:first} = useContext(${2:second})"]
|
||||
},
|
||||
"useEffect": {
|
||||
"prefix": "useEffectSnippet",
|
||||
"body": [
|
||||
"useEffect(() => {",
|
||||
" ${1:first}",
|
||||
"",
|
||||
" return () => {",
|
||||
" ${2:second}",
|
||||
" }",
|
||||
"}, [${3:third}])",
|
||||
""
|
||||
]
|
||||
},
|
||||
"useImperativeHandle": {
|
||||
"prefix": "useImperativeHandleSnippet",
|
||||
"body": [
|
||||
"useImperativeHandle(",
|
||||
" ${1:first},",
|
||||
" () => {",
|
||||
" ${2:second}",
|
||||
" },",
|
||||
" [${3:third}],",
|
||||
")"
|
||||
]
|
||||
},
|
||||
"useLayoutEffect": {
|
||||
"prefix": "useLayoutEffectSnippet",
|
||||
"body": [
|
||||
"useLayoutEffect(() => {",
|
||||
" ${1:first}",
|
||||
"",
|
||||
" return () => {",
|
||||
" ${2:second}",
|
||||
" };",
|
||||
"}, [${3:third}])"
|
||||
]
|
||||
},
|
||||
"useMemo": {
|
||||
"prefix": "useMemoSnippet",
|
||||
"body": ["useMemo(() => ${1:first}, [${2:second}])"]
|
||||
},
|
||||
"useReducer": {
|
||||
"prefix": "useReducerSnippet",
|
||||
"body": [
|
||||
"const [state, dispatch] = useReducer(${1:first}, ${2:second}, ${3:third})"
|
||||
]
|
||||
},
|
||||
"useRef": {
|
||||
"prefix": "useRefSnippet",
|
||||
"body": ["const ${1:first} = useRef(${2:second})"]
|
||||
},
|
||||
"useState": {
|
||||
"prefix": "useStateSnippet",
|
||||
"body": [
|
||||
"const [${1:first}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:second})"
|
||||
]
|
||||
},
|
||||
"importPropTypes": {
|
||||
"prefix": "impt",
|
||||
"body": ["import PropTypes from 'prop-types'"]
|
||||
},
|
||||
"importReact": {
|
||||
"prefix": "imr",
|
||||
"body": ["import React from 'react'"]
|
||||
},
|
||||
"importReactDom": {
|
||||
"prefix": "imrd",
|
||||
"body": ["import ReactDOM from 'react-dom'"]
|
||||
},
|
||||
"importReactWithComponent": {
|
||||
"prefix": "imrc",
|
||||
"body": ["import React, { Component } from 'react'"]
|
||||
},
|
||||
"importReactWithComponentAndPropTypes": {
|
||||
"prefix": "imrcp",
|
||||
"body": [
|
||||
"import React, { Component } from 'react'",
|
||||
"import PropTypes from 'prop-types'",
|
||||
""
|
||||
]
|
||||
},
|
||||
"importReactWithMemo": {
|
||||
"prefix": "imrm",
|
||||
"body": ["import React, { memo } from 'react'"]
|
||||
},
|
||||
"importReactWithMemoAndPropTypes": {
|
||||
"prefix": "imrmp",
|
||||
"body": [
|
||||
"import React, { memo } from 'react'",
|
||||
"import PropTypes from 'prop-types'",
|
||||
""
|
||||
]
|
||||
},
|
||||
"importReactWithPureComponent": {
|
||||
"prefix": "imrpc",
|
||||
"body": ["import React, { PureComponent } from 'react'"]
|
||||
},
|
||||
"importReactWithPureComponentAndPropTypes": {
|
||||
"prefix": "imrpcp",
|
||||
"body": [
|
||||
"import React, { PureComponent } from 'react'",
|
||||
"import PropTypes from 'prop-types'",
|
||||
""
|
||||
]
|
||||
},
|
||||
"importRouterLink": {
|
||||
"prefix": "imbrl",
|
||||
"body": ["import { Link } from 'react-router-dom'"]
|
||||
},
|
||||
"importRouterNavLink": {
|
||||
"prefix": "imbrnl",
|
||||
"body": ["import { NavLink } from 'react-router-dom'"]
|
||||
},
|
||||
"importRouterSetup": {
|
||||
"prefix": "imbrc",
|
||||
"body": [
|
||||
"import { Route, Switch, NavLink, Link } from 'react-router-dom'"
|
||||
]
|
||||
},
|
||||
"importRouterSwitch": {
|
||||
"prefix": "imbrs",
|
||||
"body": ["import { Switch } from 'react-router-dom'"]
|
||||
},
|
||||
"propTypeArray": {
|
||||
"prefix": "pta",
|
||||
"body": ["PropTypes.array"],
|
||||
"description": "Array prop type"
|
||||
},
|
||||
"propTypeArrayRequired": {
|
||||
"prefix": "ptar",
|
||||
"body": ["PropTypes.array.isRequired"],
|
||||
"description": "Array prop type required"
|
||||
},
|
||||
"propTypeBool": {
|
||||
"prefix": "ptb",
|
||||
"body": ["PropTypes.bool"],
|
||||
"description": "Bool prop type"
|
||||
},
|
||||
"propTypeBoolRequired": {
|
||||
"prefix": "ptbr",
|
||||
"body": ["PropTypes.bool.isRequired"],
|
||||
"description": "Bool prop type required"
|
||||
},
|
||||
"propTypeFunc": {
|
||||
"prefix": "ptf",
|
||||
"body": ["PropTypes.func"],
|
||||
"description": "Func prop type"
|
||||
},
|
||||
"propTypeFuncRequired": {
|
||||
"prefix": "ptfr",
|
||||
"body": ["PropTypes.func.isRequired"],
|
||||
"description": "Func prop type required"
|
||||
},
|
||||
"propTypeNumber": {
|
||||
"prefix": "ptn",
|
||||
"body": ["PropTypes.number"],
|
||||
"description": "Number prop type"
|
||||
},
|
||||
"propTypeNumberRequired": {
|
||||
"prefix": "ptnr",
|
||||
"body": ["PropTypes.number.isRequired"],
|
||||
"description": "Number prop type required"
|
||||
},
|
||||
"propTypeObject": {
|
||||
"prefix": "pto",
|
||||
"body": ["PropTypes.object"],
|
||||
"description": "Object prop type"
|
||||
},
|
||||
"propTypeObjectRequired": {
|
||||
"prefix": "ptor",
|
||||
"body": ["PropTypes.object.isRequired"],
|
||||
"description": "Object prop type required"
|
||||
},
|
||||
"propTypeString": {
|
||||
"prefix": "pts",
|
||||
"body": ["PropTypes.string"],
|
||||
"description": "String prop type"
|
||||
},
|
||||
"propTypeStringRequired": {
|
||||
"prefix": "ptsr",
|
||||
"body": ["PropTypes.string.isRequired"],
|
||||
"description": "String prop type required"
|
||||
},
|
||||
"propTypeNode": {
|
||||
"prefix": "ptnd",
|
||||
"body": ["PropTypes.node"],
|
||||
"description": "Anything that can be rendered: numbers, strings, elements or an array"
|
||||
},
|
||||
"propTypeNodeRequired": {
|
||||
"prefix": "ptndr",
|
||||
"body": ["PropTypes.node.isRequired"],
|
||||
"description": "Anything that can be rendered: numbers, strings, elements or an array required"
|
||||
},
|
||||
"propTypeElement": {
|
||||
"prefix": "ptel",
|
||||
"body": ["PropTypes.element"],
|
||||
"description": "React element prop type"
|
||||
},
|
||||
"propTypeElementRequired": {
|
||||
"prefix": "ptelr",
|
||||
"body": ["PropTypes.element.isRequired"],
|
||||
"description": "React element prop type required"
|
||||
},
|
||||
"propTypeInstanceOf": {
|
||||
"prefix": "pti",
|
||||
"body": ["PropTypes.instanceOf($0)"],
|
||||
"description": "Is an instance of a class prop type"
|
||||
},
|
||||
"propTypeInstanceOfRequired": {
|
||||
"prefix": "ptir",
|
||||
"body": ["PropTypes.instanceOf($0).isRequired"],
|
||||
"description": "Is an instance of a class prop type required"
|
||||
},
|
||||
"propTypeEnum": {
|
||||
"prefix": "pte",
|
||||
"body": ["PropTypes.oneOf(['$0'])"],
|
||||
"description": "Prop type limited to specific values by treating it as an enum"
|
||||
},
|
||||
"propTypeEnumRequired": {
|
||||
"prefix": "pter",
|
||||
"body": ["PropTypes.oneOf(['$0']).isRequired"],
|
||||
"description": "Prop type limited to specific values by treating it as an enum required"
|
||||
},
|
||||
"propTypeOneOfType": {
|
||||
"prefix": "ptet",
|
||||
"body": ["PropTypes.oneOfType([", " $0", "])"],
|
||||
"description": "An object that could be one of many types"
|
||||
},
|
||||
"propTypeOneOfTypeRequired": {
|
||||
"prefix": "ptetr",
|
||||
"body": ["PropTypes.oneOfType([", " $0", "]).isRequired"],
|
||||
"description": "An object that could be one of many types required"
|
||||
},
|
||||
"propTypeArrayOf": {
|
||||
"prefix": "ptao",
|
||||
"body": ["PropTypes.arrayOf($0)"],
|
||||
"description": "An array of a certain type"
|
||||
},
|
||||
"propTypeArrayOfRequired": {
|
||||
"prefix": "ptaor",
|
||||
"body": ["PropTypes.arrayOf($0).isRequired"],
|
||||
"description": "An array of a certain type required"
|
||||
},
|
||||
"propTypeObjectOf": {
|
||||
"prefix": "ptoo",
|
||||
"body": ["PropTypes.objectOf($0)"],
|
||||
"description": "An object with property values of a certain type"
|
||||
},
|
||||
"propTypeObjectOfRequired": {
|
||||
"prefix": "ptoor",
|
||||
"body": ["PropTypes.objectOf($0).isRequired"],
|
||||
"description": "An object with property values of a certain type required"
|
||||
},
|
||||
"propTypeShape": {
|
||||
"prefix": "ptsh",
|
||||
"body": ["PropTypes.shape({", " $0", "})"],
|
||||
"description": "An object taking on a particular shape"
|
||||
},
|
||||
"propTypeShapeRequired": {
|
||||
"prefix": "ptshr",
|
||||
"body": ["PropTypes.shape({", " $0", "}).isRequired"],
|
||||
"description": "An object taking on a particular shape required"
|
||||
},
|
||||
"propTypeExact": {
|
||||
"prefix": "ptex",
|
||||
"body": ["PropTypes.exact({", " $0", "})"],
|
||||
"description": "An object with warnings on extra properties"
|
||||
},
|
||||
"propTypeExactRequired": {
|
||||
"prefix": "ptexr",
|
||||
"body": ["PropTypes.exact({", " $0", "}).isRequired"],
|
||||
"description": "An object with warnings on extra properties required"
|
||||
},
|
||||
"propTypeAny": {
|
||||
"prefix": "ptany",
|
||||
"body": ["PropTypes.any"],
|
||||
"description": "Any prop type"
|
||||
},
|
||||
"destructProps": {
|
||||
"prefix": "cp",
|
||||
"body": ["const { ${1:first} } = this.props"],
|
||||
"description": "Creates and assigns a local variable using props destructing"
|
||||
},
|
||||
"destructState": {
|
||||
"prefix": "cs",
|
||||
"body": ["const { ${1:first} } = this.state"],
|
||||
"description": "Creates and assigns a local variable using state destructing"
|
||||
},
|
||||
"classConstructor": {
|
||||
"prefix": "rconst",
|
||||
"body": [
|
||||
"constructor(props) {",
|
||||
" super(props)",
|
||||
"",
|
||||
" this.state = {",
|
||||
" ${1:first}",
|
||||
" }",
|
||||
"}"
|
||||
],
|
||||
"description": "Adds a default constructor for it('', () => {})the class that contains props as arguments"
|
||||
},
|
||||
"emptyState": {
|
||||
"prefix": "est",
|
||||
"body": ["state = { ${1:first} }"],
|
||||
"description": "Creates empty state object. To be used in a constructor."
|
||||
},
|
||||
"componentDidMount": {
|
||||
"prefix": "cdm",
|
||||
"body": ["componentDidMount() { ${1:first} }"],
|
||||
"description": "Invoked once, only on the client (not on the server), immediately after the initial rendering occurs."
|
||||
},
|
||||
"shouldComponentUpdate": {
|
||||
"prefix": "scu",
|
||||
"body": ["shouldComponentUpdate(nextProps, nextState) { ${1:first} }"],
|
||||
"description": "Invoked before rendering when new props or state are being received. "
|
||||
},
|
||||
"componentDidUpdate": {
|
||||
"prefix": "cdup",
|
||||
"body": ["componentDidUpdate(prevProps, prevState) { ${1:first}} "],
|
||||
"description": "Invoked immediately after the component's updates are flushed to the DOM."
|
||||
},
|
||||
"componentWillUnmount": {
|
||||
"prefix": "cwun",
|
||||
"body": ["componentWillUnmount() {${1:first} }"],
|
||||
"description": "Invoked immediately before a component is unmounted from the DOM."
|
||||
},
|
||||
"getDerivedStateFromProps": {
|
||||
"prefix": "gdsfp",
|
||||
"body": ["static getDerivedStateFromProps(props, state) {${1:first}}"],
|
||||
"description": "Invoked right before calling the render method, both on the initial mount and on subsequent updates."
|
||||
},
|
||||
"getSnapshotBeforeUpdate": {
|
||||
"prefix": "gsbu",
|
||||
"body": [
|
||||
"getSnapshotBeforeUpdate = (prevProps, prevState) => {${1:first}}"
|
||||
],
|
||||
"description": "Called right before mutations are made (e.g. before the DOM is updated)"
|
||||
},
|
||||
"createContext": {
|
||||
"prefix": "rcontext",
|
||||
"body": ["const ${1:first} = React.createContext()"],
|
||||
"description": "Create React context"
|
||||
},
|
||||
"createRef": {
|
||||
"prefix": "cref",
|
||||
"body": ["this.${1:first}Ref = React.createRef()"],
|
||||
"description": "Create ref statement used inside constructor"
|
||||
},
|
||||
"componentSetStateObject": {
|
||||
"prefix": "sst",
|
||||
"body": ["this.setState({${1:first}})"],
|
||||
"description": "Performs a shallow merge of nextState into current state"
|
||||
},
|
||||
"componentSetStateFunc": {
|
||||
"prefix": "ssf",
|
||||
"body": ["this.setState((state, props) => { return { ${1:first} }})"],
|
||||
"description": "Performs a shallow merge of nextState into current state"
|
||||
},
|
||||
"componentProps": {
|
||||
"prefix": "props",
|
||||
"body": ["this.props.${1:first}"],
|
||||
"description": "Access component's props"
|
||||
},
|
||||
"componentState": {
|
||||
"prefix": "state",
|
||||
"body": ["this.state.${1:first}"]
|
||||
},
|
||||
"bindThis": {
|
||||
"prefix": "bnd",
|
||||
"body": ["this.${1:first} = this.${1:first}.bind(this)"],
|
||||
"description": "Binds this to a method"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"require": {
|
||||
"prefix": "req",
|
||||
"body": ["require(\"${1:module}\")"],
|
||||
"description": "Require module"
|
||||
},
|
||||
"return": {
|
||||
"prefix": "rt",
|
||||
"body": ["return $0"],
|
||||
"description": "return value"
|
||||
},
|
||||
"assigment": {
|
||||
"prefix": "ll",
|
||||
"body": ["local ${1:varName} = ${0:value}"],
|
||||
"description": "create a variable"
|
||||
},
|
||||
"local": {
|
||||
"prefix": "l",
|
||||
"body": ["local ${0}"],
|
||||
"description": "create a variable"
|
||||
},
|
||||
"locreq": {
|
||||
"prefix": "lreq",
|
||||
"body": ["local ${1:var} = require(\"${2:module}\")"],
|
||||
"description": "Require module as a variable"
|
||||
},
|
||||
"class": {
|
||||
"prefix": "cl",
|
||||
"body": [
|
||||
"${1:className} = {}\n",
|
||||
"$1.${2:new} = function($3)",
|
||||
"\tlocal ${4:varName} = ${5:value}\n",
|
||||
"\t${6: --code}\n",
|
||||
"\treturn $4",
|
||||
"end"
|
||||
],
|
||||
"description": "Create a class"
|
||||
},
|
||||
"if": {
|
||||
"prefix": "if",
|
||||
"body": ["if ${1:true} then", "\t$0", "end"]
|
||||
},
|
||||
"elseif": {
|
||||
"prefix": "elseif",
|
||||
"body": ["elseif ${1:true} then", "\t$0"]
|
||||
},
|
||||
"for": {
|
||||
"prefix": "for",
|
||||
"body": ["for ${1:i}=${2:1},${3:10} do", "\t$0", "end"],
|
||||
"description": "for loop range"
|
||||
},
|
||||
"foreach": {
|
||||
"prefix": "foreach",
|
||||
"body": ["for i, ${1:x} in pairs(${2:table}) do", "\t$0", "end"]
|
||||
},
|
||||
"forline": {
|
||||
"prefix": "forline",
|
||||
"body": [
|
||||
"f = io.open(${1:\"${2:filename}\"}, \"${3:r}\")\n",
|
||||
"while true do",
|
||||
"\tline = f:read()",
|
||||
"\tif line == nil then break end\n",
|
||||
"\t${0:-- code}",
|
||||
"end"
|
||||
],
|
||||
"description": "read file line by line"
|
||||
},
|
||||
"function": {
|
||||
"prefix": "fu",
|
||||
"body": ["function ${1:name}($2)", "\t${0:-- code}", "end"]
|
||||
},
|
||||
"inline-function": {
|
||||
"prefix": "f=",
|
||||
"body": ["local ${1:name} = function($2)", "\t${0:-- code}", "end"]
|
||||
},
|
||||
"print": {
|
||||
"prefix": "p",
|
||||
"body": ["print(${0})"]
|
||||
},
|
||||
"self": {
|
||||
"prefix": "self:",
|
||||
"body": ["function self:${1:methodName}($2)", "\t$0", "end"]
|
||||
},
|
||||
"while": {
|
||||
"prefix": "while",
|
||||
"body": ["while ${1:true} do", "\t$0", "end"]
|
||||
},
|
||||
"pcall": {
|
||||
"prefix": "pca",
|
||||
"body": ["pcall(${1:function})"],
|
||||
"description": "Protect call a function"
|
||||
},
|
||||
"locpcall": {
|
||||
"prefix": "lpca",
|
||||
"body": ["local ${1:status}, ${2:err_or_value} = pcall(${3:function})"],
|
||||
"description": "Protect call a function as a variable"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,404 @@
|
||||
{
|
||||
"Create title header": {
|
||||
"prefix": "title",
|
||||
"body": [
|
||||
"---",
|
||||
"title: '${1:title}'",
|
||||
"author: '${2:autor}'",
|
||||
"date: '${3:fecha}'",
|
||||
"---"
|
||||
]
|
||||
},
|
||||
"LTEX en ingles": {
|
||||
"prefix": "eng",
|
||||
"body": ["<!-- LTeX: language=en-US -->"]
|
||||
},
|
||||
"header 1": {
|
||||
"prefix": "h1",
|
||||
"body": ["# ${0}"],
|
||||
"description": "Add header level 1"
|
||||
},
|
||||
"header 2": {
|
||||
"prefix": "h2",
|
||||
"body": ["## ${0}"],
|
||||
"description": "Add header level 2"
|
||||
},
|
||||
"header 3": {
|
||||
"prefix": "h3",
|
||||
"body": ["### ${0}"],
|
||||
"description": "Add header level 3"
|
||||
},
|
||||
"header 4": {
|
||||
"prefix": "h4",
|
||||
"body": ["#### ${0}"],
|
||||
"description": "Add header level 4"
|
||||
},
|
||||
"header 5": {
|
||||
"prefix": "h5",
|
||||
"body": ["##### ${0}"],
|
||||
"description": "Add header level 5"
|
||||
},
|
||||
"header 6": {
|
||||
"prefix": "h6",
|
||||
"body": ["###### ${0}"],
|
||||
"description": "Add header level 6"
|
||||
},
|
||||
"Links": {
|
||||
"prefix": ["l", "link"],
|
||||
"body": ["[${1:text}](${2:url}) ${0}"],
|
||||
"description": "Add links"
|
||||
},
|
||||
"URLS": {
|
||||
"prefix": ["u", "url"],
|
||||
"body": ["<${1}> ${0}"],
|
||||
"description": "Add urls"
|
||||
},
|
||||
"Images": {
|
||||
"prefix": "img",
|
||||
"body": [" ${0}"],
|
||||
"description": "Add images"
|
||||
},
|
||||
"Insert strikethrough": {
|
||||
"prefix": "strikethrough",
|
||||
"body": "~~${1}~~ ${0}",
|
||||
"description": "Insert strikethrough"
|
||||
},
|
||||
"Insert bold text": {
|
||||
"prefix": ["bold", "b"],
|
||||
"body": "**${1}** $0",
|
||||
"description": "Insert bold text"
|
||||
},
|
||||
"Insert italic text": {
|
||||
"prefix": ["i", "italic"],
|
||||
"body": "*${1}* $0",
|
||||
"description": "Insert italic text"
|
||||
},
|
||||
"Insert bold and italic text": {
|
||||
"prefix": ["bold and italic", "bi"],
|
||||
"body": "***${1}*** $0",
|
||||
"description": "Insert bold and italic text"
|
||||
},
|
||||
"Insert quoted text": {
|
||||
"prefix": "quote",
|
||||
"body": "> ${1}",
|
||||
"description": "Insert quoted text"
|
||||
},
|
||||
"Insert code": {
|
||||
"prefix": "code",
|
||||
"body": "`${1}` $0",
|
||||
"description": "Insert code"
|
||||
},
|
||||
"Insert code block": {
|
||||
"prefix": "codeblock",
|
||||
"body": ["```${1:language}", "$0", "```"],
|
||||
"description": "Insert fenced code block"
|
||||
},
|
||||
"Insert unordered list": {
|
||||
"prefix": "unordered list",
|
||||
"body": ["- ${1:first}", "- ${2:second}", "- ${3:third}", "$0"],
|
||||
"description": "Insert unordered list"
|
||||
},
|
||||
"Insert ordered list": {
|
||||
"prefix": "ordered list",
|
||||
"body": ["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 task list": {
|
||||
"prefix": "task",
|
||||
"body": ["- [${1| ,x|}] ${2:text}", "${0}"],
|
||||
"description": "Insert task list"
|
||||
},
|
||||
"Insert task list 2": {
|
||||
"prefix": "task2",
|
||||
"body": ["- [${1| ,x|}] ${2:text}", "- [${3| ,x|}] ${4:text}", "${0}"],
|
||||
"description": "Insert task list with 2 tasks"
|
||||
},
|
||||
"Insert task list 3": {
|
||||
"prefix": "task3",
|
||||
"body": [
|
||||
"- [${1| ,x|}] ${2:text}",
|
||||
"- [${3| ,x|}] ${4:text}",
|
||||
"- [${5| ,x|}] ${6:text}",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert task list with 3 tasks"
|
||||
},
|
||||
"Insert task list 4": {
|
||||
"prefix": "task4",
|
||||
"body": [
|
||||
"- [${1| ,x|}] ${2:text}",
|
||||
"- [${3| ,x|}] ${4:text}",
|
||||
"- [${5| ,x|}] ${6:text}",
|
||||
"- [${7| ,x|}] ${8:text}",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert task list with 4 tasks"
|
||||
},
|
||||
"Insert task list 5": {
|
||||
"prefix": "task5",
|
||||
"body": [
|
||||
"- [${1| ,x|}] ${2:text}",
|
||||
"- [${3| ,x|}] ${4:text}",
|
||||
"- [${5| ,x|}] ${6:text}",
|
||||
"- [${7| ,x|}] ${8:text}",
|
||||
"- [${9| ,x|}] ${10:text}",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert task list with 5 tasks"
|
||||
},
|
||||
"Insert table": {
|
||||
"prefix": "table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} | ${3:Column3} |",
|
||||
"|-------------- | -------------- | -------------- |",
|
||||
"| ${4:Item1} | ${5:Item1} | ${6:Item1} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 2 rows and 3 columns. First row is heading."
|
||||
},
|
||||
"Insert 2x1 table": {
|
||||
"prefix": "2x1table",
|
||||
"body": [
|
||||
"| ${1:Column1} |",
|
||||
"|-------------- |",
|
||||
"| ${2:Item1} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 2 rows and 1 column. First row is heading."
|
||||
},
|
||||
"Insert 3x1 table": {
|
||||
"prefix": "3x1table",
|
||||
"body": [
|
||||
"| ${1:Column1} |",
|
||||
"|-------------- |",
|
||||
"| ${2:Item1} |",
|
||||
"| ${3:Item2} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 3 rows and 1 column. First row is heading."
|
||||
},
|
||||
"Insert 4x1 table": {
|
||||
"prefix": "4x1table",
|
||||
"body": [
|
||||
"| ${1:Column1} |",
|
||||
"|-------------- |",
|
||||
"| ${2:Item1} |",
|
||||
"| ${3:Item2} |",
|
||||
"| ${4:Item3} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 4 rows and 1 column. First row is heading."
|
||||
},
|
||||
"Insert 5x1 table": {
|
||||
"prefix": "5x1table",
|
||||
"body": [
|
||||
"| ${1:Column1} |",
|
||||
"|-------------- |",
|
||||
"| ${2:Item1} |",
|
||||
"| ${3:Item2} |",
|
||||
"| ${4:Item3} |",
|
||||
"| ${5:Item4} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 5 rows and 1 column. First row is heading."
|
||||
},
|
||||
"Insert 2x2 table": {
|
||||
"prefix": "2x2table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} |",
|
||||
"|--------------- | --------------- |",
|
||||
"| ${3:Item1.1} | ${4:Item2.1} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 2 rows and 2 columns. First row is heading."
|
||||
},
|
||||
"Insert 3x2 table": {
|
||||
"prefix": "3x2table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} |",
|
||||
"|--------------- | --------------- |",
|
||||
"| ${3:Item1.1} | ${4:Item2.1} |",
|
||||
"| ${5:Item1.2} | ${6:Item2.2} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 3 rows and 2 columns. First row is heading."
|
||||
},
|
||||
"Insert 4x2 table": {
|
||||
"prefix": "4x2table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} |",
|
||||
"|--------------- | --------------- |",
|
||||
"| ${3:Item1.1} | ${4:Item2.1} |",
|
||||
"| ${5:Item1.2} | ${6:Item2.2} |",
|
||||
"| ${7:Item1.3} | ${8:Item2.3} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 4 rows and 2 columns. First row is heading."
|
||||
},
|
||||
"Insert 5x2 table": {
|
||||
"prefix": "5x2table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} |",
|
||||
"|--------------- | --------------- |",
|
||||
"| ${3:Item1.1} | ${4:Item2.1} |",
|
||||
"| ${4:Item1.2} | ${5:Item2.2} |",
|
||||
"| ${6:Item1.3} | ${7:Item2.3} |",
|
||||
"| ${8:Item1.4} | ${9:Item2.4} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 5 rows and 2 columns. First row is heading."
|
||||
},
|
||||
"Insert 2x3 table": {
|
||||
"prefix": "2x3table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} | ${3:Column3} |",
|
||||
"|---------------- | --------------- | --------------- |",
|
||||
"| ${4:Item1.1} | ${5:Item2.1} | ${6:Item3.1} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 2 rows and 3 columns. First row is heading."
|
||||
},
|
||||
"Insert 3x3 table": {
|
||||
"prefix": "3x3table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} | ${3:Column3} |",
|
||||
"|---------------- | --------------- | --------------- |",
|
||||
"| ${4:Item1.1} | ${5:Item2.1} | ${6:Item3.1} |",
|
||||
"| ${7:Item1.2} | ${8:Item2.2} | ${9:Item3.2} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 3 rows and 3 columns. First row is heading."
|
||||
},
|
||||
"Insert 4x3 table": {
|
||||
"prefix": "4x3table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} | ${3:Column3} |",
|
||||
"|---------------- | --------------- | --------------- |",
|
||||
"| ${4:Item1.1} | ${5:Item2.1} | ${6:Item3.1} |",
|
||||
"| ${7:Item1.2} | ${8:Item2.2} | ${9:Item3.2} |",
|
||||
"| ${10:Item1.3} | ${11:Item2.3} | ${12:Item3.3} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 4 rows and 3 columns. First row is heading."
|
||||
},
|
||||
"Insert 5x3 table": {
|
||||
"prefix": "5x3table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} | ${3:Column3} |",
|
||||
"|---------------- | --------------- | --------------- |",
|
||||
"| ${4:Item1.1} | ${5:Item2.1} | ${6:Item3.1} |",
|
||||
"| ${7:Item1.2} | ${8:Item2.2} | ${9:Item3.2} |",
|
||||
"| ${10:Item1.3} | ${11:Item2.3} | ${12:Item3.3} |",
|
||||
"| ${13:Item1.4} | ${14:Item2.4} | ${15:Item3.4} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 5 rows and 3 columns. First row is heading."
|
||||
},
|
||||
"Insert 2x4 table": {
|
||||
"prefix": "2x4table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} |",
|
||||
"|---------------- | --------------- | --------------- | --------------- |",
|
||||
"| ${5:Item1.1} | ${6:Item2.1} | ${7:Item3.1} | ${8:Item4.1} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 2 rows and 4 columns. First row is heading."
|
||||
},
|
||||
"Insert 3x4 table": {
|
||||
"prefix": "3x4table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} |",
|
||||
"|---------------- | --------------- | --------------- | --------------- |",
|
||||
"| ${5:Item1.1} | ${6:Item2.1} | ${7:Item3.1} | ${8:Item4.1} |",
|
||||
"| ${9:Item1.2} | ${10:Item2.2} | ${11:Item3.2} | ${12:Item4.2} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 3 rows and 4 columns. First row is heading."
|
||||
},
|
||||
"Insert 4x4 table": {
|
||||
"prefix": "4x4table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} |",
|
||||
"|---------------- | --------------- | --------------- | --------------- |",
|
||||
"| ${5:Item1.1} | ${6:Item2.1} | ${7:Item3.1} | ${8:Item4.1} |",
|
||||
"| ${9:Item1.2} | ${10:Item2.2} | ${11:Item3.2} | ${12:Item4.2} |",
|
||||
"| ${13:Item1.3} | ${14:Item2.3} | ${15:Item3.3} | ${16:Item4.3} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 4 rows and 4 columns. First row is heading."
|
||||
},
|
||||
"Insert 5x4 table": {
|
||||
"prefix": "5x4table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} |",
|
||||
"|---------------- | --------------- | --------------- | --------------- |",
|
||||
"| ${5:Item1.1} | ${6:Item2.1} | ${7:Item3.1} | ${8:Item4.1} |",
|
||||
"| ${9:Item1.2} | ${10:Item2.2} | ${11:Item3.2} | ${12:Item4.2} |",
|
||||
"| ${13:Item1.3} | ${14:Item2.3} | ${15:Item3.3} | ${16:Item4.3} |",
|
||||
"| ${17:Item1.4} | ${18:Item2.4} | ${19:Item3.4} | ${20:Item4.4} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 5 rows and 4 columns. First row is heading."
|
||||
},
|
||||
"Insert 2x5 table": {
|
||||
"prefix": "2x5table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} | ${5:Column5} |",
|
||||
"|---------------- | --------------- | --------------- | --------------- | --------------- |",
|
||||
"| ${6:Item1.1} | ${7:Item2.1} | ${8:Item3.1} | ${9:Item4.1} | ${10:Item5.1} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 2 rows and 5 columns. First row is heading."
|
||||
},
|
||||
"Insert 3x5 table": {
|
||||
"prefix": "3x5table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} | ${5:Column5} |",
|
||||
"|---------------- | --------------- | --------------- | --------------- | --------------- |",
|
||||
"| ${6:Item1.1} | ${7:Item2.1} | ${8:Item3.1} | ${9:Item4.1} | ${10:Item5.1} |",
|
||||
"| ${11:Item1.2} | ${12:Item2.2} | ${13:Item3.2} | ${14:Item4.2} | ${15:Item5.2} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 3 rows and 5 columns. First row is heading."
|
||||
},
|
||||
"Insert 4x5 table": {
|
||||
"prefix": "4x5table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} | ${5:Column5} |",
|
||||
"|---------------- | --------------- | --------------- | --------------- | --------------- |",
|
||||
"| ${6:Item1.1} | ${7:Item2.1} | ${8:Item3.1} | ${9:Item4.1} | ${10:Item5.1} |",
|
||||
"| ${11:Item1.2} | ${12:Item2.2} | ${13:Item3.2} | ${14:Item4.2} | ${15:Item5.2} |",
|
||||
"| ${16:Item1.3} | ${17:Item2.3} | ${18:Item3.3} | ${19:Item4.3} | ${20:Item5.3} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 4 rows and 5 columns. First row is heading."
|
||||
},
|
||||
"Insert 5x5 table": {
|
||||
"prefix": "5x5table",
|
||||
"body": [
|
||||
"| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} | ${5:Column5} |",
|
||||
"|---------------- | --------------- | --------------- | --------------- | --------------- |",
|
||||
"| ${6:Item1.1} | ${7:Item2.1} | ${8:Item3.1} | ${9:Item4.1} | ${10:Item5.1} |",
|
||||
"| ${11:Item1.2} | ${12:Item2.2} | ${13:Item3.2} | ${14:Item4.2} | ${15:Item5.2} |",
|
||||
"| ${16:Item1.3} | ${17:Item2.3} | ${18:Item3.3} | ${19:Item4.3} | ${20:Item5.3} |",
|
||||
"| ${21:Item1.4} | ${22:Item2.4} | ${23:Item3.4} | ${24:Item4.4} | ${25:Item5.4} |",
|
||||
"${0}"
|
||||
],
|
||||
"description": "Insert table with 5 rows and 5 columns. First row is heading."
|
||||
},
|
||||
"Insert subscript": {
|
||||
"prefix": "sub",
|
||||
"body": ["${1}<sub>${0}"],
|
||||
"description": "Create a subscript."
|
||||
},
|
||||
"Insert superscript": {
|
||||
"prefix": "sup",
|
||||
"body": ["${1}<sup>${0}"],
|
||||
"description": "Create a superscript."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "my-custom-snippets",
|
||||
"engines": {
|
||||
"vscode": "^1.11.0"
|
||||
},
|
||||
"contributes": {
|
||||
"snippets": [
|
||||
{
|
||||
"language": ["sql"],
|
||||
"path": "./sql.json"
|
||||
},
|
||||
{
|
||||
"language": ["rust"],
|
||||
"path": "./rust.json"
|
||||
},
|
||||
{
|
||||
"language": ["lua"],
|
||||
"path": "./lua.json"
|
||||
},
|
||||
{
|
||||
"language": ["markdown"],
|
||||
"path": "./markdown.json"
|
||||
},
|
||||
{
|
||||
"language": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"vue",
|
||||
"svelte",
|
||||
"astro",
|
||||
"javascript.jsx",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"typescript.tsx"
|
||||
],
|
||||
"path": "./javascript.json"
|
||||
},
|
||||
{
|
||||
"language": [
|
||||
"javascriptreact",
|
||||
"javascript.jsx",
|
||||
"typescriptreact",
|
||||
"typescript.tsx"
|
||||
],
|
||||
"path": "./javascriptreact.json"
|
||||
},
|
||||
{
|
||||
"language": ["tex"],
|
||||
"path": "./tex.json"
|
||||
},
|
||||
{
|
||||
"language": ["python"],
|
||||
"path": "./django.json"
|
||||
},
|
||||
{
|
||||
"language": ["python"],
|
||||
"path": "./python.json"
|
||||
},
|
||||
{
|
||||
"language": ["html"],
|
||||
"path": "./htmldjango.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,326 @@
|
||||
{
|
||||
"#!/usr/bin/env python": {
|
||||
"prefix": "env",
|
||||
"body": "#!/usr/bin/env python\n$0",
|
||||
"description": "Adds shebang line for default python interpreter."
|
||||
},
|
||||
"#!/usr/bin/env python3": {
|
||||
"prefix": "env3",
|
||||
"body": "#!/usr/bin/env python3\n$0",
|
||||
"description": "Adds shebang line for default python 3 interpreter."
|
||||
},
|
||||
"# -*- coding=utf-8 -*-": {
|
||||
"prefix": "enc",
|
||||
"body": "# -*- coding=utf-8 -*-\n$0",
|
||||
"description": "set default python2.x encoding specification to utf-8 as it is mentioned in pep-0263."
|
||||
},
|
||||
"# coding=utf-8": {
|
||||
"prefix": "enco",
|
||||
"body": "# coding=utf-8\n$0",
|
||||
"description": "Set default python3 encoding specification to utf-8, by default this is the encoding for python3.x as it is mentioned in pep-3120."
|
||||
},
|
||||
"from future import ...": {
|
||||
"prefix": "fenc",
|
||||
"body": [
|
||||
"# -*- coding: utf-8 -*-",
|
||||
"from __future__ import absolute_import, division, print_function, unicode_literals"
|
||||
],
|
||||
"description": "Import future statement definitions for python2.x scripts using utf-8 as encoding."
|
||||
},
|
||||
"from future import ... v1": {
|
||||
"prefix": "fenco",
|
||||
"body": [
|
||||
"# coding: utf-8",
|
||||
"from __future__ import absolute_import, division, print_function, unicode_literals"
|
||||
],
|
||||
"description": "Import future statement definitions for python3.x scripts using utf-8 as encoding."
|
||||
},
|
||||
"import": {
|
||||
"prefix": "im",
|
||||
"body": "import ${1:package/module}$0",
|
||||
"description": "Import a package or module"
|
||||
},
|
||||
"from ... import ...": {
|
||||
"prefix": "fim",
|
||||
"body": "from ${1:package/module} import ${2:names}$0",
|
||||
"description": "Import statement that allows individual objects from the module to be imported directly into the caller’s symbol table."
|
||||
},
|
||||
"class": {
|
||||
"prefix": "class",
|
||||
"body": ["class ${1:classname}(${2:object}):", "\t${3:pass}"],
|
||||
"description": "Code snippet for a class definition"
|
||||
},
|
||||
"New class": {
|
||||
"prefix": "classi",
|
||||
"body": "class ${1:ClassName}(${2:object}):\n\t\"\"\"${3:docstring for $1.}\"\"\"\n\tdef __init__(self, ${4:arg}):\n\t\t${5:super($1, self).__init__()}\n\t\tself.arg = arg\n\t\t$0",
|
||||
"description": "Code snippet for a class definition."
|
||||
},
|
||||
"New method": {
|
||||
"prefix": "defs",
|
||||
"body": "def ${1:mname}(self, ${2:arg}):\n\t${3:pass}$0",
|
||||
"description": "Code snippet for a class method definition."
|
||||
},
|
||||
"New method w/ return": {
|
||||
"prefix": "defst",
|
||||
"body": "def ${1:mname}(self, ${2:arg}) -> ${3:return_type}:\n\t${4:pass}$0",
|
||||
"description": "Code snippet for a class method definition."
|
||||
},
|
||||
"New function": {
|
||||
"prefix": "def",
|
||||
"body": "def ${1:fname}(${2:arg}):\n\t${3:pass}$0",
|
||||
"description": "Code snippet for function definition."
|
||||
},
|
||||
"New function w/ return": {
|
||||
"prefix": "deft",
|
||||
"body": "def ${1:fname}(${2:arg}) -> ${3:return_type}:\n\t${4:pass}$0",
|
||||
"description": "Code snippet for function definition."
|
||||
},
|
||||
"New async function": {
|
||||
"prefix": "adef",
|
||||
"body": "async def ${1:fname}(${2:arg}):\n\t${3:pass}$0",
|
||||
"description": "Code snippet for async function definition."
|
||||
},
|
||||
"New property": {
|
||||
"prefix": "property",
|
||||
"body": "@property\ndef ${1:foo}(self):\n \"\"\"${2:The $1 property.}\"\"\"\n ${3:return self._$1}\n@${4:$1}.setter\ndef ${5:$1}(self, value):\n ${6:self._$1} = value",
|
||||
"description": "New property: get and set via decorator"
|
||||
},
|
||||
"if": {
|
||||
"prefix": "if",
|
||||
"body": "if ${1:condition}:\n\t${2:pass}$0",
|
||||
"description": "Code snippet for the if statement."
|
||||
},
|
||||
"if/else": {
|
||||
"prefix": "if/else",
|
||||
"body": ["if ${1:condition}:", "\t${2:pass}", "else:", "\t${3:pass}"],
|
||||
"description": "Code snippet for an if statement with else"
|
||||
},
|
||||
"elif": {
|
||||
"prefix": "elif",
|
||||
"body": ["elif ${1:expression}:", "\t${2:pass}"],
|
||||
"description": "Code snippet for an elif"
|
||||
},
|
||||
"else": {
|
||||
"prefix": "else",
|
||||
"body": ["else:", "\t${1:pass}"],
|
||||
"description": "Code snippet for an else"
|
||||
},
|
||||
"for": {
|
||||
"prefix": "for",
|
||||
"body": "for ${1:value} in ${2:iterable}:\n\t${3:pass}$0",
|
||||
"description": "Code snippet to create a for loop structure."
|
||||
},
|
||||
"for/else": {
|
||||
"prefix": "for/else",
|
||||
"body": [
|
||||
"for ${1:target_list} in ${2:expression_list}:",
|
||||
"\t${3:pass}",
|
||||
"else:",
|
||||
"\t${4:pass}"
|
||||
],
|
||||
"description": "Code snippet for a for loop with else"
|
||||
},
|
||||
"while": {
|
||||
"prefix": "while",
|
||||
"body": "while ${1:condition}:\n\t${2:pass}$0",
|
||||
"description": "Code snippet to create a while loop structure."
|
||||
},
|
||||
"while/else": {
|
||||
"prefix": "while/else",
|
||||
"body": ["while ${1:expression}:", "\t${2:pass}", "else:", "\t${3:pass}"],
|
||||
"description": "Code snippet for a while loop with else"
|
||||
},
|
||||
"try:except:": {
|
||||
"prefix": "try",
|
||||
"body": "try:\n\t${1:pass}\nexcept ${2:Exception} as ${3:e}:\n\t${4:raise $3}$0",
|
||||
"description": "Code Snippet for a try and except blocks."
|
||||
},
|
||||
"try:except:else:finally": {
|
||||
"prefix": "tryef",
|
||||
"body": "try:\n\t${1:pass}\nexcept${2: ${3:Exception} as ${4:e}}:\n\t${5:raise}\nelse:\n\t${6:pass}\nfinally:\n\t${7:pass}$0",
|
||||
"description": "Code Snippet for a try/except/finally with else statement."
|
||||
},
|
||||
"try:except:else": {
|
||||
"prefix": "trye",
|
||||
"body": "try:\n\t${1:pass}\nexcept ${2:Exception} as ${3:e}:\n\t${4:raise $3}\nelse:\n\t${5:pass}$0",
|
||||
"description": "Code Snippet for a try/except with else statement."
|
||||
},
|
||||
"try:except:finally": {
|
||||
"prefix": "tryf",
|
||||
"body": "try:\n\t${1:pass}\nexcept ${2:Exception} as ${3:e}:\n\t${4:raise $3}\nfinally:\n\t${5:pass}$0",
|
||||
"description": "Code Snippet for a try/except/finally."
|
||||
},
|
||||
"with": {
|
||||
"prefix": "with",
|
||||
"body": ["with ${1:expression} as ${2:target}:", "\t${3:pass}"],
|
||||
"description": "Code snippet for a with statement"
|
||||
},
|
||||
"self": {
|
||||
"prefix": ".",
|
||||
"body": "self.$0",
|
||||
"description": "Shortend snippet to reference the self property in an object."
|
||||
},
|
||||
"__magic__": {
|
||||
"prefix": "__",
|
||||
"body": "__${1:init}__$0",
|
||||
"description": "Code snippet to create magic methods."
|
||||
},
|
||||
"if __name__ == \"__main__\"": {
|
||||
"prefix": "ifmain",
|
||||
"body": "if __name__ == \"__main__\":\n\t${1:main()}$0",
|
||||
"description": "Create implicitly all the code at the top level using the __name__ special variable."
|
||||
},
|
||||
"List comprehension": {
|
||||
"prefix": "lc",
|
||||
"body": "[${1:value} for ${2:value} in ${3:iterable}]$0",
|
||||
"description": "List comprehension for creating a list based on existing lists."
|
||||
},
|
||||
"List comprehension if else": {
|
||||
"prefix": "lcie",
|
||||
"body": "[${1:value} if ${2:condition} else ${3:condition} for ${4:value} in ${5:iterable}]$0",
|
||||
"description": "List comprehension for creating a list based on existing lists, with conditional if-else statement."
|
||||
},
|
||||
"List comprehension if filter": {
|
||||
"prefix": "lci",
|
||||
"body": "[${1:value} for ${2:value} in ${3:iterable} if ${4:condition}$0]",
|
||||
"description": "List comprehension for creating a list based on existing lists, with conditional if statement."
|
||||
},
|
||||
"Dictionary comprehension": {
|
||||
"prefix": "dc",
|
||||
"body": "{${1:key}: ${2:value} for ${3:key}, ${4:value} in ${5:iterable}}$0",
|
||||
"description": "Handy and faster way to create dictories based on existing dictionaries."
|
||||
},
|
||||
"Dictionary comprehension if filter": {
|
||||
"prefix": "dci",
|
||||
"body": "{${1:key}: ${2:value} for ${3:key}, ${4:value} in ${5:iterable} if ${6:condition}}$0",
|
||||
"description": "Handy and faster way to create dictories based on existing dictionaries, with conditional if statement."
|
||||
},
|
||||
"Set comprehension": {
|
||||
"prefix": "sc",
|
||||
"body": "{${1:value} for ${2:value} in ${3:iterable}}$0",
|
||||
"description": "Create a set based on existing iterables."
|
||||
},
|
||||
"Set Comprehension if filter": {
|
||||
"prefix": "sci",
|
||||
"body": "{${1:value} for ${2:value} in ${3:iterable} if ${4:condition}}$0",
|
||||
"description": "Create a set based on existing iterables, with condition if statement."
|
||||
},
|
||||
"Generator comprehension": {
|
||||
"prefix": "gc",
|
||||
"body": "(${1:key} for ${2:value} in ${3:iterable})$0",
|
||||
"description": "Create a generator based on existing iterables."
|
||||
},
|
||||
"Generator comprehension if filter": {
|
||||
"prefix": "gci",
|
||||
"body": "(${1:key} for ${2:value} in ${3:iterable} if ${4:condition})$0",
|
||||
"description": "Create a generator based on existing iterables, with condition if statement."
|
||||
},
|
||||
"try/except": {
|
||||
"prefix": "try/except",
|
||||
"body": [
|
||||
"try:",
|
||||
"\t${1:pass}",
|
||||
"except ${2:expression} as ${3:identifier}:",
|
||||
"\t${4:pass}"
|
||||
],
|
||||
"description": "Code snippet for a try/except statement"
|
||||
},
|
||||
"try/finally": {
|
||||
"prefix": "try/finally",
|
||||
"body": ["try:", "\t${1:pass}", "finally:", "\t${2:pass}"],
|
||||
"description": "Code snippet for a try/finally statement"
|
||||
},
|
||||
"try/except/else": {
|
||||
"prefix": "try/except/else",
|
||||
"body": [
|
||||
"try:",
|
||||
"\t${1:pass}",
|
||||
"except ${2:expression} as ${3:identifier}:",
|
||||
"\t${4:pass}",
|
||||
"else:",
|
||||
"\t${5:pass}"
|
||||
],
|
||||
"description": "Code snippet for a try/except/else statement"
|
||||
},
|
||||
"try/except/finally": {
|
||||
"prefix": "try/except/finally",
|
||||
"body": [
|
||||
"try:",
|
||||
"\t${1:pass}",
|
||||
"except ${2:expression} as ${3:identifier}:",
|
||||
"\t${4:pass}",
|
||||
"finally:",
|
||||
"\t${5:pass}"
|
||||
],
|
||||
"description": "Code snippet for a try/except/finally statement"
|
||||
},
|
||||
"try/except/else/finally": {
|
||||
"prefix": "try/except/else/finally",
|
||||
"body": [
|
||||
"try:",
|
||||
"\t${1:pass}",
|
||||
"except ${2:expression} as ${3:identifier}:",
|
||||
"\t${4:pass}",
|
||||
"else:",
|
||||
"\t${5:pass}",
|
||||
"finally:",
|
||||
"\t${6:pass}"
|
||||
],
|
||||
"description": "Code snippet for a try/except/else/finally statement"
|
||||
},
|
||||
"def(class method)": {
|
||||
"prefix": "def class method",
|
||||
"body": ["def ${1:funcname}(self, ${2:parameter_list}):", "\t${3:pass}"],
|
||||
"description": "Code snippet for a class method"
|
||||
},
|
||||
"def(static class method)": {
|
||||
"prefix": "def static class method",
|
||||
"body": ["@staticmethod", "def ${1:funcname}(${2:parameter_list}):", "\t${3:pass}"],
|
||||
"description": "Code snippet for a static class method"
|
||||
},
|
||||
"def(abstract class method)": {
|
||||
"prefix": "def abstract class method",
|
||||
"body": ["def ${1:funcname}(self, ${2:parameter_list}):", "\traise NotImplementedError"],
|
||||
"description": "Code snippet for an abstract class method"
|
||||
},
|
||||
"lambda": {
|
||||
"prefix": "lambda",
|
||||
"body": ["lambda ${1:parameter_list}: ${2:expression}"],
|
||||
"description": "Code snippet for a lambda statement"
|
||||
},
|
||||
"if(main)": {
|
||||
"prefix": "__main__",
|
||||
"body": ["if __name__ == \"__main__\":", " ${1:pass}"],
|
||||
"description": "Code snippet for a `if __name__ == \"__main__\": ...` block"
|
||||
},
|
||||
"async/def": {
|
||||
"prefix": "async/def",
|
||||
"body": ["async def ${1:funcname}(${2:parameter_list}):", "\t${3:pass}"],
|
||||
"description": "Code snippet for an async statement"
|
||||
},
|
||||
"async/for": {
|
||||
"prefix": "async/for",
|
||||
"body": ["async for ${1:target} in ${2:iter}:", "\t${3:block}"],
|
||||
"description": "Code snippet for an async for statement"
|
||||
},
|
||||
"async/for/else": {
|
||||
"prefix": "async/for/else",
|
||||
"body": ["async for ${1:target} in ${2:iter}:", "\t${3:block}", "else:", "\t${4:block}"],
|
||||
"description": "Code snippet for an async for statement with else"
|
||||
},
|
||||
"async/with": {
|
||||
"prefix": "async/with",
|
||||
"body": ["async with ${1:expr} as ${2:var}:", "\t${3:block}"],
|
||||
"description": "Code snippet for an async with statement"
|
||||
},
|
||||
"add/new/cell": {
|
||||
"prefix": "add/new/cell",
|
||||
"body": "# %%",
|
||||
"description": "Code snippet to add a new cell"
|
||||
},
|
||||
"mark/markdown": {
|
||||
"prefix": "mark/markdown",
|
||||
"body": "# %% [markdown]",
|
||||
"description": "Code snippet to add a new markdown cell"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,433 @@
|
||||
{
|
||||
"Complete format to test": {
|
||||
"prefix": "testformat",
|
||||
"body": [
|
||||
"#[cfg(test)]",
|
||||
"mod tests {",
|
||||
" #[test]",
|
||||
" fn ${1:name}() {",
|
||||
" ${2:unimplemented!();}",
|
||||
" }",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"allow": {
|
||||
"prefix": "allow",
|
||||
"body": ["#![allow(${1})]"],
|
||||
"description": "#![allow(…)]"
|
||||
},
|
||||
"deny": {
|
||||
"prefix": "deny",
|
||||
"body": ["#![deny(${1})]"],
|
||||
"description": "#![deny(…)]"
|
||||
},
|
||||
"warn": {
|
||||
"prefix": "warn",
|
||||
"body": ["#![warn(${1})]"],
|
||||
"description": "#![warn(…)]"
|
||||
},
|
||||
"no_std": {
|
||||
"prefix": "no_std",
|
||||
"body": ["#![no_std]"],
|
||||
"description": "#![no_std]"
|
||||
},
|
||||
"no_core": {
|
||||
"prefix": "no_core",
|
||||
"body": ["#![no_core]"],
|
||||
"description": "#![no_core]"
|
||||
},
|
||||
"feature": {
|
||||
"prefix": "feature",
|
||||
"body": ["#![feature(${1})]"],
|
||||
"description": "#![feature(…)]"
|
||||
},
|
||||
"macro_use": {
|
||||
"prefix": "macro_use",
|
||||
"body": ["#[macro_use(${1})]"],
|
||||
"description": "#[macro_use(…)]"
|
||||
},
|
||||
"repr": {
|
||||
"prefix": "repr",
|
||||
"body": ["#[repr(${1})]"],
|
||||
"description": "#[repr(…)]"
|
||||
},
|
||||
"cfg": {
|
||||
"prefix": "cfg",
|
||||
"body": ["#[cfg(${1})]"],
|
||||
"description": "#[cfg(…)]"
|
||||
},
|
||||
"cfg_attr": {
|
||||
"prefix": "cfg_attr",
|
||||
"body": ["#[cfg_attr(${1}, ${2})]"],
|
||||
"description": "#[cfg_attr(…, …)]"
|
||||
},
|
||||
"cfg!": {
|
||||
"prefix": "cfg!",
|
||||
"body": ["cfg!(${1})"],
|
||||
"description": "cfg!(…)"
|
||||
},
|
||||
"column": {
|
||||
"prefix": "column",
|
||||
"body": ["column!()"],
|
||||
"description": "column!()"
|
||||
},
|
||||
"concat": {
|
||||
"prefix": "concat",
|
||||
"body": ["concat!(${1})"],
|
||||
"description": "concat!(…)"
|
||||
},
|
||||
"concat_idents": {
|
||||
"prefix": "concat_idents",
|
||||
"body": ["concat_idents!(${1})"],
|
||||
"description": "concat_idents!(…)"
|
||||
},
|
||||
"debug_assert": {
|
||||
"prefix": "debug_assert",
|
||||
"body": ["debug_assert!(${1});"],
|
||||
"description": "debug_assert!(…)"
|
||||
},
|
||||
"debug_assert_eq": {
|
||||
"prefix": "debug_assert_eq",
|
||||
"body": ["debug_assert_eq!(${1}, ${2});"],
|
||||
"description": "debug_assert_eq!(…, …)"
|
||||
},
|
||||
"env": {
|
||||
"prefix": "env",
|
||||
"body": ["env!(\"${1}\")"],
|
||||
"description": "env!(\"…\")"
|
||||
},
|
||||
"file": {
|
||||
"prefix": "file",
|
||||
"body": ["file!()"],
|
||||
"description": "file!()"
|
||||
},
|
||||
"format": {
|
||||
"prefix": "format",
|
||||
"body": ["format!(\"${1}\")"],
|
||||
"description": "format!(…)"
|
||||
},
|
||||
"format_args": {
|
||||
"prefix": "format_args",
|
||||
"body": ["format_args!(\"${1}\")"],
|
||||
"description": "format_args!(…)"
|
||||
},
|
||||
"include": {
|
||||
"prefix": "include",
|
||||
"body": ["include!(\"${1}\");"],
|
||||
"description": "include!(\"…\");"
|
||||
},
|
||||
"include_bytes": {
|
||||
"prefix": "include_bytes",
|
||||
"body": ["include_bytes!(\"${1}\")"],
|
||||
"description": "include_bytes!(\"…\")"
|
||||
},
|
||||
"include_str": {
|
||||
"prefix": "include_str",
|
||||
"body": ["include_str!(\"${1}\")"],
|
||||
"description": "include_str!(\"…\")"
|
||||
},
|
||||
"line": {
|
||||
"prefix": "line",
|
||||
"body": ["line!()"],
|
||||
"description": "line!()"
|
||||
},
|
||||
"module_path": {
|
||||
"prefix": "module_path",
|
||||
"body": ["module_path!()"],
|
||||
"description": "module_path!()"
|
||||
},
|
||||
"option_env": {
|
||||
"prefix": "option_env",
|
||||
"body": ["option_env!(\"${1}\")"],
|
||||
"description": "option_env!(\"…\")"
|
||||
},
|
||||
"panic": {
|
||||
"prefix": "panic",
|
||||
"body": ["panic!(\"${1}\");"],
|
||||
"description": "panic!(…);"
|
||||
},
|
||||
"print": {
|
||||
"prefix": "print",
|
||||
"body": ["print!(\"${1}\");"],
|
||||
"description": "print!(…);"
|
||||
},
|
||||
"println": {
|
||||
"prefix": "println",
|
||||
"body": ["println!(\"${1}\");"],
|
||||
"description": "println!(…);"
|
||||
},
|
||||
"stringify": {
|
||||
"prefix": "stringify",
|
||||
"body": ["stringify!(${1})"],
|
||||
"description": "stringify!(…)"
|
||||
},
|
||||
"thread_local": {
|
||||
"prefix": "thread_local",
|
||||
"body": ["thread_local!(static ${1:STATIC}: ${2:Type} = ${4:init});"],
|
||||
"description": "thread_local!(static …: … = …);"
|
||||
},
|
||||
"try": {
|
||||
"prefix": "try",
|
||||
"body": ["try!(${1})"],
|
||||
"description": "try!(…)"
|
||||
},
|
||||
"unimplemented": {
|
||||
"prefix": "unimplemented",
|
||||
"body": ["unimplemented!()"],
|
||||
"description": "unimplemented!()"
|
||||
},
|
||||
"unreachable": {
|
||||
"prefix": "unreachable",
|
||||
"body": ["unreachable!(${1})"],
|
||||
"description": "unreachable!(…)"
|
||||
},
|
||||
"vec": {
|
||||
"prefix": "vec",
|
||||
"body": ["vec![${1}]"],
|
||||
"description": "vec![…]"
|
||||
},
|
||||
"write": {
|
||||
"prefix": "write",
|
||||
"body": ["write!(${1}, \"${2}\")"],
|
||||
"description": "write!(…)"
|
||||
},
|
||||
"writeln": {
|
||||
"prefix": "writeln",
|
||||
"body": ["writeln!(${1}, \"${2}\")"],
|
||||
"description": "writeln!(…, …)"
|
||||
},
|
||||
"Err": {
|
||||
"prefix": "Err",
|
||||
"body": ["Err(${1})"],
|
||||
"description": "Err(…)"
|
||||
},
|
||||
"Ok": {
|
||||
"prefix": "Ok",
|
||||
"body": ["Ok(${1:result})"],
|
||||
"description": "Ok(…)"
|
||||
},
|
||||
"Some": {
|
||||
"prefix": "Some",
|
||||
"body": ["Some(${1})"],
|
||||
"description": "Some(…)"
|
||||
},
|
||||
"assert": {
|
||||
"prefix": "assert",
|
||||
"body": ["assert!(${1});"],
|
||||
"description": "assert!(…);"
|
||||
},
|
||||
"assert_eq": {
|
||||
"prefix": "assert_eq",
|
||||
"body": ["assert_eq!(${1}, ${2});"],
|
||||
"description": "assert_eq!(…, …);"
|
||||
},
|
||||
"bench": {
|
||||
"prefix": "bench",
|
||||
"body": [
|
||||
"#[bench]",
|
||||
"fn ${1:name}(b: &mut test::Bencher) {",
|
||||
" ${2:b.iter(|| ${3:/* benchmark code */})}",
|
||||
"}"
|
||||
],
|
||||
"description": "#[bench]"
|
||||
},
|
||||
"const": {
|
||||
"prefix": "const",
|
||||
"body": ["const ${1:CONST}: ${2:Type} = ${4:init};"],
|
||||
"description": "const …: … = …;"
|
||||
},
|
||||
"derive": {
|
||||
"prefix": "derive",
|
||||
"body": ["#[derive(${1})]"],
|
||||
"description": "#[derive(…)]"
|
||||
},
|
||||
"else": {
|
||||
"prefix": "else",
|
||||
"body": ["else {", " ${1:todo!();}", "}"],
|
||||
"description": "else { … }"
|
||||
},
|
||||
"enum": {
|
||||
"prefix": "enum",
|
||||
"body": [
|
||||
"#[derive(Debug)]",
|
||||
"enum ${1:Name} {",
|
||||
" ${2:Variant1},",
|
||||
" ${3:Variant2},",
|
||||
"}"
|
||||
],
|
||||
"description": "enum … { … }"
|
||||
},
|
||||
"extern-crate": {
|
||||
"prefix": "extern-crate",
|
||||
"body": ["extern crate ${1:name};"],
|
||||
"description": "extern crate …;"
|
||||
},
|
||||
"extern-fn": {
|
||||
"prefix": "extern-fn",
|
||||
"body": [
|
||||
"extern \"C\" fn ${1:name}(${2:arg}: ${3:Type}) -> ${4:RetType} {",
|
||||
" ${5:// add code here}",
|
||||
"}"
|
||||
],
|
||||
"description": "extern \"C\" fn …(…) { … }"
|
||||
},
|
||||
"extern-mod": {
|
||||
"prefix": "extern-mod",
|
||||
"body": ["extern \"C\" {", " ${2:// add code here}", "}"],
|
||||
"description": "extern \"C\" { … }"
|
||||
},
|
||||
"pfn": {
|
||||
"prefix": "pfn",
|
||||
"body": [
|
||||
"pub fn ${1:name}(${2:arg}: ${3:Type}) -> ${4:RetType} {",
|
||||
" ${5:todo!();}",
|
||||
"}"
|
||||
],
|
||||
"description": "pub fn …(…) { … }"
|
||||
},
|
||||
"fn": {
|
||||
"prefix": "fn",
|
||||
"body": [
|
||||
"fn ${1:name}(${2:arg}: ${3:Type}) -> ${4:RetType} {",
|
||||
" ${5:todo!();}",
|
||||
"}"
|
||||
],
|
||||
"description": "fn …(…) { … }"
|
||||
},
|
||||
"for": {
|
||||
"prefix": "for",
|
||||
"body": ["for ${1:pat} in ${2:expr} {", " ${3:todo!();}", "}"],
|
||||
"description": "for … in … { … }"
|
||||
},
|
||||
"if-let": {
|
||||
"prefix": "if-let",
|
||||
"body": ["if let ${1:Some(pat)} = ${2:expr} {", " ${0:todo!();}", "}"],
|
||||
"description": "if let … = … { … }"
|
||||
},
|
||||
"if": {
|
||||
"prefix": "if",
|
||||
"body": ["if ${1:condition} {", " ${2:todo!();}", "}"],
|
||||
"description": "if … { … }"
|
||||
},
|
||||
"impl-trait": {
|
||||
"prefix": "impl-trait",
|
||||
"body": [
|
||||
"impl ${1:Trait} for ${2:Type} {",
|
||||
" ${3:// add code here}",
|
||||
"}"
|
||||
],
|
||||
"description": "impl … for … { … }"
|
||||
},
|
||||
"impl": {
|
||||
"prefix": "impl",
|
||||
"body": ["impl ${1:Type} {", " ${2:// add code here}", "}"],
|
||||
"description": "impl … { … }"
|
||||
},
|
||||
"inline-fn": {
|
||||
"prefix": "inline-fn",
|
||||
"body": ["#[inline]", "pub fn ${1:name}() {", " ${2:todo!();}", "}"],
|
||||
"description": "inlined function"
|
||||
},
|
||||
"let": {
|
||||
"prefix": "let",
|
||||
"body": ["let ${1:pat} = ${2:expr};"],
|
||||
"description": "let … = …;"
|
||||
},
|
||||
"loop": {
|
||||
"prefix": "loop",
|
||||
"body": ["loop {", " ${2:todo!();}", "}"],
|
||||
"description": "loop { … }"
|
||||
},
|
||||
"macro_rules": {
|
||||
"prefix": "macro_rules",
|
||||
"body": ["macro_rules! ${1:name} {", " (${2}) => (${3})", "}"],
|
||||
"description": "macro_rules! … { … }"
|
||||
},
|
||||
"main": {
|
||||
"prefix": "main",
|
||||
"body": ["fn main() {", " ${1:todo!();}", "}"],
|
||||
"description": "fn main() { … }"
|
||||
},
|
||||
"match": {
|
||||
"prefix": "match",
|
||||
"body": ["match ${1:expr} {}"],
|
||||
"description": "match … { … }"
|
||||
},
|
||||
"mod": {
|
||||
"prefix": "mod",
|
||||
"body": ["mod ${1:name};"],
|
||||
"description": "mod …;"
|
||||
},
|
||||
"mod-block": {
|
||||
"prefix": "mod-block",
|
||||
"body": ["mod ${1:name} {", " ${2:// add code here}", "}"],
|
||||
"description": "mod … { … }"
|
||||
},
|
||||
"static": {
|
||||
"prefix": "static",
|
||||
"body": ["static ${1:STATIC}: ${2:Type} = ${4:init};"],
|
||||
"description": "static …: … = …;"
|
||||
},
|
||||
"struct-tuple": {
|
||||
"prefix": "struct-tuple",
|
||||
"body": ["struct ${1:Name}(${2:Type});"],
|
||||
"description": "struct …(…);"
|
||||
},
|
||||
"struct-unit": {
|
||||
"prefix": "struct-unit",
|
||||
"body": ["struct ${1:Name};"],
|
||||
"description": "struct …;"
|
||||
},
|
||||
"struct": {
|
||||
"prefix": "struct",
|
||||
"body": [
|
||||
"#[derive(Debug)]",
|
||||
"struct ${1:Name} {",
|
||||
" ${2:field}: ${3:Type}",
|
||||
"}"
|
||||
],
|
||||
"description": "struct … { … }"
|
||||
},
|
||||
"modtest": {
|
||||
"prefix": "modtest",
|
||||
"body": [
|
||||
"#[cfg(test)]",
|
||||
"mod test {",
|
||||
" #[test]",
|
||||
" fn ${1:name}() {",
|
||||
" ${2:todo!();}",
|
||||
" }",
|
||||
"}"
|
||||
],
|
||||
"description": "#[cfg(test)]\nmod test {...}"
|
||||
},
|
||||
"test": {
|
||||
"prefix": "test",
|
||||
"body": ["#[test]", "fn ${1:name}() {", " ${2:todo!();}", "}"],
|
||||
"description": "#[test]"
|
||||
},
|
||||
"trait": {
|
||||
"prefix": "trait",
|
||||
"body": ["trait ${1:Name} {", " ${2:// add code here}", "}", ""],
|
||||
"description": "trait … { … }"
|
||||
},
|
||||
"type": {
|
||||
"prefix": "type",
|
||||
"body": ["type ${1:Alias} = ${2:Type};"],
|
||||
"description": "type … = …;"
|
||||
},
|
||||
"while-let": {
|
||||
"prefix": "while-let",
|
||||
"body": [
|
||||
"while let ${1:Some(pat)} = ${2:expr} {",
|
||||
" ${0:todo!();}",
|
||||
"}"
|
||||
],
|
||||
"description": "while let … = … { … }"
|
||||
},
|
||||
"while": {
|
||||
"prefix": "while",
|
||||
"body": ["while ${1:condition} {", " ${2:todo!();}", "}"],
|
||||
"description": "while … { … }"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"INTEGER NOT NULL": {
|
||||
"prefix": "int",
|
||||
"body": ["INTEGER NOT NULL"]
|
||||
},
|
||||
"VARCHAR NOT NULL": {
|
||||
"prefix": "varchar",
|
||||
"body": ["VARCHAR($1) NOT NULL$0"]
|
||||
},
|
||||
"BOOLEAN NOT NULL": {
|
||||
"prefix": "bool",
|
||||
"body": ["BOOLEAN NOT NULL"]
|
||||
},
|
||||
"REAL NOT NULL": {
|
||||
"prefix": "real",
|
||||
"body": ["REAL NOT NULL"]
|
||||
},
|
||||
"SERIAL PRIMARY KEY": {
|
||||
"prefix": "srk",
|
||||
"body": ["SERIAL PRIMARY KEY"]
|
||||
},
|
||||
"FOREIGN KEY": {
|
||||
"prefix": "fgk",
|
||||
"body": [
|
||||
"FOREIGN KEY (${1:attribute}) REFERENCES ${2:tableName}(${3:attribute}) ON DELETE RESTRICT"
|
||||
],
|
||||
"description": "Foreign Key"
|
||||
},
|
||||
"CREATE TABLE": {
|
||||
"prefix": "ctt",
|
||||
"body": ["CREATE TABLE ${1:tableName} (", "\t${2:attribute(s)}", ");"],
|
||||
"description": "Create regular table"
|
||||
},
|
||||
"CREATE TYPE": {
|
||||
"prefix": "cte",
|
||||
"body": [
|
||||
"CREATE TYPE ${1:typeName} AS ENUM (",
|
||||
"\t${2:attribute(s)}",
|
||||
");"
|
||||
],
|
||||
"description": "Create type enum"
|
||||
},
|
||||
"INSERT": {
|
||||
"prefix": "ins",
|
||||
"body": [
|
||||
"INSERT INTO ${1:tableName} (",
|
||||
"\t${2:attribute(s)}",
|
||||
") VALUES ( ${3:values} )"
|
||||
],
|
||||
"description": "Insert value(s)"
|
||||
},
|
||||
"DROP TABLE": {
|
||||
"prefix": "dpt",
|
||||
"body": ["DROP TABLE ${1:tableName};"],
|
||||
"description": "Drop table"
|
||||
},
|
||||
"DROP TYPE": {
|
||||
"prefix": "dpe",
|
||||
"body": ["DROP TYPE ${1:typeNAme};"],
|
||||
"description": "Drop type enum"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user