summaryrefslogtreecommitdiff
path: root/.config/coc/extensions/node_modules/coc-tsserver/snippets/javascript.json
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@simplelittledream.com>2022-07-16 18:13:16 -0400
committerJacob McDonnell <jacob@simplelittledream.com>2022-07-16 18:13:16 -0400
commit8fad9a5ecddc88d57a531e4b0084544984f23d25 (patch)
tree84954bc8219942aa56bc899330ccd0007bbe0ef0 /.config/coc/extensions/node_modules/coc-tsserver/snippets/javascript.json
parent2887af7fcfb4d618dd13cf66ec2fbdbd84c7527c (diff)
Added profile and other missing configs
Diffstat (limited to '.config/coc/extensions/node_modules/coc-tsserver/snippets/javascript.json')
-rw-r--r--.config/coc/extensions/node_modules/coc-tsserver/snippets/javascript.json194
1 files changed, 194 insertions, 0 deletions
diff --git a/.config/coc/extensions/node_modules/coc-tsserver/snippets/javascript.json b/.config/coc/extensions/node_modules/coc-tsserver/snippets/javascript.json
new file mode 100644
index 0000000..ac5cd55
--- /dev/null
+++ b/.config/coc/extensions/node_modules/coc-tsserver/snippets/javascript.json
@@ -0,0 +1,194 @@
+{
+ "define module": {
+ "prefix": "define",
+ "body": [
+ "define([",
+ "\t'require',",
+ "\t'${1:dependency}'",
+ "], function(require, ${2:factory}) {",
+ "\t'use strict';",
+ "\t$0",
+ "});"
+ ],
+ "description": "define module"
+ },
+ "For Loop": {
+ "prefix": "for",
+ "body": [
+ "for (let ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
+ "\tconst ${3:element} = ${2:array}[${1:index}];",
+ "\t$TM_SELECTED_TEXT$0",
+ "}"
+ ],
+ "description": "For Loop"
+ },
+ "For-Each Loop": {
+ "prefix": "foreach",
+ "body": [
+ "${1:array}.forEach(${2:element} => {",
+ "\t$TM_SELECTED_TEXT$0",
+ "});"
+ ],
+ "description": "For-Each Loop"
+ },
+ "For-In Loop": {
+ "prefix": "forin",
+ "body": [
+ "for (const ${1:key} in ${2:object}) {",
+ "\tif (Object.hasOwnProperty.call(${2:object}, ${1:key})) {",
+ "\t\tconst ${3:element} = ${2:object}[${1:key}];",
+ "\t\t$TM_SELECTED_TEXT$0",
+ "\t}",
+ "}"
+ ],
+ "description": "For-In Loop"
+ },
+ "For-Of Loop": {
+ "prefix": "forof",
+ "body": [
+ "for (const ${1:iterator} of ${2:object}) {",
+ "\t$TM_SELECTED_TEXT$0",
+ "}"
+ ],
+ "description": "For-Of Loop"
+ },
+ "Function Statement": {
+ "prefix": "function",
+ "body": [
+ "function ${1:name}(${2:params}) {",
+ "\t$TM_SELECTED_TEXT$0",
+ "}"
+ ],
+ "description": "Function Statement"
+ },
+ "If Statement": {
+ "prefix": "if",
+ "body": [
+ "if (${1:condition}) {",
+ "\t$TM_SELECTED_TEXT$0",
+ "}"
+ ],
+ "description": "If Statement"
+ },
+ "If-Else Statement": {
+ "prefix": "ifelse",
+ "body": [
+ "if (${1:condition}) {",
+ "\t$TM_SELECTED_TEXT$0",
+ "} else {",
+ "\t",
+ "}"
+ ],
+ "description": "If-Else Statement"
+ },
+ "New Statement": {
+ "prefix": "new",
+ "body": [
+ "const ${1:name} = new ${2:type}(${3: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$TM_SELECTED_TEXT$0",
+ "}"
+ ],
+ "description": "While Statement"
+ },
+ "Do-While Statement": {
+ "prefix": "dowhile",
+ "body": [
+ "do {",
+ "\t$TM_SELECTED_TEXT$0",
+ "} while (${1:condition});"
+ ],
+ "description": "Do-While Statement"
+ },
+ "Try-Catch Statement": {
+ "prefix": "trycatch",
+ "body": [
+ "try {",
+ "\t$TM_SELECTED_TEXT$0",
+ "} catch (${1:error}) {",
+ "\t",
+ "}"
+ ],
+ "description": "Try-Catch Statement"
+ },
+ "Set Timeout Function": {
+ "prefix": "settimeout",
+ "body": [
+ "setTimeout(() => {",
+ "\t$TM_SELECTED_TEXT$0",
+ "}, ${1:timeout});"
+ ],
+ "description": "Set Timeout Function"
+ },
+ "Set Interval Function": {
+ "prefix": "setinterval",
+ "body": [
+ "setInterval(() => {",
+ "\t$TM_SELECTED_TEXT$0",
+ "}, ${1:interval});"
+ ],
+ "description": "Set Interval Function"
+ },
+ "Import external module.": {
+ "prefix": "import statement",
+ "body": [
+ "import { $0 } from \"${1:module}\";"
+ ],
+ "description": "Import external module."
+ },
+ "Region Start": {
+ "prefix": "#region",
+ "body": [
+ "//#region $0"
+ ],
+ "description": "Folding Region Start"
+ },
+ "Region End": {
+ "prefix": "#endregion",
+ "body": [
+ "//#endregion"
+ ],
+ "description": "Folding Region End"
+ },
+ "Log to the console": {
+ "prefix": "log",
+ "body": [
+ "console.log($1);"
+ ],
+ "description": "Log to the console"
+ },
+ "Log warning to console": {
+ "prefix": "warn",
+ "body": [
+ "console.warn($1);"
+ ],
+ "description": "Log warning to the console"
+ },
+ "Log error to console": {
+ "prefix": "error",
+ "body": [
+ "console.error($1);"
+ ],
+ "description": "Log error to the console"
+ }
+}