@enjoys/context-engine 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/commands/adb.json +322 -0
- package/data/commands/alembic.json +301 -0
- package/data/commands/artisan.json +277 -0
- package/data/commands/atlas.json +426 -0
- package/data/commands/auth0.json +648 -0
- package/data/commands/bat.json +84 -0
- package/data/commands/btop.json +59 -0
- package/data/commands/bundle.json +321 -0
- package/data/commands/composer.json +507 -0
- package/data/commands/dart.json +216 -0
- package/data/commands/dbmate.json +257 -0
- package/data/commands/docker-compose.json +384 -0
- package/data/commands/drizzle-kit.json +217 -0
- package/data/commands/expo.json +65 -0
- package/data/commands/fastlane.json +243 -0
- package/data/commands/fd.json +86 -0
- package/data/commands/flutter.json +298 -0
- package/data/commands/flyway.json +261 -0
- package/data/commands/fzf.json +103 -0
- package/data/commands/gem.json +267 -0
- package/data/commands/htop.json +56 -0
- package/data/commands/jq.json +100 -0
- package/data/commands/k9s.json +62 -0
- package/data/commands/linux.json +3007 -0
- package/data/commands/liquibase.json +399 -0
- package/data/commands/manifest.json +619 -0
- package/data/commands/minikube.json +60 -0
- package/data/commands/ng.json +64 -0
- package/data/commands/nuxt.json +60 -0
- package/data/commands/nvim.json +91 -0
- package/data/commands/php.json +157 -0
- package/data/commands/pm2.json +259 -0
- package/data/commands/pod.json +175 -0
- package/data/commands/prisma.json +257 -0
- package/data/commands/rails.json +372 -0
- package/data/commands/rake.json +360 -0
- package/data/commands/react-native.json +57 -0
- package/data/commands/rg.json +103 -0
- package/data/commands/rspec.json +257 -0
- package/data/commands/ruby.json +108 -0
- package/data/commands/screen.json +101 -0
- package/data/commands/sequelize.json +342 -0
- package/data/commands/snyk.json +442 -0
- package/data/commands/sonar-scanner.json +219 -0
- package/data/commands/stripe.json +314 -0
- package/data/commands/symfony.json +449 -0
- package/data/commands/tmux.json +197 -0
- package/data/commands/top.json +61 -0
- package/data/commands/trivy.json +367 -0
- package/data/commands/twilio.json +382 -0
- package/data/commands/typeorm.json +262 -0
- package/data/commands/vim.json +85 -0
- package/data/commands/vue.json +60 -0
- package/data/commands/wp.json +857 -0
- package/data/commands/xcodebuild.json +141 -0
- package/data/commands/yq.json +57 -0
- package/data/completion/bash.json +1184 -0
- package/data/completion/c.json +1067 -0
- package/data/completion/cpp.json +824 -0
- package/data/completion/csharp.json +860 -0
- package/data/completion/dockerfile.json +536 -0
- package/data/completion/go.json +1346 -0
- package/data/completion/html.json +806 -0
- package/data/completion/java.json +1112 -0
- package/data/completion/javascript.json +914 -0
- package/data/completion/lua.json +968 -0
- package/data/completion/php.json +1535 -0
- package/data/completion/python.json +1427 -0
- package/data/completion/ruby.json +1531 -0
- package/data/completion/rust.json +698 -0
- package/data/completion/sql.json +887 -0
- package/data/completion/toml.json +428 -0
- package/data/completion/typescript.json +338 -0
- package/data/completion/yaml.json +563 -0
- package/data/defination/bash.json +565 -0
- package/data/defination/c.json +865 -0
- package/data/defination/cpp.json +348 -0
- package/data/defination/csharp.json +144 -0
- package/data/defination/dockerfile.json +113 -0
- package/data/defination/go.json +561 -0
- package/data/defination/html.json +559 -0
- package/data/defination/java.json +184 -0
- package/data/defination/javascript.json +265 -0
- package/data/defination/lua.json +181 -0
- package/data/defination/php.json +726 -0
- package/data/defination/python.json +717 -0
- package/data/defination/ruby.json +670 -0
- package/data/defination/rust.json +207 -0
- package/data/defination/sql.json +473 -0
- package/data/defination/toml.json +251 -0
- package/data/defination/typescript.json +29 -0
- package/data/defination/yaml.json +197 -0
- package/data/hover/bash.json +245 -0
- package/data/hover/c.json +265 -0
- package/data/hover/cpp.json +210 -0
- package/data/hover/csharp.json +290 -0
- package/data/hover/dockerfile.json +145 -0
- package/data/hover/go.json +580 -0
- package/data/hover/html.json +250 -0
- package/data/hover/java.json +395 -0
- package/data/hover/javascript.json +330 -0
- package/data/hover/lua.json +265 -0
- package/data/hover/php.json +300 -0
- package/data/hover/python.json +380 -0
- package/data/hover/ruby.json +265 -0
- package/data/hover/rust.json +275 -0
- package/data/hover/sql.json +230 -0
- package/data/hover/toml.json +145 -0
- package/data/hover/typescript.json +120 -0
- package/data/hover/yaml.json +165 -0
- package/data/manifest.json +242 -0
- package/package.json +1 -1
|
@@ -0,0 +1,914 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "javascript",
|
|
3
|
+
"completions": [
|
|
4
|
+
{
|
|
5
|
+
"label": "console.log",
|
|
6
|
+
"kind": 1,
|
|
7
|
+
"detail": "Log output to console",
|
|
8
|
+
"documentation": { "value": "Outputs a message to the web console.\n\n```js\nconsole.log('Hello, world!');\nconsole.log('Value:', myVar);\n```" },
|
|
9
|
+
"insertText": "console.log(${1:message})",
|
|
10
|
+
"insertTextRules": 4,
|
|
11
|
+
"sortText": "00_console_log"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"label": "console.error",
|
|
15
|
+
"kind": 1,
|
|
16
|
+
"detail": "Log error to console",
|
|
17
|
+
"documentation": { "value": "Outputs an error message to the web console.\n\n```js\nconsole.error('Something went wrong:', err);\n```" },
|
|
18
|
+
"insertText": "console.error(${1:message})",
|
|
19
|
+
"insertTextRules": 4,
|
|
20
|
+
"sortText": "00_console_error"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"label": "console.warn",
|
|
24
|
+
"kind": 1,
|
|
25
|
+
"detail": "Log warning to console",
|
|
26
|
+
"documentation": { "value": "Outputs a warning message to the web console.\n\n```js\nconsole.warn('Deprecation notice:', msg);\n```" },
|
|
27
|
+
"insertText": "console.warn(${1:message})",
|
|
28
|
+
"insertTextRules": 4,
|
|
29
|
+
"sortText": "00_console_warn"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"label": "console.info",
|
|
33
|
+
"kind": 1,
|
|
34
|
+
"detail": "Log informational message",
|
|
35
|
+
"documentation": { "value": "Outputs an informational message to the console.\n\n```js\nconsole.info('Server started on port', port);\n```" },
|
|
36
|
+
"insertText": "console.info(${1:message})",
|
|
37
|
+
"insertTextRules": 4,
|
|
38
|
+
"sortText": "00_console_info"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"label": "console.table",
|
|
42
|
+
"kind": 1,
|
|
43
|
+
"detail": "Display tabular data",
|
|
44
|
+
"documentation": { "value": "Displays tabular data as a table in the console.\n\n```js\nconsole.table([{ name: 'Alice', age: 30 }, { name: 'Bob', age: 25 }]);\n```" },
|
|
45
|
+
"insertText": "console.table(${1:data})",
|
|
46
|
+
"insertTextRules": 4,
|
|
47
|
+
"sortText": "00_console_table"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"label": "console.dir",
|
|
51
|
+
"kind": 1,
|
|
52
|
+
"detail": "Display object properties",
|
|
53
|
+
"documentation": { "value": "Displays an interactive listing of the properties of a specified JavaScript object.\n\n```js\nconsole.dir(document.body, { depth: 2 });\n```" },
|
|
54
|
+
"insertText": "console.dir(${1:obj})",
|
|
55
|
+
"insertTextRules": 4,
|
|
56
|
+
"sortText": "00_console_dir"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"label": "console.time",
|
|
60
|
+
"kind": 1,
|
|
61
|
+
"detail": "Start a timer",
|
|
62
|
+
"documentation": { "value": "Starts a timer you can use to track how long an operation takes.\n\n```js\nconsole.time('myTimer');\n// ...operation...\nconsole.timeEnd('myTimer');\n```" },
|
|
63
|
+
"insertText": "console.time('${1:label}')",
|
|
64
|
+
"insertTextRules": 4,
|
|
65
|
+
"sortText": "00_console_time"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"label": "console.timeEnd",
|
|
69
|
+
"kind": 1,
|
|
70
|
+
"detail": "Stop a timer",
|
|
71
|
+
"documentation": { "value": "Stops a timer that was previously started by calling `console.time()`.\n\n```js\nconsole.timeEnd('myTimer');\n```" },
|
|
72
|
+
"insertText": "console.timeEnd('${1:label}')",
|
|
73
|
+
"insertTextRules": 4,
|
|
74
|
+
"sortText": "00_console_timeEnd"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"label": "console.assert",
|
|
78
|
+
"kind": 1,
|
|
79
|
+
"detail": "Assert a condition",
|
|
80
|
+
"documentation": { "value": "Log a message and stack trace if the first argument is falsy.\n\n```js\nconsole.assert(x > 0, 'x must be positive');\n```" },
|
|
81
|
+
"insertText": "console.assert(${1:condition}, ${2:message})",
|
|
82
|
+
"insertTextRules": 4,
|
|
83
|
+
"sortText": "00_console_assert"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"label": "console.group",
|
|
87
|
+
"kind": 1,
|
|
88
|
+
"detail": "Start a console group",
|
|
89
|
+
"documentation": { "value": "Creates a new inline group in the console, indenting subsequent messages.\n\n```js\nconsole.group('Details');\nconsole.log('Name:', name);\nconsole.groupEnd();\n```" },
|
|
90
|
+
"insertText": "console.group('${1:label}');\n${2}\nconsole.groupEnd();",
|
|
91
|
+
"insertTextRules": 4,
|
|
92
|
+
"sortText": "00_console_group"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"label": "JSON.parse",
|
|
96
|
+
"kind": 1,
|
|
97
|
+
"detail": "Parse JSON string to object",
|
|
98
|
+
"documentation": { "value": "Parses a JSON string and returns the JavaScript value or object described by the string.\n\n```js\nconst obj = JSON.parse('{\"name\":\"Alice\"}');\n```\n\n**Throws** `SyntaxError` if the string is not valid JSON." },
|
|
99
|
+
"insertText": "JSON.parse(${1:text})",
|
|
100
|
+
"insertTextRules": 4,
|
|
101
|
+
"sortText": "01_json_parse"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"label": "JSON.stringify",
|
|
105
|
+
"kind": 1,
|
|
106
|
+
"detail": "Convert object to JSON string",
|
|
107
|
+
"documentation": { "value": "Converts a JavaScript value to a JSON string.\n\n```js\nconst json = JSON.stringify(obj, null, 2);\n```\n\n**Parameters:**\n- `value` — The value to convert\n- `replacer` — A function or array of strings to filter properties\n- `space` — Number of spaces for indentation" },
|
|
108
|
+
"insertText": "JSON.stringify(${1:value}, ${2:null}, ${3:2})",
|
|
109
|
+
"insertTextRules": 4,
|
|
110
|
+
"sortText": "01_json_stringify"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"label": "Array.from",
|
|
114
|
+
"kind": 1,
|
|
115
|
+
"detail": "Create array from iterable",
|
|
116
|
+
"documentation": { "value": "Creates a new, shallow-copied Array instance from an iterable or array-like object.\n\n```js\nArray.from('hello'); // ['h','e','l','l','o']\nArray.from({length: 3}, (_, i) => i); // [0, 1, 2]\n```" },
|
|
117
|
+
"insertText": "Array.from(${1:iterable})",
|
|
118
|
+
"insertTextRules": 4,
|
|
119
|
+
"sortText": "01_array_from"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"label": "Array.isArray",
|
|
123
|
+
"kind": 1,
|
|
124
|
+
"detail": "Check if value is an array",
|
|
125
|
+
"documentation": { "value": "Determines whether the passed value is an Array.\n\n```js\nArray.isArray([1, 2, 3]); // true\nArray.isArray('string'); // false\n```" },
|
|
126
|
+
"insertText": "Array.isArray(${1:value})",
|
|
127
|
+
"insertTextRules": 4,
|
|
128
|
+
"sortText": "01_array_isArray"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"label": ".map",
|
|
132
|
+
"kind": 0,
|
|
133
|
+
"detail": "Array.prototype.map()",
|
|
134
|
+
"documentation": { "value": "Creates a new array with the results of calling a function on every element.\n\n```js\nconst doubled = [1,2,3].map(x => x * 2); // [2,4,6]\n```" },
|
|
135
|
+
"insertText": ".map((${1:item}) => ${2})",
|
|
136
|
+
"insertTextRules": 4,
|
|
137
|
+
"sortText": "02_map"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"label": ".filter",
|
|
141
|
+
"kind": 0,
|
|
142
|
+
"detail": "Array.prototype.filter()",
|
|
143
|
+
"documentation": { "value": "Creates a new array with all elements that pass the test implemented by the provided function.\n\n```js\nconst evens = [1,2,3,4].filter(x => x % 2 === 0); // [2,4]\n```" },
|
|
144
|
+
"insertText": ".filter((${1:item}) => ${2})",
|
|
145
|
+
"insertTextRules": 4,
|
|
146
|
+
"sortText": "02_filter"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"label": ".reduce",
|
|
150
|
+
"kind": 0,
|
|
151
|
+
"detail": "Array.prototype.reduce()",
|
|
152
|
+
"documentation": { "value": "Executes a reducer function on each element, resulting in a single output value.\n\n```js\nconst sum = [1,2,3].reduce((acc, val) => acc + val, 0); // 6\n```" },
|
|
153
|
+
"insertText": ".reduce((${1:acc}, ${2:val}) => ${3}, ${4:initialValue})",
|
|
154
|
+
"insertTextRules": 4,
|
|
155
|
+
"sortText": "02_reduce"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"label": ".forEach",
|
|
159
|
+
"kind": 0,
|
|
160
|
+
"detail": "Array.prototype.forEach()",
|
|
161
|
+
"documentation": { "value": "Executes a provided function once for each array element.\n\n```js\n[1,2,3].forEach(item => console.log(item));\n```" },
|
|
162
|
+
"insertText": ".forEach((${1:item}) => {\n\t${2}\n})",
|
|
163
|
+
"insertTextRules": 4,
|
|
164
|
+
"sortText": "02_forEach"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"label": ".find",
|
|
168
|
+
"kind": 0,
|
|
169
|
+
"detail": "Array.prototype.find()",
|
|
170
|
+
"documentation": { "value": "Returns the first element in the array that satisfies the provided testing function.\n\n```js\nconst found = [1,5,10].find(x => x > 3); // 5\n```" },
|
|
171
|
+
"insertText": ".find((${1:item}) => ${2})",
|
|
172
|
+
"insertTextRules": 4,
|
|
173
|
+
"sortText": "02_find"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"label": ".findIndex",
|
|
177
|
+
"kind": 0,
|
|
178
|
+
"detail": "Array.prototype.findIndex()",
|
|
179
|
+
"documentation": { "value": "Returns the index of the first element that satisfies the provided testing function. Returns -1 if not found.\n\n```js\nconst idx = [1,5,10].findIndex(x => x > 3); // 1\n```" },
|
|
180
|
+
"insertText": ".findIndex((${1:item}) => ${2})",
|
|
181
|
+
"insertTextRules": 4,
|
|
182
|
+
"sortText": "02_findIndex"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"label": ".some",
|
|
186
|
+
"kind": 0,
|
|
187
|
+
"detail": "Array.prototype.some()",
|
|
188
|
+
"documentation": { "value": "Tests whether at least one element passes the provided function.\n\n```js\n[1,2,3].some(x => x > 2); // true\n```" },
|
|
189
|
+
"insertText": ".some((${1:item}) => ${2})",
|
|
190
|
+
"insertTextRules": 4,
|
|
191
|
+
"sortText": "02_some"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"label": ".every",
|
|
195
|
+
"kind": 0,
|
|
196
|
+
"detail": "Array.prototype.every()",
|
|
197
|
+
"documentation": { "value": "Tests whether all elements pass the provided function.\n\n```js\n[2,4,6].every(x => x % 2 === 0); // true\n```" },
|
|
198
|
+
"insertText": ".every((${1:item}) => ${2})",
|
|
199
|
+
"insertTextRules": 4,
|
|
200
|
+
"sortText": "02_every"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"label": ".includes",
|
|
204
|
+
"kind": 0,
|
|
205
|
+
"detail": "Array.prototype.includes()",
|
|
206
|
+
"documentation": { "value": "Determines whether an array includes a certain value.\n\n```js\n[1,2,3].includes(2); // true\n```" },
|
|
207
|
+
"insertText": ".includes(${1:value})",
|
|
208
|
+
"insertTextRules": 4,
|
|
209
|
+
"sortText": "02_includes"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"label": ".flat",
|
|
213
|
+
"kind": 0,
|
|
214
|
+
"detail": "Array.prototype.flat()",
|
|
215
|
+
"documentation": { "value": "Creates a new array with all sub-array elements concatenated into it recursively up to the specified depth.\n\n```js\n[1, [2, [3]]].flat(Infinity); // [1, 2, 3]\n```" },
|
|
216
|
+
"insertText": ".flat(${1:depth})",
|
|
217
|
+
"insertTextRules": 4,
|
|
218
|
+
"sortText": "02_flat"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"label": ".flatMap",
|
|
222
|
+
"kind": 0,
|
|
223
|
+
"detail": "Array.prototype.flatMap()",
|
|
224
|
+
"documentation": { "value": "Maps each element using a mapping function, then flattens the result into a new array.\n\n```js\n[1,2,3].flatMap(x => [x, x*2]); // [1,2,2,4,3,6]\n```" },
|
|
225
|
+
"insertText": ".flatMap((${1:item}) => ${2})",
|
|
226
|
+
"insertTextRules": 4,
|
|
227
|
+
"sortText": "02_flatMap"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"label": ".sort",
|
|
231
|
+
"kind": 0,
|
|
232
|
+
"detail": "Array.prototype.sort()",
|
|
233
|
+
"documentation": { "value": "Sorts the elements of an array in place and returns the sorted array.\n\n```js\n[3,1,2].sort((a, b) => a - b); // [1,2,3]\n```" },
|
|
234
|
+
"insertText": ".sort((${1:a}, ${2:b}) => ${3:a - b})",
|
|
235
|
+
"insertTextRules": 4,
|
|
236
|
+
"sortText": "02_sort"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"label": ".splice",
|
|
240
|
+
"kind": 0,
|
|
241
|
+
"detail": "Array.prototype.splice()",
|
|
242
|
+
"documentation": { "value": "Changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.\n\n```js\nconst arr = [1,2,3,4];\narr.splice(1, 2); // removes 2 elements starting at index 1\n```" },
|
|
243
|
+
"insertText": ".splice(${1:start}, ${2:deleteCount})",
|
|
244
|
+
"insertTextRules": 4,
|
|
245
|
+
"sortText": "02_splice"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"label": ".slice",
|
|
249
|
+
"kind": 0,
|
|
250
|
+
"detail": "Array.prototype.slice()",
|
|
251
|
+
"documentation": { "value": "Returns a shallow copy of a portion of an array.\n\n```js\n[1,2,3,4].slice(1, 3); // [2, 3]\n```" },
|
|
252
|
+
"insertText": ".slice(${1:start}, ${2:end})",
|
|
253
|
+
"insertTextRules": 4,
|
|
254
|
+
"sortText": "02_slice"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"label": "Object.keys",
|
|
258
|
+
"kind": 1,
|
|
259
|
+
"detail": "Get object's own property names",
|
|
260
|
+
"documentation": { "value": "Returns an array of a given object's own enumerable property names.\n\n```js\nObject.keys({ a: 1, b: 2 }); // ['a', 'b']\n```" },
|
|
261
|
+
"insertText": "Object.keys(${1:obj})",
|
|
262
|
+
"insertTextRules": 4,
|
|
263
|
+
"sortText": "01_object_keys"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"label": "Object.values",
|
|
267
|
+
"kind": 1,
|
|
268
|
+
"detail": "Get object's own property values",
|
|
269
|
+
"documentation": { "value": "Returns an array of a given object's own enumerable property values.\n\n```js\nObject.values({ a: 1, b: 2 }); // [1, 2]\n```" },
|
|
270
|
+
"insertText": "Object.values(${1:obj})",
|
|
271
|
+
"insertTextRules": 4,
|
|
272
|
+
"sortText": "01_object_values"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"label": "Object.entries",
|
|
276
|
+
"kind": 1,
|
|
277
|
+
"detail": "Get object's own [key, value] pairs",
|
|
278
|
+
"documentation": { "value": "Returns an array of a given object's own enumerable [key, value] pairs.\n\n```js\nObject.entries({ a: 1, b: 2 }); // [['a',1], ['b',2]]\n```" },
|
|
279
|
+
"insertText": "Object.entries(${1:obj})",
|
|
280
|
+
"insertTextRules": 4,
|
|
281
|
+
"sortText": "01_object_entries"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"label": "Object.assign",
|
|
285
|
+
"kind": 1,
|
|
286
|
+
"detail": "Copy properties to target object",
|
|
287
|
+
"documentation": { "value": "Copies all enumerable own properties from one or more source objects to a target object.\n\n```js\nconst merged = Object.assign({}, defaults, options);\n```" },
|
|
288
|
+
"insertText": "Object.assign(${1:target}, ${2:source})",
|
|
289
|
+
"insertTextRules": 4,
|
|
290
|
+
"sortText": "01_object_assign"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"label": "Object.freeze",
|
|
294
|
+
"kind": 1,
|
|
295
|
+
"detail": "Freeze an object",
|
|
296
|
+
"documentation": { "value": "Freezes an object. A frozen object can no longer be changed.\n\n```js\nconst config = Object.freeze({ port: 3000, host: 'localhost' });\n```" },
|
|
297
|
+
"insertText": "Object.freeze(${1:obj})",
|
|
298
|
+
"insertTextRules": 4,
|
|
299
|
+
"sortText": "01_object_freeze"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"label": "Object.fromEntries",
|
|
303
|
+
"kind": 1,
|
|
304
|
+
"detail": "Create object from entries",
|
|
305
|
+
"documentation": { "value": "Transforms a list of key-value pairs into an object.\n\n```js\nObject.fromEntries([['a', 1], ['b', 2]]); // { a: 1, b: 2 }\nObject.fromEntries(new Map([['a', 1]]));\n```" },
|
|
306
|
+
"insertText": "Object.fromEntries(${1:entries})",
|
|
307
|
+
"insertTextRules": 4,
|
|
308
|
+
"sortText": "01_object_fromEntries"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"label": "Promise",
|
|
312
|
+
"kind": 5,
|
|
313
|
+
"detail": "Promise constructor",
|
|
314
|
+
"documentation": { "value": "Creates a new Promise object.\n\n```js\nconst p = new Promise((resolve, reject) => {\n // async operation\n resolve(result);\n});\n```" },
|
|
315
|
+
"insertText": "new Promise((resolve, reject) => {\n\t${1}\n})",
|
|
316
|
+
"insertTextRules": 4,
|
|
317
|
+
"sortText": "01_promise"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"label": "Promise.all",
|
|
321
|
+
"kind": 1,
|
|
322
|
+
"detail": "Wait for all promises",
|
|
323
|
+
"documentation": { "value": "Takes an iterable of promises and returns a single Promise that resolves when all have resolved.\n\n```js\nconst [a, b] = await Promise.all([fetchA(), fetchB()]);\n```" },
|
|
324
|
+
"insertText": "Promise.all([${1}])",
|
|
325
|
+
"insertTextRules": 4,
|
|
326
|
+
"sortText": "01_promise_all"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"label": "Promise.allSettled",
|
|
330
|
+
"kind": 1,
|
|
331
|
+
"detail": "Wait for all promises to settle",
|
|
332
|
+
"documentation": { "value": "Returns a promise that resolves after all given promises have either fulfilled or rejected.\n\n```js\nconst results = await Promise.allSettled([p1, p2, p3]);\nresults.forEach(r => console.log(r.status)); // 'fulfilled' or 'rejected'\n```" },
|
|
333
|
+
"insertText": "Promise.allSettled([${1}])",
|
|
334
|
+
"insertTextRules": 4,
|
|
335
|
+
"sortText": "01_promise_allSettled"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"label": "Promise.race",
|
|
339
|
+
"kind": 1,
|
|
340
|
+
"detail": "First promise to settle wins",
|
|
341
|
+
"documentation": { "value": "Returns a promise that fulfills or rejects as soon as one of the promises settles.\n\n```js\nconst result = await Promise.race([fetch(url), timeout(5000)]);\n```" },
|
|
342
|
+
"insertText": "Promise.race([${1}])",
|
|
343
|
+
"insertTextRules": 4,
|
|
344
|
+
"sortText": "01_promise_race"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"label": "Promise.any",
|
|
348
|
+
"kind": 1,
|
|
349
|
+
"detail": "First fulfilled promise",
|
|
350
|
+
"documentation": { "value": "Takes an iterable of promises and returns the first one that fulfills. Only rejects if all reject.\n\n```js\nconst fastest = await Promise.any([mirror1(), mirror2()]);\n```" },
|
|
351
|
+
"insertText": "Promise.any([${1}])",
|
|
352
|
+
"insertTextRules": 4,
|
|
353
|
+
"sortText": "01_promise_any"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"label": "fetch",
|
|
357
|
+
"kind": 1,
|
|
358
|
+
"detail": "Fetch API - HTTP requests",
|
|
359
|
+
"documentation": { "value": "Starts the process of fetching a resource from the network, returning a promise.\n\n```js\nconst response = await fetch('https://api.example.com/data');\nconst data = await response.json();\n```" },
|
|
360
|
+
"insertText": "fetch('${1:url}'${2:, {\n\tmethod: '${3:GET}',\n\theaders: { 'Content-Type': 'application/json' },\n\tbody: JSON.stringify(${4:data})\n\\}})",
|
|
361
|
+
"insertTextRules": 4,
|
|
362
|
+
"sortText": "00_fetch"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"label": "setTimeout",
|
|
366
|
+
"kind": 1,
|
|
367
|
+
"detail": "Execute after delay",
|
|
368
|
+
"documentation": { "value": "Sets a timer which executes a function once the timer expires.\n\n```js\nsetTimeout(() => {\n console.log('Delayed!');\n}, 1000);\n```" },
|
|
369
|
+
"insertText": "setTimeout(() => {\n\t${1}\n}, ${2:1000})",
|
|
370
|
+
"insertTextRules": 4,
|
|
371
|
+
"sortText": "01_setTimeout"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"label": "setInterval",
|
|
375
|
+
"kind": 1,
|
|
376
|
+
"detail": "Execute repeatedly at interval",
|
|
377
|
+
"documentation": { "value": "Repeatedly calls a function with a fixed time delay between each call.\n\n```js\nconst id = setInterval(() => {\n console.log('Tick');\n}, 1000);\nclearInterval(id);\n```" },
|
|
378
|
+
"insertText": "setInterval(() => {\n\t${1}\n}, ${2:1000})",
|
|
379
|
+
"insertTextRules": 4,
|
|
380
|
+
"sortText": "01_setInterval"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"label": "parseInt",
|
|
384
|
+
"kind": 1,
|
|
385
|
+
"detail": "Parse string to integer",
|
|
386
|
+
"documentation": { "value": "Parses a string argument and returns an integer of the specified radix.\n\n```js\nparseInt('42'); // 42\nparseInt('0xFF', 16); // 255\n```" },
|
|
387
|
+
"insertText": "parseInt(${1:string}, ${2:10})",
|
|
388
|
+
"insertTextRules": 4,
|
|
389
|
+
"sortText": "01_parseInt"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"label": "parseFloat",
|
|
393
|
+
"kind": 1,
|
|
394
|
+
"detail": "Parse string to float",
|
|
395
|
+
"documentation": { "value": "Parses a string and returns a floating point number.\n\n```js\nparseFloat('3.14'); // 3.14\n```" },
|
|
396
|
+
"insertText": "parseFloat(${1:string})",
|
|
397
|
+
"insertTextRules": 4,
|
|
398
|
+
"sortText": "01_parseFloat"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"label": "Number.isNaN",
|
|
402
|
+
"kind": 1,
|
|
403
|
+
"detail": "Check if value is NaN",
|
|
404
|
+
"documentation": { "value": "Determines whether the passed value is NaN (more reliable than global `isNaN`).\n\n```js\nNumber.isNaN(NaN); // true\nNumber.isNaN(undefined); // false\n```" },
|
|
405
|
+
"insertText": "Number.isNaN(${1:value})",
|
|
406
|
+
"insertTextRules": 4,
|
|
407
|
+
"sortText": "01_number_isNaN"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"label": "Number.isFinite",
|
|
411
|
+
"kind": 1,
|
|
412
|
+
"detail": "Check if value is finite",
|
|
413
|
+
"documentation": { "value": "Determines whether the passed value is a finite number.\n\n```js\nNumber.isFinite(42); // true\nNumber.isFinite(Infinity); // false\n```" },
|
|
414
|
+
"insertText": "Number.isFinite(${1:value})",
|
|
415
|
+
"insertTextRules": 4,
|
|
416
|
+
"sortText": "01_number_isFinite"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"label": "Math.max",
|
|
420
|
+
"kind": 1,
|
|
421
|
+
"detail": "Return the largest value",
|
|
422
|
+
"documentation": { "value": "Returns the largest of zero or more numbers.\n\n```js\nMath.max(1, 5, 3); // 5\nMath.max(...[1, 5, 3]); // 5\n```" },
|
|
423
|
+
"insertText": "Math.max(${1})",
|
|
424
|
+
"insertTextRules": 4,
|
|
425
|
+
"sortText": "01_math_max"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"label": "Math.min",
|
|
429
|
+
"kind": 1,
|
|
430
|
+
"detail": "Return the smallest value",
|
|
431
|
+
"documentation": { "value": "Returns the smallest of zero or more numbers.\n\n```js\nMath.min(1, 5, 3); // 1\nMath.min(...[1, 5, 3]); // 1\n```" },
|
|
432
|
+
"insertText": "Math.min(${1})",
|
|
433
|
+
"insertTextRules": 4,
|
|
434
|
+
"sortText": "01_math_min"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"label": "Math.floor",
|
|
438
|
+
"kind": 1,
|
|
439
|
+
"detail": "Round down to integer",
|
|
440
|
+
"documentation": { "value": "Returns the largest integer less than or equal to a given number.\n\n```js\nMath.floor(4.7); // 4\nMath.floor(-4.1); // -5\n```" },
|
|
441
|
+
"insertText": "Math.floor(${1:value})",
|
|
442
|
+
"insertTextRules": 4,
|
|
443
|
+
"sortText": "01_math_floor"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"label": "Math.ceil",
|
|
447
|
+
"kind": 1,
|
|
448
|
+
"detail": "Round up to integer",
|
|
449
|
+
"documentation": { "value": "Returns the smallest integer greater than or equal to a given number.\n\n```js\nMath.ceil(4.1); // 5\n```" },
|
|
450
|
+
"insertText": "Math.ceil(${1:value})",
|
|
451
|
+
"insertTextRules": 4,
|
|
452
|
+
"sortText": "01_math_ceil"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"label": "Math.round",
|
|
456
|
+
"kind": 1,
|
|
457
|
+
"detail": "Round to nearest integer",
|
|
458
|
+
"documentation": { "value": "Returns the value of a number rounded to the nearest integer.\n\n```js\nMath.round(4.5); // 5\nMath.round(4.4); // 4\n```" },
|
|
459
|
+
"insertText": "Math.round(${1:value})",
|
|
460
|
+
"insertTextRules": 4,
|
|
461
|
+
"sortText": "01_math_round"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"label": "Math.random",
|
|
465
|
+
"kind": 1,
|
|
466
|
+
"detail": "Random number [0, 1)",
|
|
467
|
+
"documentation": { "value": "Returns a pseudo-random number between 0 (inclusive) and 1 (exclusive).\n\n```js\nconst rand = Math.random();\nconst randInt = Math.floor(Math.random() * 10); // 0-9\n```" },
|
|
468
|
+
"insertText": "Math.random()",
|
|
469
|
+
"insertTextRules": 4,
|
|
470
|
+
"sortText": "01_math_random"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"label": "Map",
|
|
474
|
+
"kind": 5,
|
|
475
|
+
"detail": "Map constructor",
|
|
476
|
+
"documentation": { "value": "The `Map` object holds key-value pairs and remembers the original insertion order.\n\n```js\nconst map = new Map();\nmap.set('key', 'value');\nmap.get('key'); // 'value'\nmap.has('key'); // true\nmap.size; // 1\n```" },
|
|
477
|
+
"insertText": "new Map(${1})",
|
|
478
|
+
"insertTextRules": 4,
|
|
479
|
+
"sortText": "01_map"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"label": "Set",
|
|
483
|
+
"kind": 5,
|
|
484
|
+
"detail": "Set constructor",
|
|
485
|
+
"documentation": { "value": "The `Set` object lets you store unique values of any type.\n\n```js\nconst set = new Set([1, 2, 3, 2]);\nset.size; // 3\nset.has(2); // true\nset.add(4);\n```" },
|
|
486
|
+
"insertText": "new Set(${1})",
|
|
487
|
+
"insertTextRules": 4,
|
|
488
|
+
"sortText": "01_set"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"label": "WeakMap",
|
|
492
|
+
"kind": 5,
|
|
493
|
+
"detail": "WeakMap constructor",
|
|
494
|
+
"documentation": { "value": "A `WeakMap` is a collection of key/value pairs whose keys must be objects, held weakly (allow garbage collection).\n\n```js\nconst wm = new WeakMap();\nconst obj = {};\nwm.set(obj, 'metadata');\n```" },
|
|
495
|
+
"insertText": "new WeakMap()",
|
|
496
|
+
"insertTextRules": 4,
|
|
497
|
+
"sortText": "01_weakmap"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"label": "WeakSet",
|
|
501
|
+
"kind": 5,
|
|
502
|
+
"detail": "WeakSet constructor",
|
|
503
|
+
"documentation": { "value": "A `WeakSet` is a collection of objects, held weakly.\n\n```js\nconst ws = new WeakSet();\nconst obj = {};\nws.add(obj);\nws.has(obj); // true\n```" },
|
|
504
|
+
"insertText": "new WeakSet()",
|
|
505
|
+
"insertTextRules": 4,
|
|
506
|
+
"sortText": "01_weakset"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"label": "structuredClone",
|
|
510
|
+
"kind": 1,
|
|
511
|
+
"detail": "Deep clone a value",
|
|
512
|
+
"documentation": { "value": "Creates a deep clone of a given value using the structured clone algorithm.\n\n```js\nconst clone = structuredClone({ nested: { data: [1, 2] } });\n```" },
|
|
513
|
+
"insertText": "structuredClone(${1:value})",
|
|
514
|
+
"insertTextRules": 4,
|
|
515
|
+
"sortText": "00_structuredClone"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"label": "queueMicrotask",
|
|
519
|
+
"kind": 1,
|
|
520
|
+
"detail": "Queue a microtask",
|
|
521
|
+
"documentation": { "value": "Queues a microtask to be executed before control returns to the event loop.\n\n```js\nqueueMicrotask(() => {\n console.log('Runs as microtask');\n});\n```" },
|
|
522
|
+
"insertText": "queueMicrotask(() => {\n\t${1}\n})",
|
|
523
|
+
"insertTextRules": 4,
|
|
524
|
+
"sortText": "01_queueMicrotask"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"label": "globalThis",
|
|
528
|
+
"kind": 4,
|
|
529
|
+
"detail": "Global this value",
|
|
530
|
+
"documentation": { "value": "The `globalThis` property provides a standard way of accessing the global `this` value across environments.\n\n```js\nglobalThis.myGlobal = 42;\n```" },
|
|
531
|
+
"insertText": "globalThis",
|
|
532
|
+
"insertTextRules": 1,
|
|
533
|
+
"sortText": "01_globalThis"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"label": "Symbol",
|
|
537
|
+
"kind": 1,
|
|
538
|
+
"detail": "Create unique symbol",
|
|
539
|
+
"documentation": { "value": "Creates an anonymous, unique symbol value.\n\n```js\nconst id = Symbol('id');\nconst obj = { [id]: 123 };\n```" },
|
|
540
|
+
"insertText": "Symbol(${1:'description'})",
|
|
541
|
+
"insertTextRules": 4,
|
|
542
|
+
"sortText": "01_symbol"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"label": "Proxy",
|
|
546
|
+
"kind": 5,
|
|
547
|
+
"detail": "Create a Proxy object",
|
|
548
|
+
"documentation": { "value": "Creates an object that wraps another object and intercepts fundamental operations.\n\n```js\nconst handler = {\n get(target, prop) {\n return prop in target ? target[prop] : 'default';\n }\n};\nconst proxy = new Proxy({}, handler);\n```" },
|
|
549
|
+
"insertText": "new Proxy(${1:target}, {\n\tget(target, prop) {\n\t\t${2}\n\t}\n})",
|
|
550
|
+
"insertTextRules": 4,
|
|
551
|
+
"sortText": "01_proxy"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"label": "Reflect",
|
|
555
|
+
"kind": 9,
|
|
556
|
+
"detail": "Reflect namespace",
|
|
557
|
+
"documentation": { "value": "Provides methods for interceptable JavaScript operations. Same methods as proxy handler traps.\n\n```js\nReflect.has(obj, 'key');\nReflect.ownKeys(obj);\nReflect.apply(fn, thisArg, args);\n```" },
|
|
558
|
+
"insertText": "Reflect.${1:method}(${2})",
|
|
559
|
+
"insertTextRules": 4,
|
|
560
|
+
"sortText": "01_reflect"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"label": { "label": "async function", "detail": " declaration", "description": "ES2017+" },
|
|
564
|
+
"kind": 15,
|
|
565
|
+
"detail": "Async function snippet",
|
|
566
|
+
"documentation": { "value": "Declares an asynchronous function that returns a Promise.\n\n```js\nasync function fetchData(url) {\n const res = await fetch(url);\n return res.json();\n}\n```" },
|
|
567
|
+
"insertText": "async function ${1:name}(${2:params}) {\n\t${3}\n}",
|
|
568
|
+
"insertTextRules": 4,
|
|
569
|
+
"sortText": "00_async_function"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"label": { "label": "arrow function", "detail": " expression", "description": "ES6+" },
|
|
573
|
+
"kind": 15,
|
|
574
|
+
"detail": "Arrow function snippet",
|
|
575
|
+
"documentation": { "value": "Arrow function expression with concise syntax.\n\n```js\nconst add = (a, b) => a + b;\nconst greet = name => `Hello, ${name}`;\n```" },
|
|
576
|
+
"insertText": "const ${1:name} = (${2:params}) => {\n\t${3}\n};",
|
|
577
|
+
"insertTextRules": 4,
|
|
578
|
+
"sortText": "00_arrow_function"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"label": { "label": "try...catch", "detail": " block", "description": "Error handling" },
|
|
582
|
+
"kind": 15,
|
|
583
|
+
"detail": "Try-catch error handling",
|
|
584
|
+
"documentation": { "value": "Wraps code in a try-catch block for error handling.\n\n```js\ntry {\n riskyOperation();\n} catch (error) {\n console.error(error);\n}\n```" },
|
|
585
|
+
"insertText": "try {\n\t${1}\n} catch (${2:error}) {\n\t${3:console.error($2);}\n}",
|
|
586
|
+
"insertTextRules": 4,
|
|
587
|
+
"sortText": "00_try_catch"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"label": { "label": "for...of", "detail": " loop", "description": "ES6+ iterable loop" },
|
|
591
|
+
"kind": 15,
|
|
592
|
+
"detail": "For-of loop over iterable",
|
|
593
|
+
"documentation": { "value": "Iterates over iterable objects (Arrays, Strings, Maps, Sets, etc.).\n\n```js\nfor (const item of [1, 2, 3]) {\n console.log(item);\n}\n```" },
|
|
594
|
+
"insertText": "for (const ${1:item} of ${2:iterable}) {\n\t${3}\n}",
|
|
595
|
+
"insertTextRules": 4,
|
|
596
|
+
"sortText": "00_for_of"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"label": { "label": "for...in", "detail": " loop", "description": "Enumerate properties" },
|
|
600
|
+
"kind": 15,
|
|
601
|
+
"detail": "For-in loop over properties",
|
|
602
|
+
"documentation": { "value": "Iterates over enumerable string properties of an object.\n\n```js\nfor (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n console.log(key, obj[key]);\n }\n}\n```" },
|
|
603
|
+
"insertText": "for (const ${1:key} in ${2:obj}) {\n\t${3}\n}",
|
|
604
|
+
"insertTextRules": 4,
|
|
605
|
+
"sortText": "00_for_in"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"label": { "label": "class", "detail": " declaration", "description": "ES6+ class" },
|
|
609
|
+
"kind": 15,
|
|
610
|
+
"detail": "Class declaration snippet",
|
|
611
|
+
"documentation": { "value": "Declares a class with constructor.\n\n```js\nclass Animal {\n constructor(name) {\n this.name = name;\n }\n speak() {\n return `${this.name} makes a sound.`;\n }\n}\n```" },
|
|
612
|
+
"insertText": "class ${1:ClassName} {\n\tconstructor(${2:params}) {\n\t\t${3}\n\t}\n\n\t${4:method}(${5}) {\n\t\t${6}\n\t}\n}",
|
|
613
|
+
"insertTextRules": 4,
|
|
614
|
+
"sortText": "00_class"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"label": { "label": "import", "detail": " ES module", "description": "ES6+" },
|
|
618
|
+
"kind": 15,
|
|
619
|
+
"detail": "Import statement",
|
|
620
|
+
"documentation": { "value": "Import bindings from a module.\n\n```js\nimport { useState, useEffect } from 'react';\nimport defaultExport from 'module';\nimport * as name from 'module';\n```" },
|
|
621
|
+
"insertText": "import { ${1:name} } from '${2:module}';",
|
|
622
|
+
"insertTextRules": 4,
|
|
623
|
+
"sortText": "00_import"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"label": { "label": "export default", "detail": " ES module", "description": "ES6+" },
|
|
627
|
+
"kind": 15,
|
|
628
|
+
"detail": "Default export",
|
|
629
|
+
"documentation": { "value": "Export a default value from a module.\n\n```js\nexport default function myFunc() { }\nexport default class MyClass { }\n```" },
|
|
630
|
+
"insertText": "export default ${1}",
|
|
631
|
+
"insertTextRules": 4,
|
|
632
|
+
"sortText": "00_export_default"
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
"label": { "label": "export", "detail": " named", "description": "ES6+" },
|
|
636
|
+
"kind": 15,
|
|
637
|
+
"detail": "Named export",
|
|
638
|
+
"documentation": { "value": "Export named bindings from a module.\n\n```js\nexport const myVar = 42;\nexport function myFunc() { }\nexport { name1, name2 };\n```" },
|
|
639
|
+
"insertText": "export { ${1} };",
|
|
640
|
+
"insertTextRules": 4,
|
|
641
|
+
"sortText": "00_export"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"label": { "label": "destructure object", "detail": " assignment", "description": "ES6+" },
|
|
645
|
+
"kind": 15,
|
|
646
|
+
"detail": "Object destructuring",
|
|
647
|
+
"documentation": { "value": "Extract properties from objects into variables.\n\n```js\nconst { name, age, ...rest } = person;\n```" },
|
|
648
|
+
"insertText": "const { ${1:prop} } = ${2:obj};",
|
|
649
|
+
"insertTextRules": 4,
|
|
650
|
+
"sortText": "00_destructure_obj"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"label": { "label": "destructure array", "detail": " assignment", "description": "ES6+" },
|
|
654
|
+
"kind": 15,
|
|
655
|
+
"detail": "Array destructuring",
|
|
656
|
+
"documentation": { "value": "Extract elements from arrays into variables.\n\n```js\nconst [first, second, ...rest] = [1, 2, 3, 4];\n```" },
|
|
657
|
+
"insertText": "const [${1:first}, ${2:second}] = ${3:arr};",
|
|
658
|
+
"insertTextRules": 4,
|
|
659
|
+
"sortText": "00_destructure_arr"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"label": { "label": "template literal", "detail": " string", "description": "ES6+" },
|
|
663
|
+
"kind": 15,
|
|
664
|
+
"detail": "Template literal string",
|
|
665
|
+
"documentation": { "value": "Allows embedded expressions and multi-line strings.\n\n```js\nconst msg = `Hello, ${name}! You are ${age} years old.`;\n```" },
|
|
666
|
+
"insertText": "`${1:text} \\${${2:expression}}`",
|
|
667
|
+
"insertTextRules": 4,
|
|
668
|
+
"sortText": "00_template_literal"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"label": { "label": "spread operator", "detail": " ...", "description": "ES6+" },
|
|
672
|
+
"kind": 15,
|
|
673
|
+
"detail": "Spread/rest operator",
|
|
674
|
+
"documentation": { "value": "Expand an iterable or collect remaining elements.\n\n```js\nconst merged = [...arr1, ...arr2];\nconst copy = { ...original, newProp: 'val' };\nfunction fn(...args) { }\n```" },
|
|
675
|
+
"insertText": "...${1:iterable}",
|
|
676
|
+
"insertTextRules": 4,
|
|
677
|
+
"sortText": "00_spread"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"label": { "label": "optional chaining", "detail": " ?.", "description": "ES2020+" },
|
|
681
|
+
"kind": 15,
|
|
682
|
+
"detail": "Optional chaining operator",
|
|
683
|
+
"documentation": { "value": "Access deeply nested properties without checking each level.\n\n```js\nconst city = user?.address?.city;\nconst result = obj?.method?.();\n```" },
|
|
684
|
+
"insertText": "${1:obj}?.${2:prop}",
|
|
685
|
+
"insertTextRules": 4,
|
|
686
|
+
"sortText": "00_optional_chaining"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"label": { "label": "nullish coalescing", "detail": " ??", "description": "ES2020+" },
|
|
690
|
+
"kind": 15,
|
|
691
|
+
"detail": "Nullish coalescing operator",
|
|
692
|
+
"documentation": { "value": "Returns the right-hand operand when the left-hand is null or undefined.\n\n```js\nconst value = input ?? 'default';\n```" },
|
|
693
|
+
"insertText": "${1:value} ?? ${2:defaultValue}",
|
|
694
|
+
"insertTextRules": 4,
|
|
695
|
+
"sortText": "00_nullish_coalescing"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"label": "String.prototype.replaceAll",
|
|
699
|
+
"kind": 0,
|
|
700
|
+
"detail": "Replace all occurrences",
|
|
701
|
+
"documentation": { "value": "Returns a new string with all matches of a pattern replaced.\n\n```js\n'aaa'.replaceAll('a', 'b'); // 'bbb'\n```" },
|
|
702
|
+
"insertText": ".replaceAll(${1:search}, ${2:replacement})",
|
|
703
|
+
"insertTextRules": 4,
|
|
704
|
+
"sortText": "02_replaceAll"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"label": ".at",
|
|
708
|
+
"kind": 0,
|
|
709
|
+
"detail": "Array/String.prototype.at()",
|
|
710
|
+
"documentation": { "value": "Returns the element at the given index, supporting negative indexing.\n\n```js\n[1,2,3].at(-1); // 3\n'hello'.at(0); // 'h'\n```" },
|
|
711
|
+
"insertText": ".at(${1:index})",
|
|
712
|
+
"insertTextRules": 4,
|
|
713
|
+
"sortText": "02_at"
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"label": "AbortController",
|
|
717
|
+
"kind": 5,
|
|
718
|
+
"detail": "AbortController for cancellation",
|
|
719
|
+
"documentation": { "value": "Allows you to abort one or more Web requests as and when desired.\n\n```js\nconst controller = new AbortController();\nfetch(url, { signal: controller.signal });\ncontroller.abort();\n```" },
|
|
720
|
+
"insertText": "const ${1:controller} = new AbortController();\nconst ${2:signal} = ${1:controller}.signal;",
|
|
721
|
+
"insertTextRules": 4,
|
|
722
|
+
"sortText": "01_abortcontroller"
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"label": "URL",
|
|
726
|
+
"kind": 5,
|
|
727
|
+
"detail": "URL constructor",
|
|
728
|
+
"documentation": { "value": "Creates and returns a URL object from a URL string.\n\n```js\nconst url = new URL('https://example.com/path?q=1');\nurl.hostname; // 'example.com'\nurl.searchParams.get('q'); // '1'\n```" },
|
|
729
|
+
"insertText": "new URL(${1:'https://example.com'})",
|
|
730
|
+
"insertTextRules": 4,
|
|
731
|
+
"sortText": "01_url"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"label": "URLSearchParams",
|
|
735
|
+
"kind": 5,
|
|
736
|
+
"detail": "URL query string utility",
|
|
737
|
+
"documentation": { "value": "Utility methods to work with the query string of a URL.\n\n```js\nconst params = new URLSearchParams({ page: 1, limit: 10 });\nparams.toString(); // 'page=1&limit=10'\n```" },
|
|
738
|
+
"insertText": "new URLSearchParams(${1})",
|
|
739
|
+
"insertTextRules": 4,
|
|
740
|
+
"sortText": "01_urlsearchparams"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"label": "TextEncoder",
|
|
744
|
+
"kind": 5,
|
|
745
|
+
"detail": "Encode string to Uint8Array",
|
|
746
|
+
"documentation": { "value": "Takes a stream of code points as input and emits a stream of UTF-8 bytes.\n\n```js\nconst encoder = new TextEncoder();\nconst bytes = encoder.encode('Hello');\n```" },
|
|
747
|
+
"insertText": "new TextEncoder().encode(${1:string})",
|
|
748
|
+
"insertTextRules": 4,
|
|
749
|
+
"sortText": "01_textencoder"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
"label": "TextDecoder",
|
|
753
|
+
"kind": 5,
|
|
754
|
+
"detail": "Decode bytes to string",
|
|
755
|
+
"documentation": { "value": "Represents a decoder for a specific text encoding (defaults to UTF-8).\n\n```js\nconst decoder = new TextDecoder();\nconst text = decoder.decode(uint8Array);\n```" },
|
|
756
|
+
"insertText": "new TextDecoder().decode(${1:buffer})",
|
|
757
|
+
"insertTextRules": 4,
|
|
758
|
+
"sortText": "01_textdecoder"
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"label": "crypto.randomUUID",
|
|
762
|
+
"kind": 1,
|
|
763
|
+
"detail": "Generate random UUID",
|
|
764
|
+
"documentation": { "value": "Generates a random v4 UUID.\n\n```js\nconst uuid = crypto.randomUUID();\n// 'a1b2c3d4-e5f6-4a5b-8c7d-9e0f1a2b3c4d'\n```" },
|
|
765
|
+
"insertText": "crypto.randomUUID()",
|
|
766
|
+
"insertTextRules": 1,
|
|
767
|
+
"sortText": "01_crypto_uuid"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"label": "atob",
|
|
771
|
+
"kind": 1,
|
|
772
|
+
"detail": "Decode base64 string",
|
|
773
|
+
"documentation": { "value": "Decodes a string of data which has been encoded using Base64 encoding.\n\n```js\natob('SGVsbG8='); // 'Hello'\n```" },
|
|
774
|
+
"insertText": "atob(${1:encodedString})",
|
|
775
|
+
"insertTextRules": 4,
|
|
776
|
+
"sortText": "01_atob"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"label": "btoa",
|
|
780
|
+
"kind": 1,
|
|
781
|
+
"detail": "Encode to base64 string",
|
|
782
|
+
"documentation": { "value": "Creates a Base64-encoded ASCII string from a binary string.\n\n```js\nbtoa('Hello'); // 'SGVsbG8='\n```" },
|
|
783
|
+
"insertText": "btoa(${1:string})",
|
|
784
|
+
"insertTextRules": 4,
|
|
785
|
+
"sortText": "01_btoa"
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"label": "const",
|
|
789
|
+
"kind": 14,
|
|
790
|
+
"detail": "Block-scoped constant",
|
|
791
|
+
"documentation": { "value": "Declares a block-scoped constant. The value cannot be reassigned.\n\n```js\nconst PI = 3.14159;\nconst config = { port: 3000 };\n```" },
|
|
792
|
+
"insertText": "const ${1:name} = ${2:value};",
|
|
793
|
+
"insertTextRules": 4,
|
|
794
|
+
"sortText": "00_const"
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"label": "let",
|
|
798
|
+
"kind": 14,
|
|
799
|
+
"detail": "Block-scoped variable",
|
|
800
|
+
"documentation": { "value": "Declares a block-scoped local variable, optionally initializing it.\n\n```js\nlet count = 0;\ncount++;\n```" },
|
|
801
|
+
"insertText": "let ${1:name} = ${2:value};",
|
|
802
|
+
"insertTextRules": 4,
|
|
803
|
+
"sortText": "00_let"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"label": "async/await",
|
|
807
|
+
"kind": 14,
|
|
808
|
+
"detail": "Async/await syntax",
|
|
809
|
+
"documentation": { "value": "Write asynchronous code in a synchronous style.\n\n```js\nasync function main() {\n const data = await fetchData();\n console.log(data);\n}\n```" },
|
|
810
|
+
"insertText": "const ${1:result} = await ${2:promise};",
|
|
811
|
+
"insertTextRules": 4,
|
|
812
|
+
"sortText": "00_async_await"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"label": "typeof",
|
|
816
|
+
"kind": 14,
|
|
817
|
+
"detail": "Type checking operator",
|
|
818
|
+
"documentation": { "value": "Returns a string indicating the type of the operand.\n\n```js\ntypeof 42; // 'number'\ntypeof 'hello'; // 'string'\ntypeof undefined; // 'undefined'\ntypeof null; // 'object' (historical bug)\n```" },
|
|
819
|
+
"insertText": "typeof ${1:value}",
|
|
820
|
+
"insertTextRules": 4,
|
|
821
|
+
"sortText": "01_typeof"
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
"label": "instanceof",
|
|
825
|
+
"kind": 14,
|
|
826
|
+
"detail": "Instance type checking",
|
|
827
|
+
"documentation": { "value": "Tests whether the prototype property of a constructor appears in the prototype chain.\n\n```js\n[] instanceof Array; // true\nnew Date() instanceof Date; // true\n```" },
|
|
828
|
+
"insertText": "${1:obj} instanceof ${2:Constructor}",
|
|
829
|
+
"insertTextRules": 4,
|
|
830
|
+
"sortText": "01_instanceof"
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
"label": "RegExp",
|
|
834
|
+
"kind": 5,
|
|
835
|
+
"detail": "Regular expression constructor",
|
|
836
|
+
"documentation": { "value": "Creates a regular expression object for matching text with a pattern.\n\n```js\nconst re = new RegExp('\\\\d+', 'g');\nconst re2 = /\\d+/g;\n'abc123'.match(re); // ['123']\n```" },
|
|
837
|
+
"insertText": "new RegExp('${1:pattern}', '${2:flags}')",
|
|
838
|
+
"insertTextRules": 4,
|
|
839
|
+
"sortText": "01_regexp"
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
"label": "Error",
|
|
843
|
+
"kind": 5,
|
|
844
|
+
"detail": "Error constructor",
|
|
845
|
+
"documentation": { "value": "Creates an error object.\n\n```js\nthrow new Error('Something went wrong');\n```\n\nBuilt-in error types: `TypeError`, `RangeError`, `SyntaxError`, `ReferenceError`, `URIError`, `EvalError`" },
|
|
846
|
+
"insertText": "new Error('${1:message}')",
|
|
847
|
+
"insertTextRules": 4,
|
|
848
|
+
"sortText": "01_error"
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
"label": "Date",
|
|
852
|
+
"kind": 5,
|
|
853
|
+
"detail": "Date constructor",
|
|
854
|
+
"documentation": { "value": "Creates a JavaScript `Date` instance that represents a single moment in time.\n\n```js\nconst now = new Date();\nconst specific = new Date('2024-01-15');\nnow.toISOString(); // '2024-...'\n```" },
|
|
855
|
+
"insertText": "new Date(${1})",
|
|
856
|
+
"insertTextRules": 4,
|
|
857
|
+
"sortText": "01_date"
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
"label": "Intl.DateTimeFormat",
|
|
861
|
+
"kind": 5,
|
|
862
|
+
"detail": "Internationalized date formatting",
|
|
863
|
+
"documentation": { "value": "Enables language-sensitive date and time formatting.\n\n```js\nnew Intl.DateTimeFormat('en-US', {\n dateStyle: 'long',\n timeStyle: 'short'\n}).format(new Date());\n```" },
|
|
864
|
+
"insertText": "new Intl.DateTimeFormat('${1:en-US}', {\n\t${2:dateStyle: 'long'}\n}).format(${3:date})",
|
|
865
|
+
"insertTextRules": 4,
|
|
866
|
+
"sortText": "01_intl_datetime"
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"label": "Intl.NumberFormat",
|
|
870
|
+
"kind": 5,
|
|
871
|
+
"detail": "Internationalized number formatting",
|
|
872
|
+
"documentation": { "value": "Enables language-sensitive number formatting.\n\n```js\nnew Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD'\n}).format(1234.56); // '$1,234.56'\n```" },
|
|
873
|
+
"insertText": "new Intl.NumberFormat('${1:en-US}', {\n\t${2:style: 'decimal'}\n}).format(${3:number})",
|
|
874
|
+
"insertTextRules": 4,
|
|
875
|
+
"sortText": "01_intl_number"
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
"label": "Iterator.from",
|
|
879
|
+
"kind": 1,
|
|
880
|
+
"detail": "Create iterator from iterable (ES2025)",
|
|
881
|
+
"documentation": { "value": "Creates an Iterator object from an iterable or iterator-like object.\n\n```js\nconst it = Iterator.from([1, 2, 3]);\nit.map(x => x * 2).toArray(); // [2, 4, 6]\n```" },
|
|
882
|
+
"insertText": "Iterator.from(${1:iterable})",
|
|
883
|
+
"insertTextRules": 4,
|
|
884
|
+
"sortText": "01_iterator_from"
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
"label": "Object.groupBy",
|
|
888
|
+
"kind": 1,
|
|
889
|
+
"detail": "Group iterable elements (ES2024)",
|
|
890
|
+
"documentation": { "value": "Groups elements of an iterable according to a callback function.\n\n```js\nObject.groupBy([1,2,3,4,5], n => n % 2 === 0 ? 'even' : 'odd');\n// { odd: [1,3,5], even: [2,4] }\n```" },
|
|
891
|
+
"insertText": "Object.groupBy(${1:iterable}, (${2:item}) => ${3})",
|
|
892
|
+
"insertTextRules": 4,
|
|
893
|
+
"sortText": "01_object_groupBy"
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
"label": "Array.fromAsync",
|
|
897
|
+
"kind": 1,
|
|
898
|
+
"detail": "Array from async iterable (ES2024)",
|
|
899
|
+
"documentation": { "value": "Creates a new Array from an async iterable, iterable, or array-like object.\n\n```js\nconst arr = await Array.fromAsync(asyncGenerator());\n```" },
|
|
900
|
+
"insertText": "await Array.fromAsync(${1:asyncIterable})",
|
|
901
|
+
"insertTextRules": 4,
|
|
902
|
+
"sortText": "01_array_fromAsync"
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
"label": "using",
|
|
906
|
+
"kind": 14,
|
|
907
|
+
"detail": "Explicit Resource Management (ES2025)",
|
|
908
|
+
"documentation": { "value": "Declares a resource that is automatically disposed when it goes out of scope.\n\n```js\n{\n using handle = getFileHandle();\n // handle[Symbol.dispose]() called automatically\n}\n```" },
|
|
909
|
+
"insertText": "using ${1:resource} = ${2:expression};",
|
|
910
|
+
"insertTextRules": 4,
|
|
911
|
+
"sortText": "00_using"
|
|
912
|
+
}
|
|
913
|
+
]
|
|
914
|
+
}
|