@enjoys/context-engine 1.1.0 → 1.1.1
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/codeActions/dart.json +31 -0
- package/data/codeActions/docker-compose.json +112 -0
- package/data/codeActions/kotlin.json +18 -0
- package/data/codeActions/scala.json +26 -0
- package/data/codeActions/swift.json +26 -0
- package/data/codeLens/dart.json +15 -0
- package/data/codeLens/docker-compose.json +4 -0
- package/data/codeLens/kotlin.json +10 -0
- package/data/codeLens/scala.json +18 -0
- package/data/codeLens/swift.json +15 -0
- package/data/color/dart.json +37 -0
- package/data/color/docker-compose.json +6 -0
- package/data/color/kotlin.json +12 -0
- package/data/color/scala.json +13 -0
- package/data/color/swift.json +37 -0
- package/data/commands/kotlin.json +45 -0
- package/data/commands/scala.json +171 -0
- package/data/commands/swift.json +67 -0
- package/data/completion/dart.json +1436 -0
- package/data/completion/docker-compose.json +959 -0
- package/data/completion/kotlin.json +1580 -0
- package/data/completion/scala.json +1076 -0
- package/data/completion/swift.json +1742 -0
- package/data/declaration/dart.json +25 -0
- package/data/declaration/docker-compose.json +42 -0
- package/data/declaration/kotlin.json +14 -0
- package/data/declaration/scala.json +23 -0
- package/data/declaration/swift.json +18 -0
- package/data/defination/dart.json +369 -0
- package/data/defination/docker-compose.json +347 -0
- package/data/defination/kotlin.json +789 -0
- package/data/defination/scala.json +285 -0
- package/data/defination/swift.json +551 -0
- package/data/documentHighlight/dart.json +84 -0
- package/data/documentHighlight/docker-compose.json +233 -0
- package/data/documentHighlight/kotlin.json +37 -0
- package/data/documentHighlight/scala.json +79 -0
- package/data/documentHighlight/swift.json +89 -0
- package/data/documentSymbol/dart.json +20 -0
- package/data/documentSymbol/docker-compose.json +75 -0
- package/data/documentSymbol/kotlin.json +15 -0
- package/data/documentSymbol/scala.json +21 -0
- package/data/documentSymbol/swift.json +17 -0
- package/data/formatting/dart.json +16 -0
- package/data/formatting/docker-compose.json +24 -0
- package/data/formatting/kotlin.json +14 -0
- package/data/formatting/scala.json +17 -0
- package/data/formatting/swift.json +19 -0
- package/data/hover/dart.json +161 -0
- package/data/hover/docker-compose.json +404 -0
- package/data/hover/kotlin.json +341 -0
- package/data/hover/scala.json +209 -0
- package/data/hover/swift.json +239 -0
- package/data/implementation/dart.json +14 -0
- package/data/implementation/docker-compose.json +7 -0
- package/data/implementation/kotlin.json +13 -0
- package/data/implementation/scala.json +16 -0
- package/data/implementation/swift.json +14 -0
- package/data/inlayHints/dart.json +29 -0
- package/data/inlayHints/docker-compose.json +43 -0
- package/data/inlayHints/kotlin.json +23 -0
- package/data/inlayHints/scala.json +42 -0
- package/data/inlayHints/swift.json +37 -0
- package/data/inlineCompletions/dart.json +27 -0
- package/data/inlineCompletions/docker-compose.json +89 -0
- package/data/inlineCompletions/kotlin.json +19 -0
- package/data/inlineCompletions/scala.json +26 -0
- package/data/inlineCompletions/swift.json +23 -0
- package/data/links/dart.json +16 -0
- package/data/links/docker-compose.json +47 -0
- package/data/links/kotlin.json +10 -0
- package/data/links/scala.json +17 -0
- package/data/links/swift.json +13 -0
- package/data/manifest.json +38 -0
- package/data/references/dart.json +15 -0
- package/data/references/docker-compose.json +42 -0
- package/data/references/kotlin.json +12 -0
- package/data/references/scala.json +15 -0
- package/data/references/swift.json +14 -0
- package/data/typeDefinition/dart.json +35 -0
- package/data/typeDefinition/docker-compose.json +4 -0
- package/data/typeDefinition/kotlin.json +33 -0
- package/data/typeDefinition/scala.json +52 -0
- package/data/typeDefinition/swift.json +56 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1742 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "swift",
|
|
3
|
+
"completions": [
|
|
4
|
+
{
|
|
5
|
+
"label": "func",
|
|
6
|
+
"kind": 17,
|
|
7
|
+
"detail": "Function declaration keyword",
|
|
8
|
+
"documentation": {"value": "```swift\nfunc name(param: Type) -> ReturnType {\n // body\n}\n```\nDeclares a function."},
|
|
9
|
+
"insertText": "func ${1:name}(${2:params}) -> ${3:Void} {\n\t$0\n}",
|
|
10
|
+
"insertTextRules": 4,
|
|
11
|
+
"sortText": "01_keyword_func"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"label": "let",
|
|
15
|
+
"kind": 17,
|
|
16
|
+
"detail": "Immutable variable declaration",
|
|
17
|
+
"documentation": {"value": "```swift\nlet name: Type = value\n```\nDeclares an immutable constant."},
|
|
18
|
+
"insertText": "let ${1:name}: ${2:Type} = ${3:value}",
|
|
19
|
+
"insertTextRules": 4,
|
|
20
|
+
"sortText": "01_keyword_let"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"label": "var",
|
|
24
|
+
"kind": 17,
|
|
25
|
+
"detail": "Mutable variable declaration",
|
|
26
|
+
"documentation": {"value": "```swift\nvar name: Type = value\n```\nDeclares a mutable variable."},
|
|
27
|
+
"insertText": "var ${1:name}: ${2:Type} = ${3:value}",
|
|
28
|
+
"insertTextRules": 4,
|
|
29
|
+
"sortText": "01_keyword_var"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"label": "class",
|
|
33
|
+
"kind": 17,
|
|
34
|
+
"detail": "Class declaration keyword",
|
|
35
|
+
"documentation": {"value": "```swift\nclass Name: SuperClass {\n // body\n}\n```\nDeclares a reference-type class."},
|
|
36
|
+
"insertText": "class ${1:Name} {\n\t$0\n}",
|
|
37
|
+
"insertTextRules": 4,
|
|
38
|
+
"sortText": "01_keyword_class"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"label": "struct",
|
|
42
|
+
"kind": 17,
|
|
43
|
+
"detail": "Struct declaration keyword",
|
|
44
|
+
"documentation": {"value": "```swift\nstruct Name {\n // body\n}\n```\nDeclares a value-type struct."},
|
|
45
|
+
"insertText": "struct ${1:Name} {\n\t$0\n}",
|
|
46
|
+
"insertTextRules": 4,
|
|
47
|
+
"sortText": "01_keyword_struct"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"label": "enum",
|
|
51
|
+
"kind": 17,
|
|
52
|
+
"detail": "Enum declaration keyword",
|
|
53
|
+
"documentation": {"value": "```swift\nenum Name {\n case value1\n case value2\n}\n```\nDeclares an enumeration type."},
|
|
54
|
+
"insertText": "enum ${1:Name} {\n\tcase ${2:value}\n\t$0\n}",
|
|
55
|
+
"insertTextRules": 4,
|
|
56
|
+
"sortText": "01_keyword_enum"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"label": "protocol",
|
|
60
|
+
"kind": 17,
|
|
61
|
+
"detail": "Protocol declaration keyword",
|
|
62
|
+
"documentation": {"value": "```swift\nprotocol Name {\n func method()\n}\n```\nDeclares a protocol (interface)."},
|
|
63
|
+
"insertText": "protocol ${1:Name} {\n\t$0\n}",
|
|
64
|
+
"insertTextRules": 4,
|
|
65
|
+
"sortText": "01_keyword_protocol"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"label": "extension",
|
|
69
|
+
"kind": 17,
|
|
70
|
+
"detail": "Extension declaration keyword",
|
|
71
|
+
"documentation": {"value": "```swift\nextension Type {\n // added functionality\n}\n```\nExtends an existing type with new functionality."},
|
|
72
|
+
"insertText": "extension ${1:Type} {\n\t$0\n}",
|
|
73
|
+
"insertTextRules": 4,
|
|
74
|
+
"sortText": "01_keyword_extension"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"label": "import",
|
|
78
|
+
"kind": 17,
|
|
79
|
+
"detail": "Import declaration keyword",
|
|
80
|
+
"documentation": {"value": "```swift\nimport Foundation\n```\nImports a module."},
|
|
81
|
+
"insertText": "import ${1:Foundation}",
|
|
82
|
+
"insertTextRules": 4,
|
|
83
|
+
"sortText": "01_keyword_import"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"label": "return",
|
|
87
|
+
"kind": 17,
|
|
88
|
+
"detail": "Return keyword",
|
|
89
|
+
"documentation": {"value": "```swift\nreturn value\n```\nReturns a value from a function."},
|
|
90
|
+
"insertText": "return ${1:value}",
|
|
91
|
+
"insertTextRules": 4,
|
|
92
|
+
"sortText": "01_keyword_return"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"label": "if",
|
|
96
|
+
"kind": 17,
|
|
97
|
+
"detail": "Conditional keyword",
|
|
98
|
+
"documentation": {"value": "```swift\nif condition {\n // body\n}\n```\nConditional statement."},
|
|
99
|
+
"insertText": "if ${1:condition} {\n\t$0\n}",
|
|
100
|
+
"insertTextRules": 4,
|
|
101
|
+
"sortText": "01_keyword_if"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"label": "else",
|
|
105
|
+
"kind": 17,
|
|
106
|
+
"detail": "Else branch keyword",
|
|
107
|
+
"documentation": {"value": "```swift\nif condition {\n // if body\n} else {\n // else body\n}\n```\nElse branch of conditional."},
|
|
108
|
+
"insertText": "else {\n\t$0\n}",
|
|
109
|
+
"insertTextRules": 4,
|
|
110
|
+
"sortText": "01_keyword_else"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"label": "guard",
|
|
114
|
+
"kind": 17,
|
|
115
|
+
"detail": "Guard statement keyword",
|
|
116
|
+
"documentation": {"value": "```swift\nguard condition else {\n return\n}\n```\nEarly exit guard statement."},
|
|
117
|
+
"insertText": "guard ${1:condition} else {\n\t${2:return}\n}",
|
|
118
|
+
"insertTextRules": 4,
|
|
119
|
+
"sortText": "01_keyword_guard"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"label": "switch",
|
|
123
|
+
"kind": 17,
|
|
124
|
+
"detail": "Switch statement keyword",
|
|
125
|
+
"documentation": {"value": "```swift\nswitch value {\ncase .option1:\n // ...\ndefault:\n break\n}\n```\nPattern matching switch statement."},
|
|
126
|
+
"insertText": "switch ${1:value} {\ncase ${2:.option}:\n\t${3:break}\ndefault:\n\t${4:break}\n}",
|
|
127
|
+
"insertTextRules": 4,
|
|
128
|
+
"sortText": "01_keyword_switch"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"label": "case",
|
|
132
|
+
"kind": 17,
|
|
133
|
+
"detail": "Case keyword",
|
|
134
|
+
"documentation": {"value": "```swift\ncase .value:\n // handler\n```\nSwitch case or enum case."},
|
|
135
|
+
"insertText": "case ${1:.value}:\n\t$0",
|
|
136
|
+
"insertTextRules": 4,
|
|
137
|
+
"sortText": "01_keyword_case"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"label": "default",
|
|
141
|
+
"kind": 17,
|
|
142
|
+
"detail": "Default case keyword",
|
|
143
|
+
"documentation": {"value": "```swift\ndefault:\n break\n```\nDefault case in switch statement."},
|
|
144
|
+
"insertText": "default:\n\t$0",
|
|
145
|
+
"insertTextRules": 4,
|
|
146
|
+
"sortText": "01_keyword_default"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"label": "for",
|
|
150
|
+
"kind": 17,
|
|
151
|
+
"detail": "For-in loop keyword",
|
|
152
|
+
"documentation": {"value": "```swift\nfor item in collection {\n // body\n}\n```\nIterates over a sequence."},
|
|
153
|
+
"insertText": "for ${1:item} in ${2:collection} {\n\t$0\n}",
|
|
154
|
+
"insertTextRules": 4,
|
|
155
|
+
"sortText": "01_keyword_for"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"label": "while",
|
|
159
|
+
"kind": 17,
|
|
160
|
+
"detail": "While loop keyword",
|
|
161
|
+
"documentation": {"value": "```swift\nwhile condition {\n // body\n}\n```\nRepeats while condition is true."},
|
|
162
|
+
"insertText": "while ${1:condition} {\n\t$0\n}",
|
|
163
|
+
"insertTextRules": 4,
|
|
164
|
+
"sortText": "01_keyword_while"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"label": "repeat",
|
|
168
|
+
"kind": 17,
|
|
169
|
+
"detail": "Repeat-while loop keyword",
|
|
170
|
+
"documentation": {"value": "```swift\nrepeat {\n // body\n} while condition\n```\nExecutes body at least once."},
|
|
171
|
+
"insertText": "repeat {\n\t$0\n} while ${1:condition}",
|
|
172
|
+
"insertTextRules": 4,
|
|
173
|
+
"sortText": "01_keyword_repeat"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"label": "break",
|
|
177
|
+
"kind": 17,
|
|
178
|
+
"detail": "Break statement keyword",
|
|
179
|
+
"documentation": {"value": "Exits the current loop or switch case."},
|
|
180
|
+
"insertText": "break",
|
|
181
|
+
"insertTextRules": 4,
|
|
182
|
+
"sortText": "01_keyword_break"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"label": "continue",
|
|
186
|
+
"kind": 17,
|
|
187
|
+
"detail": "Continue statement keyword",
|
|
188
|
+
"documentation": {"value": "Skips the current iteration and continues with the next."},
|
|
189
|
+
"insertText": "continue",
|
|
190
|
+
"insertTextRules": 4,
|
|
191
|
+
"sortText": "01_keyword_continue"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"label": "fallthrough",
|
|
195
|
+
"kind": 17,
|
|
196
|
+
"detail": "Fallthrough keyword",
|
|
197
|
+
"documentation": {"value": "Causes execution to fall through to the next case in a switch statement."},
|
|
198
|
+
"insertText": "fallthrough",
|
|
199
|
+
"insertTextRules": 4,
|
|
200
|
+
"sortText": "01_keyword_fallthrough"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"label": "throw",
|
|
204
|
+
"kind": 17,
|
|
205
|
+
"detail": "Throw keyword",
|
|
206
|
+
"documentation": {"value": "```swift\nthrow MyError.someError\n```\nThrows an error."},
|
|
207
|
+
"insertText": "throw ${1:error}",
|
|
208
|
+
"insertTextRules": 4,
|
|
209
|
+
"sortText": "01_keyword_throw"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"label": "throws",
|
|
213
|
+
"kind": 17,
|
|
214
|
+
"detail": "Throws keyword",
|
|
215
|
+
"documentation": {"value": "Marks a function that can throw errors."},
|
|
216
|
+
"insertText": "throws",
|
|
217
|
+
"insertTextRules": 4,
|
|
218
|
+
"sortText": "01_keyword_throws"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"label": "rethrows",
|
|
222
|
+
"kind": 17,
|
|
223
|
+
"detail": "Rethrows keyword",
|
|
224
|
+
"documentation": {"value": "Marks a function that throws only if its closure argument throws."},
|
|
225
|
+
"insertText": "rethrows",
|
|
226
|
+
"insertTextRules": 4,
|
|
227
|
+
"sortText": "01_keyword_rethrows"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"label": "try",
|
|
231
|
+
"kind": 17,
|
|
232
|
+
"detail": "Try keyword",
|
|
233
|
+
"documentation": {"value": "```swift\ntry expression\ntry? expression\ntry! expression\n```\nAttempts a throwing expression."},
|
|
234
|
+
"insertText": "try ${1:expression}",
|
|
235
|
+
"insertTextRules": 4,
|
|
236
|
+
"sortText": "01_keyword_try"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"label": "catch",
|
|
240
|
+
"kind": 17,
|
|
241
|
+
"detail": "Catch keyword",
|
|
242
|
+
"documentation": {"value": "```swift\ncatch let error {\n // handle error\n}\n```\nCatches an error from a do block."},
|
|
243
|
+
"insertText": "catch ${1:let error} {\n\t$0\n}",
|
|
244
|
+
"insertTextRules": 4,
|
|
245
|
+
"sortText": "01_keyword_catch"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"label": "do",
|
|
249
|
+
"kind": 17,
|
|
250
|
+
"detail": "Do block keyword",
|
|
251
|
+
"documentation": {"value": "```swift\ndo {\n try expression\n} catch {\n // handle\n}\n```\nIntroduces a do-catch error handling block."},
|
|
252
|
+
"insertText": "do {\n\t${1:try expression}\n} catch {\n\t$0\n}",
|
|
253
|
+
"insertTextRules": 4,
|
|
254
|
+
"sortText": "01_keyword_do"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"label": "defer",
|
|
258
|
+
"kind": 17,
|
|
259
|
+
"detail": "Defer keyword",
|
|
260
|
+
"documentation": {"value": "```swift\ndefer {\n // cleanup code\n}\n```\nExecutes code when leaving the current scope."},
|
|
261
|
+
"insertText": "defer {\n\t$0\n}",
|
|
262
|
+
"insertTextRules": 4,
|
|
263
|
+
"sortText": "01_keyword_defer"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"label": "as",
|
|
267
|
+
"kind": 17,
|
|
268
|
+
"detail": "Type casting keyword",
|
|
269
|
+
"documentation": {"value": "Type cast operator. Use `as`, `as?`, or `as!`."},
|
|
270
|
+
"insertText": "as ${1:Type}",
|
|
271
|
+
"insertTextRules": 4,
|
|
272
|
+
"sortText": "01_keyword_as"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"label": "is",
|
|
276
|
+
"kind": 17,
|
|
277
|
+
"detail": "Type check keyword",
|
|
278
|
+
"documentation": {"value": "Checks if a value is of a certain type."},
|
|
279
|
+
"insertText": "is ${1:Type}",
|
|
280
|
+
"insertTextRules": 4,
|
|
281
|
+
"sortText": "01_keyword_is"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"label": "in",
|
|
285
|
+
"kind": 17,
|
|
286
|
+
"detail": "In keyword",
|
|
287
|
+
"documentation": {"value": "Used in for-in loops and closure parameters."},
|
|
288
|
+
"insertText": "in",
|
|
289
|
+
"insertTextRules": 4,
|
|
290
|
+
"sortText": "01_keyword_in"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"label": "where",
|
|
294
|
+
"kind": 17,
|
|
295
|
+
"detail": "Where clause keyword",
|
|
296
|
+
"documentation": {"value": "Adds constraints to generic types or pattern matching."},
|
|
297
|
+
"insertText": "where ${1:T}: ${2:Protocol}",
|
|
298
|
+
"insertTextRules": 4,
|
|
299
|
+
"sortText": "01_keyword_where"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"label": "self",
|
|
303
|
+
"kind": 17,
|
|
304
|
+
"detail": "Self reference keyword",
|
|
305
|
+
"documentation": {"value": "Refers to the current instance."},
|
|
306
|
+
"insertText": "self",
|
|
307
|
+
"insertTextRules": 4,
|
|
308
|
+
"sortText": "01_keyword_self"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"label": "Self",
|
|
312
|
+
"kind": 17,
|
|
313
|
+
"detail": "Self type keyword",
|
|
314
|
+
"documentation": {"value": "Refers to the current type in protocol or class context."},
|
|
315
|
+
"insertText": "Self",
|
|
316
|
+
"insertTextRules": 4,
|
|
317
|
+
"sortText": "01_keyword_Self"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"label": "super",
|
|
321
|
+
"kind": 17,
|
|
322
|
+
"detail": "Super reference keyword",
|
|
323
|
+
"documentation": {"value": "Refers to the superclass."},
|
|
324
|
+
"insertText": "super",
|
|
325
|
+
"insertTextRules": 4,
|
|
326
|
+
"sortText": "01_keyword_super"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"label": "init",
|
|
330
|
+
"kind": 17,
|
|
331
|
+
"detail": "Initializer keyword",
|
|
332
|
+
"documentation": {"value": "```swift\ninit(param: Type) {\n self.param = param\n}\n```\nDeclares an initializer."},
|
|
333
|
+
"insertText": "init(${1:params}) {\n\t$0\n}",
|
|
334
|
+
"insertTextRules": 4,
|
|
335
|
+
"sortText": "01_keyword_init"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"label": "deinit",
|
|
339
|
+
"kind": 17,
|
|
340
|
+
"detail": "Deinitializer keyword",
|
|
341
|
+
"documentation": {"value": "```swift\ndeinit {\n // cleanup\n}\n```\nCalled when an instance is deallocated."},
|
|
342
|
+
"insertText": "deinit {\n\t$0\n}",
|
|
343
|
+
"insertTextRules": 4,
|
|
344
|
+
"sortText": "01_keyword_deinit"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"label": "subscript",
|
|
348
|
+
"kind": 17,
|
|
349
|
+
"detail": "Subscript keyword",
|
|
350
|
+
"documentation": {"value": "```swift\nsubscript(index: Int) -> Element {\n get { ... }\n set { ... }\n}\n```\nEnables subscript access."},
|
|
351
|
+
"insertText": "subscript(${1:index}: ${2:Int}) -> ${3:Element} {\n\t$0\n}",
|
|
352
|
+
"insertTextRules": 4,
|
|
353
|
+
"sortText": "01_keyword_subscript"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"label": "typealias",
|
|
357
|
+
"kind": 17,
|
|
358
|
+
"detail": "Type alias keyword",
|
|
359
|
+
"documentation": {"value": "```swift\ntypealias Name = ExistingType\n```\nCreates a named alias for an existing type."},
|
|
360
|
+
"insertText": "typealias ${1:Name} = ${2:Type}",
|
|
361
|
+
"insertTextRules": 4,
|
|
362
|
+
"sortText": "01_keyword_typealias"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"label": "associatedtype",
|
|
366
|
+
"kind": 17,
|
|
367
|
+
"detail": "Associated type keyword",
|
|
368
|
+
"documentation": {"value": "```swift\nassociatedtype Element\n```\nDeclares an associated type in a protocol."},
|
|
369
|
+
"insertText": "associatedtype ${1:Element}",
|
|
370
|
+
"insertTextRules": 4,
|
|
371
|
+
"sortText": "01_keyword_associatedtype"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"label": "static",
|
|
375
|
+
"kind": 17,
|
|
376
|
+
"detail": "Static keyword",
|
|
377
|
+
"documentation": {"value": "Declares a type-level (static) member."},
|
|
378
|
+
"insertText": "static ",
|
|
379
|
+
"insertTextRules": 4,
|
|
380
|
+
"sortText": "02_modifier_static"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"label": "final",
|
|
384
|
+
"kind": 17,
|
|
385
|
+
"detail": "Final keyword",
|
|
386
|
+
"documentation": {"value": "Prevents a class, method, or property from being overridden."},
|
|
387
|
+
"insertText": "final ",
|
|
388
|
+
"insertTextRules": 4,
|
|
389
|
+
"sortText": "02_modifier_final"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"label": "lazy",
|
|
393
|
+
"kind": 17,
|
|
394
|
+
"detail": "Lazy keyword",
|
|
395
|
+
"documentation": {"value": "```swift\nlazy var name: Type = expression\n```\nDelays initialization until first access."},
|
|
396
|
+
"insertText": "lazy var ${1:name}: ${2:Type} = ${3:value}",
|
|
397
|
+
"insertTextRules": 4,
|
|
398
|
+
"sortText": "02_modifier_lazy"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"label": "weak",
|
|
402
|
+
"kind": 17,
|
|
403
|
+
"detail": "Weak reference keyword",
|
|
404
|
+
"documentation": {"value": "```swift\nweak var delegate: Protocol?\n```\nCreates a weak reference to avoid retain cycles."},
|
|
405
|
+
"insertText": "weak var ${1:name}: ${2:Type}?",
|
|
406
|
+
"insertTextRules": 4,
|
|
407
|
+
"sortText": "02_modifier_weak"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"label": "unowned",
|
|
411
|
+
"kind": 17,
|
|
412
|
+
"detail": "Unowned reference keyword",
|
|
413
|
+
"documentation": {"value": "Creates an unowned reference that is not optional."},
|
|
414
|
+
"insertText": "unowned ",
|
|
415
|
+
"insertTextRules": 4,
|
|
416
|
+
"sortText": "02_modifier_unowned"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"label": "optional",
|
|
420
|
+
"kind": 17,
|
|
421
|
+
"detail": "Optional requirement keyword",
|
|
422
|
+
"documentation": {"value": "Marks a protocol requirement as optional (requires @objc)."},
|
|
423
|
+
"insertText": "optional ",
|
|
424
|
+
"insertTextRules": 4,
|
|
425
|
+
"sortText": "02_modifier_optional"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"label": "required",
|
|
429
|
+
"kind": 17,
|
|
430
|
+
"detail": "Required initializer keyword",
|
|
431
|
+
"documentation": {"value": "Requires all subclasses to implement this initializer."},
|
|
432
|
+
"insertText": "required ",
|
|
433
|
+
"insertTextRules": 4,
|
|
434
|
+
"sortText": "02_modifier_required"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"label": "convenience",
|
|
438
|
+
"kind": 17,
|
|
439
|
+
"detail": "Convenience initializer keyword",
|
|
440
|
+
"documentation": {"value": "```swift\nconvenience init() {\n self.init(param: default)\n}\n```\nDeclares a convenience initializer."},
|
|
441
|
+
"insertText": "convenience init(${1:params}) {\n\tself.init(${2:args})\n}",
|
|
442
|
+
"insertTextRules": 4,
|
|
443
|
+
"sortText": "02_modifier_convenience"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"label": "mutating",
|
|
447
|
+
"kind": 17,
|
|
448
|
+
"detail": "Mutating keyword",
|
|
449
|
+
"documentation": {"value": "Allows a method to modify value type properties."},
|
|
450
|
+
"insertText": "mutating func ${1:name}(${2:params}) {\n\t$0\n}",
|
|
451
|
+
"insertTextRules": 4,
|
|
452
|
+
"sortText": "02_modifier_mutating"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"label": "nonmutating",
|
|
456
|
+
"kind": 17,
|
|
457
|
+
"detail": "Nonmutating keyword",
|
|
458
|
+
"documentation": {"value": "Indicates a setter that does not modify the instance."},
|
|
459
|
+
"insertText": "nonmutating ",
|
|
460
|
+
"insertTextRules": 4,
|
|
461
|
+
"sortText": "02_modifier_nonmutating"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"label": "override",
|
|
465
|
+
"kind": 17,
|
|
466
|
+
"detail": "Override keyword",
|
|
467
|
+
"documentation": {"value": "Overrides a superclass method or property."},
|
|
468
|
+
"insertText": "override ",
|
|
469
|
+
"insertTextRules": 4,
|
|
470
|
+
"sortText": "02_modifier_override"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"label": "open",
|
|
474
|
+
"kind": 17,
|
|
475
|
+
"detail": "Open access modifier",
|
|
476
|
+
"documentation": {"value": "Allows access and overriding outside the module."},
|
|
477
|
+
"insertText": "open ",
|
|
478
|
+
"insertTextRules": 4,
|
|
479
|
+
"sortText": "02_modifier_open"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"label": "public",
|
|
483
|
+
"kind": 17,
|
|
484
|
+
"detail": "Public access modifier",
|
|
485
|
+
"documentation": {"value": "Allows access outside the module but not overriding."},
|
|
486
|
+
"insertText": "public ",
|
|
487
|
+
"insertTextRules": 4,
|
|
488
|
+
"sortText": "02_modifier_public"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"label": "internal",
|
|
492
|
+
"kind": 17,
|
|
493
|
+
"detail": "Internal access modifier",
|
|
494
|
+
"documentation": {"value": "Default access level; accessible within the module."},
|
|
495
|
+
"insertText": "internal ",
|
|
496
|
+
"insertTextRules": 4,
|
|
497
|
+
"sortText": "02_modifier_internal"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"label": "fileprivate",
|
|
501
|
+
"kind": 17,
|
|
502
|
+
"detail": "Fileprivate access modifier",
|
|
503
|
+
"documentation": {"value": "Restricts access to the enclosing file."},
|
|
504
|
+
"insertText": "fileprivate ",
|
|
505
|
+
"insertTextRules": 4,
|
|
506
|
+
"sortText": "02_modifier_fileprivate"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"label": "private",
|
|
510
|
+
"kind": 17,
|
|
511
|
+
"detail": "Private access modifier",
|
|
512
|
+
"documentation": {"value": "Restricts access to the enclosing declaration."},
|
|
513
|
+
"insertText": "private ",
|
|
514
|
+
"insertTextRules": 4,
|
|
515
|
+
"sortText": "02_modifier_private"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"label": "inout",
|
|
519
|
+
"kind": 17,
|
|
520
|
+
"detail": "In-out parameter keyword",
|
|
521
|
+
"documentation": {"value": "Passes a parameter by reference so it can be modified."},
|
|
522
|
+
"insertText": "inout ",
|
|
523
|
+
"insertTextRules": 4,
|
|
524
|
+
"sortText": "02_modifier_inout"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"label": "some",
|
|
528
|
+
"kind": 17,
|
|
529
|
+
"detail": "Opaque type keyword",
|
|
530
|
+
"documentation": {"value": "```swift\nfunc make() -> some View { ... }\n```\nDeclares an opaque return type."},
|
|
531
|
+
"insertText": "some ${1:Protocol}",
|
|
532
|
+
"insertTextRules": 4,
|
|
533
|
+
"sortText": "01_keyword_some"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"label": "any",
|
|
537
|
+
"kind": 17,
|
|
538
|
+
"detail": "Existential type keyword",
|
|
539
|
+
"documentation": {"value": "```swift\nvar value: any Protocol\n```\nDeclares an existential type."},
|
|
540
|
+
"insertText": "any ${1:Protocol}",
|
|
541
|
+
"insertTextRules": 4,
|
|
542
|
+
"sortText": "01_keyword_any"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"label": "async",
|
|
546
|
+
"kind": 17,
|
|
547
|
+
"detail": "Async keyword",
|
|
548
|
+
"documentation": {"value": "```swift\nfunc fetchData() async -> Data { ... }\n```\nMarks a function as asynchronous."},
|
|
549
|
+
"insertText": "async ",
|
|
550
|
+
"insertTextRules": 4,
|
|
551
|
+
"sortText": "01_keyword_async"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"label": "await",
|
|
555
|
+
"kind": 17,
|
|
556
|
+
"detail": "Await keyword",
|
|
557
|
+
"documentation": {"value": "```swift\nlet result = await fetchData()\n```\nSuspends execution until async call completes."},
|
|
558
|
+
"insertText": "await ${1:expression}",
|
|
559
|
+
"insertTextRules": 4,
|
|
560
|
+
"sortText": "01_keyword_await"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"label": "actor",
|
|
564
|
+
"kind": 17,
|
|
565
|
+
"detail": "Actor declaration keyword",
|
|
566
|
+
"documentation": {"value": "```swift\nactor MyActor {\n var state: Int = 0\n}\n```\nDeclares a reference type that protects its state from data races."},
|
|
567
|
+
"insertText": "actor ${1:Name} {\n\t$0\n}",
|
|
568
|
+
"insertTextRules": 4,
|
|
569
|
+
"sortText": "01_keyword_actor"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"label": "nonisolated",
|
|
573
|
+
"kind": 17,
|
|
574
|
+
"detail": "Nonisolated keyword",
|
|
575
|
+
"documentation": {"value": "Opts a member out of actor isolation."},
|
|
576
|
+
"insertText": "nonisolated ",
|
|
577
|
+
"insertTextRules": 4,
|
|
578
|
+
"sortText": "02_modifier_nonisolated"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"label": "isolated",
|
|
582
|
+
"kind": 17,
|
|
583
|
+
"detail": "Isolated keyword",
|
|
584
|
+
"documentation": {"value": "Specifies the actor isolation for a parameter."},
|
|
585
|
+
"insertText": "isolated ",
|
|
586
|
+
"insertTextRules": 4,
|
|
587
|
+
"sortText": "02_modifier_isolated"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"label": "consuming",
|
|
591
|
+
"kind": 17,
|
|
592
|
+
"detail": "Consuming ownership keyword",
|
|
593
|
+
"documentation": {"value": "Transfers ownership of the parameter to the function."},
|
|
594
|
+
"insertText": "consuming ",
|
|
595
|
+
"insertTextRules": 4,
|
|
596
|
+
"sortText": "02_modifier_consuming"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"label": "borrowing",
|
|
600
|
+
"kind": 17,
|
|
601
|
+
"detail": "Borrowing ownership keyword",
|
|
602
|
+
"documentation": {"value": "Borrows the parameter without taking ownership."},
|
|
603
|
+
"insertText": "borrowing ",
|
|
604
|
+
"insertTextRules": 4,
|
|
605
|
+
"sortText": "02_modifier_borrowing"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"label": "@MainActor",
|
|
609
|
+
"kind": 17,
|
|
610
|
+
"detail": "Main actor attribute",
|
|
611
|
+
"documentation": {"value": "```swift\n@MainActor\nclass ViewModel { ... }\n```\nEnsures the declaration runs on the main actor."},
|
|
612
|
+
"insertText": "@MainActor\n",
|
|
613
|
+
"insertTextRules": 4,
|
|
614
|
+
"sortText": "03_attribute_MainActor"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"label": "@Published",
|
|
618
|
+
"kind": 17,
|
|
619
|
+
"detail": "Published property wrapper",
|
|
620
|
+
"documentation": {"value": "```swift\n@Published var value: Type\n```\nPublishes changes for Combine subscribers."},
|
|
621
|
+
"insertText": "@Published var ${1:name}: ${2:Type}",
|
|
622
|
+
"insertTextRules": 4,
|
|
623
|
+
"sortText": "03_attribute_Published"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"label": "@State",
|
|
627
|
+
"kind": 17,
|
|
628
|
+
"detail": "State property wrapper",
|
|
629
|
+
"documentation": {"value": "```swift\n@State private var value: Type\n```\nManages local state in SwiftUI views."},
|
|
630
|
+
"insertText": "@State private var ${1:name}: ${2:Type} = ${3:value}",
|
|
631
|
+
"insertTextRules": 4,
|
|
632
|
+
"sortText": "03_attribute_State"
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
"label": "@Binding",
|
|
636
|
+
"kind": 17,
|
|
637
|
+
"detail": "Binding property wrapper",
|
|
638
|
+
"documentation": {"value": "```swift\n@Binding var value: Type\n```\nCreates a two-way connection to a state value."},
|
|
639
|
+
"insertText": "@Binding var ${1:name}: ${2:Type}",
|
|
640
|
+
"insertTextRules": 4,
|
|
641
|
+
"sortText": "03_attribute_Binding"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"label": "@Observable",
|
|
645
|
+
"kind": 17,
|
|
646
|
+
"detail": "Observable macro",
|
|
647
|
+
"documentation": {"value": "```swift\n@Observable\nclass Model { ... }\n```\nMakes a class automatically observable (Swift 5.9+)."},
|
|
648
|
+
"insertText": "@Observable\nclass ${1:Name} {\n\t$0\n}",
|
|
649
|
+
"insertTextRules": 4,
|
|
650
|
+
"sortText": "03_attribute_Observable"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"label": "print",
|
|
654
|
+
"kind": 1,
|
|
655
|
+
"detail": "Print to standard output",
|
|
656
|
+
"documentation": {"value": "```swift\nfunc print(_ items: Any..., separator: String = \" \", terminator: String = \"\\n\")\n```\nWrites textual representations to standard output."},
|
|
657
|
+
"insertText": "print(${1:items})",
|
|
658
|
+
"insertTextRules": 4,
|
|
659
|
+
"sortText": "04_function_print"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"label": "debugPrint",
|
|
663
|
+
"kind": 1,
|
|
664
|
+
"detail": "Debug print to standard output",
|
|
665
|
+
"documentation": {"value": "```swift\nfunc debugPrint(_ items: Any..., separator: String = \" \", terminator: String = \"\\n\")\n```\nWrites debug textual representations to standard output."},
|
|
666
|
+
"insertText": "debugPrint(${1:items})",
|
|
667
|
+
"insertTextRules": 4,
|
|
668
|
+
"sortText": "04_function_debugPrint"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"label": "dump",
|
|
672
|
+
"kind": 1,
|
|
673
|
+
"detail": "Dump object to output",
|
|
674
|
+
"documentation": {"value": "```swift\nfunc dump<T>(_ value: T, name: String? = nil, indent: Int = 0, maxDepth: Int = .max, maxItems: Int = .max) -> T\n```\nDumps an object's contents using its mirror."},
|
|
675
|
+
"insertText": "dump(${1:value})",
|
|
676
|
+
"insertTextRules": 4,
|
|
677
|
+
"sortText": "04_function_dump"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"label": "min",
|
|
681
|
+
"kind": 1,
|
|
682
|
+
"detail": "Return minimum value",
|
|
683
|
+
"documentation": {"value": "```swift\nfunc min<T: Comparable>(_ x: T, _ y: T) -> T\n```\nReturns the lesser of two comparable values."},
|
|
684
|
+
"insertText": "min(${1:x}, ${2:y})",
|
|
685
|
+
"insertTextRules": 4,
|
|
686
|
+
"sortText": "04_function_min"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"label": "max",
|
|
690
|
+
"kind": 1,
|
|
691
|
+
"detail": "Return maximum value",
|
|
692
|
+
"documentation": {"value": "```swift\nfunc max<T: Comparable>(_ x: T, _ y: T) -> T\n```\nReturns the greater of two comparable values."},
|
|
693
|
+
"insertText": "max(${1:x}, ${2:y})",
|
|
694
|
+
"insertTextRules": 4,
|
|
695
|
+
"sortText": "04_function_max"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"label": "abs",
|
|
699
|
+
"kind": 1,
|
|
700
|
+
"detail": "Absolute value",
|
|
701
|
+
"documentation": {"value": "```swift\nfunc abs<T: Comparable & SignedNumeric>(_ x: T) -> T\n```\nReturns the absolute value of the given number."},
|
|
702
|
+
"insertText": "abs(${1:x})",
|
|
703
|
+
"insertTextRules": 4,
|
|
704
|
+
"sortText": "04_function_abs"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"label": "stride",
|
|
708
|
+
"kind": 1,
|
|
709
|
+
"detail": "Create stride sequence",
|
|
710
|
+
"documentation": {"value": "```swift\nfunc stride<T>(from: T, to: T, by: T.Stride) -> StrideTo<T>\n```\nReturns a sequence from start to (but not including) end."},
|
|
711
|
+
"insertText": "stride(from: ${1:start}, to: ${2:end}, by: ${3:step})",
|
|
712
|
+
"insertTextRules": 4,
|
|
713
|
+
"sortText": "04_function_stride"
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"label": "zip",
|
|
717
|
+
"kind": 1,
|
|
718
|
+
"detail": "Zip two sequences",
|
|
719
|
+
"documentation": {"value": "```swift\nfunc zip<Sequence1, Sequence2>(_ sequence1: Sequence1, _ sequence2: Sequence2) -> Zip2Sequence<Sequence1, Sequence2>\n```\nCreates a sequence of pairs from two sequences."},
|
|
720
|
+
"insertText": "zip(${1:sequence1}, ${2:sequence2})",
|
|
721
|
+
"insertTextRules": 4,
|
|
722
|
+
"sortText": "04_function_zip"
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"label": "map",
|
|
726
|
+
"kind": 1,
|
|
727
|
+
"detail": "Transform elements",
|
|
728
|
+
"documentation": {"value": "```swift\nfunc map<T>(_ transform: (Element) throws -> T) rethrows -> [T]\n```\nReturns an array containing results of mapping the given closure."},
|
|
729
|
+
"insertText": "map { ${1:element} in\n\t$0\n}",
|
|
730
|
+
"insertTextRules": 4,
|
|
731
|
+
"sortText": "04_function_map"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"label": "filter",
|
|
735
|
+
"kind": 1,
|
|
736
|
+
"detail": "Filter elements",
|
|
737
|
+
"documentation": {"value": "```swift\nfunc filter(_ isIncluded: (Element) throws -> Bool) rethrows -> [Element]\n```\nReturns elements satisfying the given predicate."},
|
|
738
|
+
"insertText": "filter { ${1:element} in\n\t$0\n}",
|
|
739
|
+
"insertTextRules": 4,
|
|
740
|
+
"sortText": "04_function_filter"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"label": "reduce",
|
|
744
|
+
"kind": 1,
|
|
745
|
+
"detail": "Reduce elements",
|
|
746
|
+
"documentation": {"value": "```swift\nfunc reduce<Result>(_ initialResult: Result, _ nextPartialResult: (Result, Element) throws -> Result) rethrows -> Result\n```\nCombines all elements using the given closure."},
|
|
747
|
+
"insertText": "reduce(${1:initialResult}) { ${2:result}, ${3:element} in\n\t$0\n}",
|
|
748
|
+
"insertTextRules": 4,
|
|
749
|
+
"sortText": "04_function_reduce"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
"label": "compactMap",
|
|
753
|
+
"kind": 1,
|
|
754
|
+
"detail": "Transform and filter nil",
|
|
755
|
+
"documentation": {"value": "```swift\nfunc compactMap<T>(_ transform: (Element) throws -> T?) rethrows -> [T]\n```\nReturns non-nil results of mapping the given closure."},
|
|
756
|
+
"insertText": "compactMap { ${1:element} in\n\t$0\n}",
|
|
757
|
+
"insertTextRules": 4,
|
|
758
|
+
"sortText": "04_function_compactMap"
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"label": "flatMap",
|
|
762
|
+
"kind": 1,
|
|
763
|
+
"detail": "Map and flatten",
|
|
764
|
+
"documentation": {"value": "```swift\nfunc flatMap<T: Sequence>(_ transform: (Element) throws -> T) rethrows -> [T.Element]\n```\nReturns flattened results of mapping the given closure."},
|
|
765
|
+
"insertText": "flatMap { ${1:element} in\n\t$0\n}",
|
|
766
|
+
"insertTextRules": 4,
|
|
767
|
+
"sortText": "04_function_flatMap"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"label": "sorted",
|
|
771
|
+
"kind": 1,
|
|
772
|
+
"detail": "Sort elements",
|
|
773
|
+
"documentation": {"value": "```swift\nfunc sorted() -> [Element]\nfunc sorted(by: (Element, Element) throws -> Bool) rethrows -> [Element]\n```\nReturns the elements sorted."},
|
|
774
|
+
"insertText": "sorted()",
|
|
775
|
+
"insertTextRules": 4,
|
|
776
|
+
"sortText": "04_function_sorted"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"label": "forEach",
|
|
780
|
+
"kind": 1,
|
|
781
|
+
"detail": "Iterate elements",
|
|
782
|
+
"documentation": {"value": "```swift\nfunc forEach(_ body: (Element) throws -> Void) rethrows\n```\nCalls the given closure on each element."},
|
|
783
|
+
"insertText": "forEach { ${1:element} in\n\t$0\n}",
|
|
784
|
+
"insertTextRules": 4,
|
|
785
|
+
"sortText": "04_function_forEach"
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"label": "contains",
|
|
789
|
+
"kind": 1,
|
|
790
|
+
"detail": "Check if contains element",
|
|
791
|
+
"documentation": {"value": "```swift\nfunc contains(_ element: Element) -> Bool\nfunc contains(where: (Element) throws -> Bool) rethrows -> Bool\n```\nReturns whether the sequence contains the element."},
|
|
792
|
+
"insertText": "contains(${1:element})",
|
|
793
|
+
"insertTextRules": 4,
|
|
794
|
+
"sortText": "04_function_contains"
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"label": "first",
|
|
798
|
+
"kind": 9,
|
|
799
|
+
"detail": "First element property",
|
|
800
|
+
"documentation": {"value": "```swift\nvar first: Element?\n```\nThe first element of the collection, or nil if empty."},
|
|
801
|
+
"insertText": "first",
|
|
802
|
+
"insertTextRules": 4,
|
|
803
|
+
"sortText": "04_property_first"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"label": "last",
|
|
807
|
+
"kind": 9,
|
|
808
|
+
"detail": "Last element property",
|
|
809
|
+
"documentation": {"value": "```swift\nvar last: Element?\n```\nThe last element of the collection, or nil if empty."},
|
|
810
|
+
"insertText": "last",
|
|
811
|
+
"insertTextRules": 4,
|
|
812
|
+
"sortText": "04_property_last"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"label": "count",
|
|
816
|
+
"kind": 9,
|
|
817
|
+
"detail": "Count property",
|
|
818
|
+
"documentation": {"value": "```swift\nvar count: Int\n```\nThe number of elements in the collection."},
|
|
819
|
+
"insertText": "count",
|
|
820
|
+
"insertTextRules": 4,
|
|
821
|
+
"sortText": "04_property_count"
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
"label": "isEmpty",
|
|
825
|
+
"kind": 9,
|
|
826
|
+
"detail": "Is empty property",
|
|
827
|
+
"documentation": {"value": "```swift\nvar isEmpty: Bool\n```\nA Boolean value indicating whether the collection is empty."},
|
|
828
|
+
"insertText": "isEmpty",
|
|
829
|
+
"insertTextRules": 4,
|
|
830
|
+
"sortText": "04_property_isEmpty"
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
"label": "append",
|
|
834
|
+
"kind": 1,
|
|
835
|
+
"detail": "Append element",
|
|
836
|
+
"documentation": {"value": "```swift\nmutating func append(_ newElement: Element)\n```\nAdds an element to the end of the array."},
|
|
837
|
+
"insertText": "append(${1:element})",
|
|
838
|
+
"insertTextRules": 4,
|
|
839
|
+
"sortText": "04_function_append"
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
"label": "insert",
|
|
843
|
+
"kind": 1,
|
|
844
|
+
"detail": "Insert element",
|
|
845
|
+
"documentation": {"value": "```swift\nmutating func insert(_ newElement: Element, at i: Int)\n```\nInserts an element at the specified position."},
|
|
846
|
+
"insertText": "insert(${1:element}, at: ${2:index})",
|
|
847
|
+
"insertTextRules": 4,
|
|
848
|
+
"sortText": "04_function_insert"
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
"label": "remove",
|
|
852
|
+
"kind": 1,
|
|
853
|
+
"detail": "Remove element at index",
|
|
854
|
+
"documentation": {"value": "```swift\nmutating func remove(at index: Int) -> Element\n```\nRemoves and returns the element at the specified index."},
|
|
855
|
+
"insertText": "remove(at: ${1:index})",
|
|
856
|
+
"insertTextRules": 4,
|
|
857
|
+
"sortText": "04_function_remove"
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
"label": "removeAll",
|
|
861
|
+
"kind": 1,
|
|
862
|
+
"detail": "Remove all elements",
|
|
863
|
+
"documentation": {"value": "```swift\nmutating func removeAll(keepingCapacity: Bool = false)\n```\nRemoves all elements from the collection."},
|
|
864
|
+
"insertText": "removeAll()",
|
|
865
|
+
"insertTextRules": 4,
|
|
866
|
+
"sortText": "04_function_removeAll"
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"label": "enumerated",
|
|
870
|
+
"kind": 1,
|
|
871
|
+
"detail": "Enumerated sequence",
|
|
872
|
+
"documentation": {"value": "```swift\nfunc enumerated() -> EnumeratedSequence<Self>\n```\nReturns pairs of (offset, element)."},
|
|
873
|
+
"insertText": "enumerated()",
|
|
874
|
+
"insertTextRules": 4,
|
|
875
|
+
"sortText": "04_function_enumerated"
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
"label": "prefix",
|
|
879
|
+
"kind": 1,
|
|
880
|
+
"detail": "Get prefix of collection",
|
|
881
|
+
"documentation": {"value": "```swift\nfunc prefix(_ maxLength: Int) -> Slice<Self>\n```\nReturns the first maxLength elements."},
|
|
882
|
+
"insertText": "prefix(${1:maxLength})",
|
|
883
|
+
"insertTextRules": 4,
|
|
884
|
+
"sortText": "04_function_prefix"
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
"label": "suffix",
|
|
888
|
+
"kind": 1,
|
|
889
|
+
"detail": "Get suffix of collection",
|
|
890
|
+
"documentation": {"value": "```swift\nfunc suffix(_ maxLength: Int) -> Slice<Self>\n```\nReturns the last maxLength elements."},
|
|
891
|
+
"insertText": "suffix(${1:maxLength})",
|
|
892
|
+
"insertTextRules": 4,
|
|
893
|
+
"sortText": "04_function_suffix"
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
"label": "joined",
|
|
897
|
+
"kind": 1,
|
|
898
|
+
"detail": "Join elements",
|
|
899
|
+
"documentation": {"value": "```swift\nfunc joined(separator: String = \"\") -> String\n```\nJoins string elements with a separator."},
|
|
900
|
+
"insertText": "joined(separator: ${1:\", \"})",
|
|
901
|
+
"insertTextRules": 4,
|
|
902
|
+
"sortText": "04_function_joined"
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
"label": "split",
|
|
906
|
+
"kind": 1,
|
|
907
|
+
"detail": "Split string",
|
|
908
|
+
"documentation": {"value": "```swift\nfunc split(separator: Character, maxSplits: Int = .max, omittingEmptySubsequences: Bool = true) -> [Substring]\n```\nSplits a string by the given separator."},
|
|
909
|
+
"insertText": "split(separator: ${1:separator})",
|
|
910
|
+
"insertTextRules": 4,
|
|
911
|
+
"sortText": "04_function_split"
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
"label": "replacingOccurrences",
|
|
915
|
+
"kind": 1,
|
|
916
|
+
"detail": "Replace occurrences in string",
|
|
917
|
+
"documentation": {"value": "```swift\nfunc replacingOccurrences(of target: String, with replacement: String) -> String\n```\nReturns a new string replacing all occurrences of target."},
|
|
918
|
+
"insertText": "replacingOccurrences(of: ${1:target}, with: ${2:replacement})",
|
|
919
|
+
"insertTextRules": 4,
|
|
920
|
+
"sortText": "04_function_replacingOccurrences"
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"label": "hasPrefix",
|
|
924
|
+
"kind": 1,
|
|
925
|
+
"detail": "Check string prefix",
|
|
926
|
+
"documentation": {"value": "```swift\nfunc hasPrefix(_ prefix: String) -> Bool\n```\nReturns whether the string begins with the specified prefix."},
|
|
927
|
+
"insertText": "hasPrefix(${1:prefix})",
|
|
928
|
+
"insertTextRules": 4,
|
|
929
|
+
"sortText": "04_function_hasPrefix"
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
"label": "hasSuffix",
|
|
933
|
+
"kind": 1,
|
|
934
|
+
"detail": "Check string suffix",
|
|
935
|
+
"documentation": {"value": "```swift\nfunc hasSuffix(_ suffix: String) -> Bool\n```\nReturns whether the string ends with the specified suffix."},
|
|
936
|
+
"insertText": "hasSuffix(${1:suffix})",
|
|
937
|
+
"insertTextRules": 4,
|
|
938
|
+
"sortText": "04_function_hasSuffix"
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
"label": "uppercased",
|
|
942
|
+
"kind": 1,
|
|
943
|
+
"detail": "Uppercase string",
|
|
944
|
+
"documentation": {"value": "```swift\nfunc uppercased() -> String\n```\nReturns an uppercased version of the string."},
|
|
945
|
+
"insertText": "uppercased()",
|
|
946
|
+
"insertTextRules": 4,
|
|
947
|
+
"sortText": "04_function_uppercased"
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
"label": "lowercased",
|
|
951
|
+
"kind": 1,
|
|
952
|
+
"detail": "Lowercase string",
|
|
953
|
+
"documentation": {"value": "```swift\nfunc lowercased() -> String\n```\nReturns a lowercased version of the string."},
|
|
954
|
+
"insertText": "lowercased()",
|
|
955
|
+
"insertTextRules": 4,
|
|
956
|
+
"sortText": "04_function_lowercased"
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
"label": "trimmingCharacters",
|
|
960
|
+
"kind": 1,
|
|
961
|
+
"detail": "Trim characters",
|
|
962
|
+
"documentation": {"value": "```swift\nfunc trimmingCharacters(in set: CharacterSet) -> String\n```\nReturns a string with characters in the given set trimmed."},
|
|
963
|
+
"insertText": "trimmingCharacters(in: .${1:whitespaces})",
|
|
964
|
+
"insertTextRules": 4,
|
|
965
|
+
"sortText": "04_function_trimmingCharacters"
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
"label": "Int",
|
|
969
|
+
"kind": 6,
|
|
970
|
+
"detail": "Integer type",
|
|
971
|
+
"documentation": {"value": "```swift\nstruct Int: FixedWidthInteger, SignedInteger\n```\nA signed integer value type."},
|
|
972
|
+
"insertText": "Int",
|
|
973
|
+
"insertTextRules": 4,
|
|
974
|
+
"sortText": "05_type_Int"
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
"label": "Double",
|
|
978
|
+
"kind": 6,
|
|
979
|
+
"detail": "Double-precision floating point",
|
|
980
|
+
"documentation": {"value": "```swift\nstruct Double: FloatingPoint\n```\nA double-precision, floating-point value type."},
|
|
981
|
+
"insertText": "Double",
|
|
982
|
+
"insertTextRules": 4,
|
|
983
|
+
"sortText": "05_type_Double"
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"label": "Float",
|
|
987
|
+
"kind": 6,
|
|
988
|
+
"detail": "Single-precision floating point",
|
|
989
|
+
"documentation": {"value": "```swift\nstruct Float: FloatingPoint\n```\nA single-precision, floating-point value type."},
|
|
990
|
+
"insertText": "Float",
|
|
991
|
+
"insertTextRules": 4,
|
|
992
|
+
"sortText": "05_type_Float"
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
"label": "String",
|
|
996
|
+
"kind": 6,
|
|
997
|
+
"detail": "String type",
|
|
998
|
+
"documentation": {"value": "```swift\nstruct String: StringProtocol\n```\nA Unicode string value."},
|
|
999
|
+
"insertText": "String",
|
|
1000
|
+
"insertTextRules": 4,
|
|
1001
|
+
"sortText": "05_type_String"
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
"label": "Bool",
|
|
1005
|
+
"kind": 6,
|
|
1006
|
+
"detail": "Boolean type",
|
|
1007
|
+
"documentation": {"value": "```swift\nstruct Bool\n```\nA value type whose instances are either true or false."},
|
|
1008
|
+
"insertText": "Bool",
|
|
1009
|
+
"insertTextRules": 4,
|
|
1010
|
+
"sortText": "05_type_Bool"
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
"label": "Array",
|
|
1014
|
+
"kind": 6,
|
|
1015
|
+
"detail": "Array type",
|
|
1016
|
+
"documentation": {"value": "```swift\nstruct Array<Element>: RandomAccessCollection, MutableCollection\n```\nAn ordered, random-access collection."},
|
|
1017
|
+
"insertText": "Array<${1:Element}>",
|
|
1018
|
+
"insertTextRules": 4,
|
|
1019
|
+
"sortText": "05_type_Array"
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
"label": "Dictionary",
|
|
1023
|
+
"kind": 6,
|
|
1024
|
+
"detail": "Dictionary type",
|
|
1025
|
+
"documentation": {"value": "```swift\nstruct Dictionary<Key: Hashable, Value>: Collection\n```\nA collection of key-value pairs."},
|
|
1026
|
+
"insertText": "Dictionary<${1:Key}, ${2:Value}>",
|
|
1027
|
+
"insertTextRules": 4,
|
|
1028
|
+
"sortText": "05_type_Dictionary"
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
"label": "Set",
|
|
1032
|
+
"kind": 6,
|
|
1033
|
+
"detail": "Set type",
|
|
1034
|
+
"documentation": {"value": "```swift\nstruct Set<Element: Hashable>: Collection\n```\nAn unordered collection of unique elements."},
|
|
1035
|
+
"insertText": "Set<${1:Element}>",
|
|
1036
|
+
"insertTextRules": 4,
|
|
1037
|
+
"sortText": "05_type_Set"
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
"label": "Optional",
|
|
1041
|
+
"kind": 15,
|
|
1042
|
+
"detail": "Optional type",
|
|
1043
|
+
"documentation": {"value": "```swift\nenum Optional<Wrapped>: ExpressibleByNilLiteral\n```\nA type that represents either a wrapped value or nil."},
|
|
1044
|
+
"insertText": "Optional<${1:Wrapped}>",
|
|
1045
|
+
"insertTextRules": 4,
|
|
1046
|
+
"sortText": "05_type_Optional"
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
"label": "Result",
|
|
1050
|
+
"kind": 15,
|
|
1051
|
+
"detail": "Result type",
|
|
1052
|
+
"documentation": {"value": "```swift\nenum Result<Success, Failure: Error>\n```\nA value that represents either a success or a failure."},
|
|
1053
|
+
"insertText": "Result<${1:Success}, ${2:Failure}>",
|
|
1054
|
+
"insertTextRules": 4,
|
|
1055
|
+
"sortText": "05_type_Result"
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
"label": "Character",
|
|
1059
|
+
"kind": 6,
|
|
1060
|
+
"detail": "Character type",
|
|
1061
|
+
"documentation": {"value": "```swift\nstruct Character\n```\nA single extended grapheme cluster."},
|
|
1062
|
+
"insertText": "Character",
|
|
1063
|
+
"insertTextRules": 4,
|
|
1064
|
+
"sortText": "05_type_Character"
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
"label": "UInt",
|
|
1068
|
+
"kind": 6,
|
|
1069
|
+
"detail": "Unsigned integer type",
|
|
1070
|
+
"documentation": {"value": "```swift\nstruct UInt: FixedWidthInteger, UnsignedInteger\n```\nAn unsigned integer value type."},
|
|
1071
|
+
"insertText": "UInt",
|
|
1072
|
+
"insertTextRules": 4,
|
|
1073
|
+
"sortText": "05_type_UInt"
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
"label": "Int8",
|
|
1077
|
+
"kind": 6,
|
|
1078
|
+
"detail": "8-bit signed integer",
|
|
1079
|
+
"documentation": {"value": "An 8-bit signed integer type."},
|
|
1080
|
+
"insertText": "Int8",
|
|
1081
|
+
"insertTextRules": 4,
|
|
1082
|
+
"sortText": "05_type_Int8"
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
"label": "Int16",
|
|
1086
|
+
"kind": 6,
|
|
1087
|
+
"detail": "16-bit signed integer",
|
|
1088
|
+
"documentation": {"value": "A 16-bit signed integer type."},
|
|
1089
|
+
"insertText": "Int16",
|
|
1090
|
+
"insertTextRules": 4,
|
|
1091
|
+
"sortText": "05_type_Int16"
|
|
1092
|
+
},
|
|
1093
|
+
{
|
|
1094
|
+
"label": "Int32",
|
|
1095
|
+
"kind": 6,
|
|
1096
|
+
"detail": "32-bit signed integer",
|
|
1097
|
+
"documentation": {"value": "A 32-bit signed integer type."},
|
|
1098
|
+
"insertText": "Int32",
|
|
1099
|
+
"insertTextRules": 4,
|
|
1100
|
+
"sortText": "05_type_Int32"
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
"label": "Int64",
|
|
1104
|
+
"kind": 6,
|
|
1105
|
+
"detail": "64-bit signed integer",
|
|
1106
|
+
"documentation": {"value": "A 64-bit signed integer type."},
|
|
1107
|
+
"insertText": "Int64",
|
|
1108
|
+
"insertTextRules": 4,
|
|
1109
|
+
"sortText": "05_type_Int64"
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
"label": "Data",
|
|
1113
|
+
"kind": 6,
|
|
1114
|
+
"detail": "Raw data type",
|
|
1115
|
+
"documentation": {"value": "```swift\nstruct Data: Collection\n```\nA byte buffer in memory."},
|
|
1116
|
+
"insertText": "Data",
|
|
1117
|
+
"insertTextRules": 4,
|
|
1118
|
+
"sortText": "05_type_Data"
|
|
1119
|
+
},
|
|
1120
|
+
{
|
|
1121
|
+
"label": "URL",
|
|
1122
|
+
"kind": 6,
|
|
1123
|
+
"detail": "URL type",
|
|
1124
|
+
"documentation": {"value": "```swift\nstruct URL: Hashable\n```\nA value that identifies the location of a resource."},
|
|
1125
|
+
"insertText": "URL",
|
|
1126
|
+
"insertTextRules": 4,
|
|
1127
|
+
"sortText": "05_type_URL"
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
"label": "Date",
|
|
1131
|
+
"kind": 6,
|
|
1132
|
+
"detail": "Date type",
|
|
1133
|
+
"documentation": {"value": "```swift\nstruct Date: Comparable, Hashable\n```\nA specific point in time."},
|
|
1134
|
+
"insertText": "Date",
|
|
1135
|
+
"insertTextRules": 4,
|
|
1136
|
+
"sortText": "05_type_Date"
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
"label": "Error",
|
|
1140
|
+
"kind": 7,
|
|
1141
|
+
"detail": "Error protocol",
|
|
1142
|
+
"documentation": {"value": "```swift\nprotocol Error\n```\nA type representing an error value that can be thrown."},
|
|
1143
|
+
"insertText": "Error",
|
|
1144
|
+
"insertTextRules": 4,
|
|
1145
|
+
"sortText": "05_type_Error"
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
"label": "Codable",
|
|
1149
|
+
"kind": 7,
|
|
1150
|
+
"detail": "Codable protocol",
|
|
1151
|
+
"documentation": {"value": "```swift\ntypealias Codable = Decodable & Encodable\n```\nA type that can convert itself to/from external representations."},
|
|
1152
|
+
"insertText": "Codable",
|
|
1153
|
+
"insertTextRules": 4,
|
|
1154
|
+
"sortText": "05_type_Codable"
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
"label": "Hashable",
|
|
1158
|
+
"kind": 7,
|
|
1159
|
+
"detail": "Hashable protocol",
|
|
1160
|
+
"documentation": {"value": "```swift\nprotocol Hashable: Equatable\n```\nA type that can be hashed into a Hasher to produce an integer hash value."},
|
|
1161
|
+
"insertText": "Hashable",
|
|
1162
|
+
"insertTextRules": 4,
|
|
1163
|
+
"sortText": "05_type_Hashable"
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
"label": "Equatable",
|
|
1167
|
+
"kind": 7,
|
|
1168
|
+
"detail": "Equatable protocol",
|
|
1169
|
+
"documentation": {"value": "```swift\nprotocol Equatable\n```\nA type that can be compared for value equality."},
|
|
1170
|
+
"insertText": "Equatable",
|
|
1171
|
+
"insertTextRules": 4,
|
|
1172
|
+
"sortText": "05_type_Equatable"
|
|
1173
|
+
},
|
|
1174
|
+
{
|
|
1175
|
+
"label": "Comparable",
|
|
1176
|
+
"kind": 7,
|
|
1177
|
+
"detail": "Comparable protocol",
|
|
1178
|
+
"documentation": {"value": "```swift\nprotocol Comparable: Equatable\n```\nA type that can be compared using relational operators."},
|
|
1179
|
+
"insertText": "Comparable",
|
|
1180
|
+
"insertTextRules": 4,
|
|
1181
|
+
"sortText": "05_type_Comparable"
|
|
1182
|
+
},
|
|
1183
|
+
{
|
|
1184
|
+
"label": "Identifiable",
|
|
1185
|
+
"kind": 7,
|
|
1186
|
+
"detail": "Identifiable protocol",
|
|
1187
|
+
"documentation": {"value": "```swift\nprotocol Identifiable {\n associatedtype ID: Hashable\n var id: ID { get }\n}\n```\nA class of types with a stable identity."},
|
|
1188
|
+
"insertText": "Identifiable",
|
|
1189
|
+
"insertTextRules": 4,
|
|
1190
|
+
"sortText": "05_type_Identifiable"
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
"label": "Sendable",
|
|
1194
|
+
"kind": 7,
|
|
1195
|
+
"detail": "Sendable protocol",
|
|
1196
|
+
"documentation": {"value": "```swift\nprotocol Sendable\n```\nA type whose values can safely be passed across concurrency domains."},
|
|
1197
|
+
"insertText": "Sendable",
|
|
1198
|
+
"insertTextRules": 4,
|
|
1199
|
+
"sortText": "05_type_Sendable"
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
"label": "AsyncSequence",
|
|
1203
|
+
"kind": 7,
|
|
1204
|
+
"detail": "AsyncSequence protocol",
|
|
1205
|
+
"documentation": {"value": "```swift\nprotocol AsyncSequence\n```\nA type providing asynchronous, sequential, iterated access to its elements."},
|
|
1206
|
+
"insertText": "AsyncSequence",
|
|
1207
|
+
"insertTextRules": 4,
|
|
1208
|
+
"sortText": "05_type_AsyncSequence"
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
"label": "Task",
|
|
1212
|
+
"kind": 6,
|
|
1213
|
+
"detail": "Concurrency Task",
|
|
1214
|
+
"documentation": {"value": "```swift\nstruct Task<Success: Sendable, Failure: Error>\n```\nA unit of asynchronous work."},
|
|
1215
|
+
"insertText": "Task {\n\t$0\n}",
|
|
1216
|
+
"insertTextRules": 4,
|
|
1217
|
+
"sortText": "05_type_Task"
|
|
1218
|
+
},
|
|
1219
|
+
{
|
|
1220
|
+
"label": "if let",
|
|
1221
|
+
"kind": 28,
|
|
1222
|
+
"detail": "Optional binding snippet",
|
|
1223
|
+
"documentation": {"value": "```swift\nif let value = optional {\n // use value\n}\n```\nSafely unwraps an optional."},
|
|
1224
|
+
"insertText": "if let ${1:value} = ${2:optional} {\n\t$0\n}",
|
|
1225
|
+
"insertTextRules": 4,
|
|
1226
|
+
"sortText": "06_snippet_if_let"
|
|
1227
|
+
},
|
|
1228
|
+
{
|
|
1229
|
+
"label": "guard let",
|
|
1230
|
+
"kind": 28,
|
|
1231
|
+
"detail": "Guard let snippet",
|
|
1232
|
+
"documentation": {"value": "```swift\nguard let value = optional else {\n return\n}\n```\nEarly exit guard with optional binding."},
|
|
1233
|
+
"insertText": "guard let ${1:value} = ${2:optional} else {\n\t${3:return}\n}",
|
|
1234
|
+
"insertTextRules": 4,
|
|
1235
|
+
"sortText": "06_snippet_guard_let"
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
"label": "do-catch",
|
|
1239
|
+
"kind": 28,
|
|
1240
|
+
"detail": "Do-catch snippet",
|
|
1241
|
+
"documentation": {"value": "```swift\ndo {\n try expression\n} catch {\n print(error)\n}\n```\nError handling block."},
|
|
1242
|
+
"insertText": "do {\n\ttry ${1:expression}\n} catch {\n\t${2:print(error)}\n}",
|
|
1243
|
+
"insertTextRules": 4,
|
|
1244
|
+
"sortText": "06_snippet_do_catch"
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
"label": "for-in",
|
|
1248
|
+
"kind": 28,
|
|
1249
|
+
"detail": "For-in loop snippet",
|
|
1250
|
+
"documentation": {"value": "```swift\nfor item in collection {\n // body\n}\n```\nIterate over a sequence."},
|
|
1251
|
+
"insertText": "for ${1:item} in ${2:collection} {\n\t$0\n}",
|
|
1252
|
+
"insertTextRules": 4,
|
|
1253
|
+
"sortText": "06_snippet_for_in"
|
|
1254
|
+
},
|
|
1255
|
+
{
|
|
1256
|
+
"label": "switch-enum",
|
|
1257
|
+
"kind": 28,
|
|
1258
|
+
"detail": "Switch on enum snippet",
|
|
1259
|
+
"documentation": {"value": "```swift\nswitch value {\ncase .case1:\n break\ncase .case2:\n break\n}\n```\nExhaustive switch on enum."},
|
|
1260
|
+
"insertText": "switch ${1:value} {\ncase .${2:case1}:\n\t${3:break}\ncase .${4:case2}:\n\t${5:break}\n}",
|
|
1261
|
+
"insertTextRules": 4,
|
|
1262
|
+
"sortText": "06_snippet_switch_enum"
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
"label": "closure",
|
|
1266
|
+
"kind": 28,
|
|
1267
|
+
"detail": "Closure snippet",
|
|
1268
|
+
"documentation": {"value": "```swift\n{ (param: Type) -> ReturnType in\n // body\n}\n```\nClosure expression."},
|
|
1269
|
+
"insertText": "{ (${1:params}) -> ${2:Void} in\n\t$0\n}",
|
|
1270
|
+
"insertTextRules": 4,
|
|
1271
|
+
"sortText": "06_snippet_closure"
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
"label": "async-func",
|
|
1275
|
+
"kind": 28,
|
|
1276
|
+
"detail": "Async function snippet",
|
|
1277
|
+
"documentation": {"value": "```swift\nfunc name() async throws -> Type {\n // body\n}\n```\nAsync throwing function."},
|
|
1278
|
+
"insertText": "func ${1:name}(${2:params}) async throws -> ${3:Void} {\n\t$0\n}",
|
|
1279
|
+
"insertTextRules": 4,
|
|
1280
|
+
"sortText": "06_snippet_async_func"
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
"label": "struct-codable",
|
|
1284
|
+
"kind": 28,
|
|
1285
|
+
"detail": "Codable struct snippet",
|
|
1286
|
+
"documentation": {"value": "```swift\nstruct Name: Codable {\n let property: Type\n}\n```\nCodable struct for JSON decoding."},
|
|
1287
|
+
"insertText": "struct ${1:Name}: Codable {\n\tlet ${2:property}: ${3:Type}\n}",
|
|
1288
|
+
"insertTextRules": 4,
|
|
1289
|
+
"sortText": "06_snippet_struct_codable"
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
"label": "swiftui-view",
|
|
1293
|
+
"kind": 28,
|
|
1294
|
+
"detail": "SwiftUI View snippet",
|
|
1295
|
+
"documentation": {"value": "```swift\nstruct MyView: View {\n var body: some View {\n Text(\"Hello\")\n }\n}\n```\nSwiftUI view declaration."},
|
|
1296
|
+
"insertText": "struct ${1:MyView}: View {\n\tvar body: some View {\n\t\t${2:Text(\"Hello\")}\n\t}\n}",
|
|
1297
|
+
"insertTextRules": 4,
|
|
1298
|
+
"sortText": "06_snippet_swiftui_view"
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
"label": "enum-error",
|
|
1302
|
+
"kind": 28,
|
|
1303
|
+
"detail": "Error enum snippet",
|
|
1304
|
+
"documentation": {"value": "```swift\nenum MyError: Error {\n case notFound\n case invalidInput(String)\n}\n```\nCustom error type."},
|
|
1305
|
+
"insertText": "enum ${1:MyError}: Error {\n\tcase ${2:someError}\n\tcase ${3:otherError}(${4:String})\n}",
|
|
1306
|
+
"insertTextRules": 4,
|
|
1307
|
+
"sortText": "06_snippet_enum_error"
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
"label": "protocol-default",
|
|
1311
|
+
"kind": 28,
|
|
1312
|
+
"detail": "Protocol with default implementation snippet",
|
|
1313
|
+
"documentation": {"value": "Protocol with extension providing default implementation."},
|
|
1314
|
+
"insertText": "protocol ${1:Name} {\n\tfunc ${2:method}()\n}\n\nextension ${1:Name} {\n\tfunc ${2:method}() {\n\t\t$0\n\t}\n}",
|
|
1315
|
+
"insertTextRules": 4,
|
|
1316
|
+
"sortText": "06_snippet_protocol_default"
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
"label": "task-group",
|
|
1320
|
+
"kind": 28,
|
|
1321
|
+
"detail": "Task group snippet",
|
|
1322
|
+
"documentation": {"value": "```swift\nawait withTaskGroup(of: Type.self) { group in\n group.addTask { ... }\n}\n```\nStructured concurrency task group."},
|
|
1323
|
+
"insertText": "await withTaskGroup(of: ${1:Type}.self) { group in\n\tgroup.addTask {\n\t\t$0\n\t}\n}",
|
|
1324
|
+
"insertTextRules": 4,
|
|
1325
|
+
"sortText": "06_snippet_task_group"
|
|
1326
|
+
},
|
|
1327
|
+
{
|
|
1328
|
+
"label": "Void",
|
|
1329
|
+
"kind": 6,
|
|
1330
|
+
"detail": "Void type",
|
|
1331
|
+
"documentation": {"value": "```swift\ntypealias Void = ()\n```\nThe empty tuple type, used for functions that return nothing."},
|
|
1332
|
+
"insertText": "Void",
|
|
1333
|
+
"insertTextRules": 4,
|
|
1334
|
+
"sortText": "05_type_Void"
|
|
1335
|
+
},
|
|
1336
|
+
{
|
|
1337
|
+
"label": "Never",
|
|
1338
|
+
"kind": 15,
|
|
1339
|
+
"detail": "Never type",
|
|
1340
|
+
"documentation": {"value": "```swift\nenum Never\n```\nA type with no values; used for functions that never return."},
|
|
1341
|
+
"insertText": "Never",
|
|
1342
|
+
"insertTextRules": 4,
|
|
1343
|
+
"sortText": "05_type_Never"
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
"label": "Any",
|
|
1347
|
+
"kind": 17,
|
|
1348
|
+
"detail": "Any type",
|
|
1349
|
+
"documentation": {"value": "The protocol to which all types implicitly conform."},
|
|
1350
|
+
"insertText": "Any",
|
|
1351
|
+
"insertTextRules": 4,
|
|
1352
|
+
"sortText": "05_type_Any"
|
|
1353
|
+
},
|
|
1354
|
+
{
|
|
1355
|
+
"label": "AnyObject",
|
|
1356
|
+
"kind": 7,
|
|
1357
|
+
"detail": "AnyObject protocol",
|
|
1358
|
+
"documentation": {"value": "The protocol to which all classes implicitly conform."},
|
|
1359
|
+
"insertText": "AnyObject",
|
|
1360
|
+
"insertTextRules": 4,
|
|
1361
|
+
"sortText": "05_type_AnyObject"
|
|
1362
|
+
},
|
|
1363
|
+
{
|
|
1364
|
+
"label": "Range",
|
|
1365
|
+
"kind": 6,
|
|
1366
|
+
"detail": "Half-open range type",
|
|
1367
|
+
"documentation": {"value": "```swift\nstruct Range<Bound: Comparable>\n```\nA half-open interval from a lower bound up to, but not including, an upper bound."},
|
|
1368
|
+
"insertText": "Range<${1:Int}>",
|
|
1369
|
+
"insertTextRules": 4,
|
|
1370
|
+
"sortText": "05_type_Range"
|
|
1371
|
+
},
|
|
1372
|
+
{
|
|
1373
|
+
"label": "ClosedRange",
|
|
1374
|
+
"kind": 6,
|
|
1375
|
+
"detail": "Closed range type",
|
|
1376
|
+
"documentation": {"value": "```swift\nstruct ClosedRange<Bound: Comparable>\n```\nAn interval from a lower bound up to, and including, an upper bound."},
|
|
1377
|
+
"insertText": "ClosedRange<${1:Int}>",
|
|
1378
|
+
"insertTextRules": 4,
|
|
1379
|
+
"sortText": "05_type_ClosedRange"
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
"label": "true",
|
|
1383
|
+
"kind": 14,
|
|
1384
|
+
"detail": "Boolean true",
|
|
1385
|
+
"documentation": {"value": "Boolean literal true."},
|
|
1386
|
+
"insertText": "true",
|
|
1387
|
+
"insertTextRules": 4,
|
|
1388
|
+
"sortText": "07_constant_true"
|
|
1389
|
+
},
|
|
1390
|
+
{
|
|
1391
|
+
"label": "false",
|
|
1392
|
+
"kind": 14,
|
|
1393
|
+
"detail": "Boolean false",
|
|
1394
|
+
"documentation": {"value": "Boolean literal false."},
|
|
1395
|
+
"insertText": "false",
|
|
1396
|
+
"insertTextRules": 4,
|
|
1397
|
+
"sortText": "07_constant_false"
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
"label": "nil",
|
|
1401
|
+
"kind": 14,
|
|
1402
|
+
"detail": "Nil literal",
|
|
1403
|
+
"documentation": {"value": "The absence of a value for optional types."},
|
|
1404
|
+
"insertText": "nil",
|
|
1405
|
+
"insertTextRules": 4,
|
|
1406
|
+
"sortText": "07_constant_nil"
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
"label": "Foundation",
|
|
1410
|
+
"kind": 8,
|
|
1411
|
+
"detail": "Foundation framework",
|
|
1412
|
+
"documentation": {"value": "```swift\nimport Foundation\n```\nApple's base framework for essential data types, collections, and OS services."},
|
|
1413
|
+
"insertText": "Foundation",
|
|
1414
|
+
"insertTextRules": 4,
|
|
1415
|
+
"sortText": "08_module_Foundation"
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
"label": "SwiftUI",
|
|
1419
|
+
"kind": 8,
|
|
1420
|
+
"detail": "SwiftUI framework",
|
|
1421
|
+
"documentation": {"value": "```swift\nimport SwiftUI\n```\nApple's declarative UI framework."},
|
|
1422
|
+
"insertText": "SwiftUI",
|
|
1423
|
+
"insertTextRules": 4,
|
|
1424
|
+
"sortText": "08_module_SwiftUI"
|
|
1425
|
+
},
|
|
1426
|
+
{
|
|
1427
|
+
"label": "Combine",
|
|
1428
|
+
"kind": 8,
|
|
1429
|
+
"detail": "Combine framework",
|
|
1430
|
+
"documentation": {"value": "```swift\nimport Combine\n```\nApple's reactive programming framework."},
|
|
1431
|
+
"insertText": "Combine",
|
|
1432
|
+
"insertTextRules": 4,
|
|
1433
|
+
"sortText": "08_module_Combine"
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
"label": "UIKit",
|
|
1437
|
+
"kind": 8,
|
|
1438
|
+
"detail": "UIKit framework",
|
|
1439
|
+
"documentation": {"value": "```swift\nimport UIKit\n```\nApple's imperative UI framework for iOS/tvOS."},
|
|
1440
|
+
"insertText": "UIKit",
|
|
1441
|
+
"insertTextRules": 4,
|
|
1442
|
+
"sortText": "08_module_UIKit"
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
"label": "@objc",
|
|
1446
|
+
"kind": 17,
|
|
1447
|
+
"detail": "Objective-C attribute",
|
|
1448
|
+
"documentation": {"value": "Exposes the declaration to Objective-C runtime."},
|
|
1449
|
+
"insertText": "@objc ",
|
|
1450
|
+
"insertTextRules": 4,
|
|
1451
|
+
"sortText": "03_attribute_objc"
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
"label": "@discardableResult",
|
|
1455
|
+
"kind": 17,
|
|
1456
|
+
"detail": "Discardable result attribute",
|
|
1457
|
+
"documentation": {"value": "Suppresses the unused result warning."},
|
|
1458
|
+
"insertText": "@discardableResult\n",
|
|
1459
|
+
"insertTextRules": 4,
|
|
1460
|
+
"sortText": "03_attribute_discardableResult"
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
"label": "@available",
|
|
1464
|
+
"kind": 17,
|
|
1465
|
+
"detail": "Availability attribute",
|
|
1466
|
+
"documentation": {"value": "```swift\n@available(iOS 15.0, macOS 12.0, *)\n```\nSpecifies platform availability."},
|
|
1467
|
+
"insertText": "@available(${1:iOS 15.0}, *)\n",
|
|
1468
|
+
"insertTextRules": 4,
|
|
1469
|
+
"sortText": "03_attribute_available"
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
"label": "@escaping",
|
|
1473
|
+
"kind": 17,
|
|
1474
|
+
"detail": "Escaping closure attribute",
|
|
1475
|
+
"documentation": {"value": "Marks a closure parameter that may outlive the function call."},
|
|
1476
|
+
"insertText": "@escaping ",
|
|
1477
|
+
"insertTextRules": 4,
|
|
1478
|
+
"sortText": "03_attribute_escaping"
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
"label": "@Environment",
|
|
1482
|
+
"kind": 17,
|
|
1483
|
+
"detail": "Environment property wrapper",
|
|
1484
|
+
"documentation": {"value": "```swift\n@Environment(\\.colorScheme) var colorScheme\n```\nReads a value from the SwiftUI environment."},
|
|
1485
|
+
"insertText": "@Environment(\\.${1:keyPath}) var ${2:name}",
|
|
1486
|
+
"insertTextRules": 4,
|
|
1487
|
+
"sortText": "03_attribute_Environment"
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
"label": "@StateObject",
|
|
1491
|
+
"kind": 17,
|
|
1492
|
+
"detail": "StateObject property wrapper",
|
|
1493
|
+
"documentation": {"value": "```swift\n@StateObject var model = ViewModel()\n```\nCreates and manages an observable object in SwiftUI."},
|
|
1494
|
+
"insertText": "@StateObject var ${1:name} = ${2:ViewModel}()",
|
|
1495
|
+
"insertTextRules": 4,
|
|
1496
|
+
"sortText": "03_attribute_StateObject"
|
|
1497
|
+
},
|
|
1498
|
+
{
|
|
1499
|
+
"label": "@ObservedObject",
|
|
1500
|
+
"kind": 17,
|
|
1501
|
+
"detail": "ObservedObject property wrapper",
|
|
1502
|
+
"documentation": {"value": "```swift\n@ObservedObject var model: ViewModel\n```\nObserves an external observable object."},
|
|
1503
|
+
"insertText": "@ObservedObject var ${1:name}: ${2:ViewModel}",
|
|
1504
|
+
"insertTextRules": 4,
|
|
1505
|
+
"sortText": "03_attribute_ObservedObject"
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
"label": "@EnvironmentObject",
|
|
1509
|
+
"kind": 17,
|
|
1510
|
+
"detail": "EnvironmentObject property wrapper",
|
|
1511
|
+
"documentation": {"value": "Reads a shared observable object from the environment."},
|
|
1512
|
+
"insertText": "@EnvironmentObject var ${1:name}: ${2:Type}",
|
|
1513
|
+
"insertTextRules": 4,
|
|
1514
|
+
"sortText": "03_attribute_EnvironmentObject"
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
"label": "Decodable",
|
|
1518
|
+
"kind": 7,
|
|
1519
|
+
"detail": "Decodable protocol",
|
|
1520
|
+
"documentation": {"value": "```swift\nprotocol Decodable\n```\nA type that can decode itself from an external representation."},
|
|
1521
|
+
"insertText": "Decodable",
|
|
1522
|
+
"insertTextRules": 4,
|
|
1523
|
+
"sortText": "05_type_Decodable"
|
|
1524
|
+
},
|
|
1525
|
+
{
|
|
1526
|
+
"label": "Encodable",
|
|
1527
|
+
"kind": 7,
|
|
1528
|
+
"detail": "Encodable protocol",
|
|
1529
|
+
"documentation": {"value": "```swift\nprotocol Encodable\n```\nA type that can encode itself to an external representation."},
|
|
1530
|
+
"insertText": "Encodable",
|
|
1531
|
+
"insertTextRules": 4,
|
|
1532
|
+
"sortText": "05_type_Encodable"
|
|
1533
|
+
},
|
|
1534
|
+
{
|
|
1535
|
+
"label": "CustomStringConvertible",
|
|
1536
|
+
"kind": 7,
|
|
1537
|
+
"detail": "CustomStringConvertible protocol",
|
|
1538
|
+
"documentation": {"value": "A type with a customized textual representation via the description property."},
|
|
1539
|
+
"insertText": "CustomStringConvertible",
|
|
1540
|
+
"insertTextRules": 4,
|
|
1541
|
+
"sortText": "05_type_CustomStringConvertible"
|
|
1542
|
+
},
|
|
1543
|
+
{
|
|
1544
|
+
"label": "Sequence",
|
|
1545
|
+
"kind": 7,
|
|
1546
|
+
"detail": "Sequence protocol",
|
|
1547
|
+
"documentation": {"value": "A type providing sequential, iterated access to its elements."},
|
|
1548
|
+
"insertText": "Sequence",
|
|
1549
|
+
"insertTextRules": 4,
|
|
1550
|
+
"sortText": "05_type_Sequence"
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
"label": "Collection",
|
|
1554
|
+
"kind": 7,
|
|
1555
|
+
"detail": "Collection protocol",
|
|
1556
|
+
"documentation": {"value": "A sequence whose elements can be traversed multiple times and accessed by indexed subscript."},
|
|
1557
|
+
"insertText": "Collection",
|
|
1558
|
+
"insertTextRules": 4,
|
|
1559
|
+
"sortText": "05_type_Collection"
|
|
1560
|
+
},
|
|
1561
|
+
{
|
|
1562
|
+
"label": "AnyHashable",
|
|
1563
|
+
"kind": 6,
|
|
1564
|
+
"detail": "Type-erased hashable value",
|
|
1565
|
+
"documentation": {"value": "A type-erased hashable value."},
|
|
1566
|
+
"insertText": "AnyHashable",
|
|
1567
|
+
"insertTextRules": 4,
|
|
1568
|
+
"sortText": "05_type_AnyHashable"
|
|
1569
|
+
},
|
|
1570
|
+
{
|
|
1571
|
+
"label": "Substring",
|
|
1572
|
+
"kind": 6,
|
|
1573
|
+
"detail": "Substring type",
|
|
1574
|
+
"documentation": {"value": "A slice of a string. Shares storage with the original String."},
|
|
1575
|
+
"insertText": "Substring",
|
|
1576
|
+
"insertTextRules": 4,
|
|
1577
|
+
"sortText": "05_type_Substring"
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
"label": "UInt8",
|
|
1581
|
+
"kind": 6,
|
|
1582
|
+
"detail": "8-bit unsigned integer",
|
|
1583
|
+
"documentation": {"value": "An 8-bit unsigned integer type."},
|
|
1584
|
+
"insertText": "UInt8",
|
|
1585
|
+
"insertTextRules": 4,
|
|
1586
|
+
"sortText": "05_type_UInt8"
|
|
1587
|
+
},
|
|
1588
|
+
{
|
|
1589
|
+
"label": "UInt16",
|
|
1590
|
+
"kind": 6,
|
|
1591
|
+
"detail": "16-bit unsigned integer",
|
|
1592
|
+
"documentation": {"value": "A 16-bit unsigned integer type."},
|
|
1593
|
+
"insertText": "UInt16",
|
|
1594
|
+
"insertTextRules": 4,
|
|
1595
|
+
"sortText": "05_type_UInt16"
|
|
1596
|
+
},
|
|
1597
|
+
{
|
|
1598
|
+
"label": "UInt32",
|
|
1599
|
+
"kind": 6,
|
|
1600
|
+
"detail": "32-bit unsigned integer",
|
|
1601
|
+
"documentation": {"value": "A 32-bit unsigned integer type."},
|
|
1602
|
+
"insertText": "UInt32",
|
|
1603
|
+
"insertTextRules": 4,
|
|
1604
|
+
"sortText": "05_type_UInt32"
|
|
1605
|
+
},
|
|
1606
|
+
{
|
|
1607
|
+
"label": "UInt64",
|
|
1608
|
+
"kind": 6,
|
|
1609
|
+
"detail": "64-bit unsigned integer",
|
|
1610
|
+
"documentation": {"value": "A 64-bit unsigned integer type."},
|
|
1611
|
+
"insertText": "UInt64",
|
|
1612
|
+
"insertTextRules": 4,
|
|
1613
|
+
"sortText": "05_type_UInt64"
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
"label": "#selector",
|
|
1617
|
+
"kind": 17,
|
|
1618
|
+
"detail": "Selector expression",
|
|
1619
|
+
"documentation": {"value": "```swift\n#selector(MyClass.method)\n```\nRefers to an Objective-C selector."},
|
|
1620
|
+
"insertText": "#selector(${1:method})",
|
|
1621
|
+
"insertTextRules": 4,
|
|
1622
|
+
"sortText": "01_keyword_selector"
|
|
1623
|
+
},
|
|
1624
|
+
{
|
|
1625
|
+
"label": "#if",
|
|
1626
|
+
"kind": 17,
|
|
1627
|
+
"detail": "Conditional compilation",
|
|
1628
|
+
"documentation": {"value": "```swift\n#if os(iOS)\n // iOS-specific code\n#endif\n```\nConditional compilation block."},
|
|
1629
|
+
"insertText": "#if ${1:condition}\n$0\n#endif",
|
|
1630
|
+
"insertTextRules": 4,
|
|
1631
|
+
"sortText": "01_keyword_if_directive"
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
"label": "precondition",
|
|
1635
|
+
"kind": 1,
|
|
1636
|
+
"detail": "Precondition check",
|
|
1637
|
+
"documentation": {"value": "```swift\nfunc precondition(_ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String = \"\", file: StaticString = #file, line: UInt = #line)\n```\nChecks a necessary condition for making forward progress."},
|
|
1638
|
+
"insertText": "precondition(${1:condition}, ${2:\"message\"})",
|
|
1639
|
+
"insertTextRules": 4,
|
|
1640
|
+
"sortText": "04_function_precondition"
|
|
1641
|
+
},
|
|
1642
|
+
{
|
|
1643
|
+
"label": "assert",
|
|
1644
|
+
"kind": 1,
|
|
1645
|
+
"detail": "Debug assertion",
|
|
1646
|
+
"documentation": {"value": "```swift\nfunc assert(_ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String = \"\")\n```\nPerforms a debug-only assertion."},
|
|
1647
|
+
"insertText": "assert(${1:condition}, ${2:\"message\"})",
|
|
1648
|
+
"insertTextRules": 4,
|
|
1649
|
+
"sortText": "04_function_assert"
|
|
1650
|
+
},
|
|
1651
|
+
{
|
|
1652
|
+
"label": "fatalError",
|
|
1653
|
+
"kind": 1,
|
|
1654
|
+
"detail": "Fatal error",
|
|
1655
|
+
"documentation": {"value": "```swift\nfunc fatalError(_ message: @autoclosure () -> String = \"\", file: StaticString = #file, line: UInt = #line) -> Never\n```\nUnconditionally stops execution with a message."},
|
|
1656
|
+
"insertText": "fatalError(${1:\"message\"})",
|
|
1657
|
+
"insertTextRules": 4,
|
|
1658
|
+
"sortText": "04_function_fatalError"
|
|
1659
|
+
},
|
|
1660
|
+
{
|
|
1661
|
+
"label": "type(of:)",
|
|
1662
|
+
"kind": 1,
|
|
1663
|
+
"detail": "Get dynamic type",
|
|
1664
|
+
"documentation": {"value": "```swift\nfunc type<T>(of value: T) -> T.Type\n```\nReturns the dynamic type of a value."},
|
|
1665
|
+
"insertText": "type(of: ${1:value})",
|
|
1666
|
+
"insertTextRules": 4,
|
|
1667
|
+
"sortText": "04_function_typeOf"
|
|
1668
|
+
},
|
|
1669
|
+
{
|
|
1670
|
+
"label": "withAnimation",
|
|
1671
|
+
"kind": 1,
|
|
1672
|
+
"detail": "SwiftUI animation wrapper",
|
|
1673
|
+
"documentation": {"value": "```swift\nwithAnimation(.default) {\n // state changes\n}\n```\nWraps state changes in an animation."},
|
|
1674
|
+
"insertText": "withAnimation(${1:.default}) {\n\t$0\n}",
|
|
1675
|
+
"insertTextRules": 4,
|
|
1676
|
+
"sortText": "04_function_withAnimation"
|
|
1677
|
+
},
|
|
1678
|
+
{
|
|
1679
|
+
"label": "DispatchQueue",
|
|
1680
|
+
"kind": 5,
|
|
1681
|
+
"detail": "Grand Central Dispatch queue",
|
|
1682
|
+
"documentation": {"value": "```swift\nclass DispatchQueue\n```\nManages the execution of work items on a serial or concurrent queue."},
|
|
1683
|
+
"insertText": "DispatchQueue.${1:main}.${2:async} {\n\t$0\n}",
|
|
1684
|
+
"insertTextRules": 4,
|
|
1685
|
+
"sortText": "05_type_DispatchQueue"
|
|
1686
|
+
},
|
|
1687
|
+
{
|
|
1688
|
+
"label": "JSONDecoder",
|
|
1689
|
+
"kind": 5,
|
|
1690
|
+
"detail": "JSON decoder",
|
|
1691
|
+
"documentation": {"value": "```swift\nlet decoder = JSONDecoder()\nlet value = try decoder.decode(Type.self, from: data)\n```\nDecodes JSON data into Swift types."},
|
|
1692
|
+
"insertText": "JSONDecoder()",
|
|
1693
|
+
"insertTextRules": 4,
|
|
1694
|
+
"sortText": "05_type_JSONDecoder"
|
|
1695
|
+
},
|
|
1696
|
+
{
|
|
1697
|
+
"label": "JSONEncoder",
|
|
1698
|
+
"kind": 5,
|
|
1699
|
+
"detail": "JSON encoder",
|
|
1700
|
+
"documentation": {"value": "```swift\nlet encoder = JSONEncoder()\nlet data = try encoder.encode(value)\n```\nEncodes Swift types to JSON data."},
|
|
1701
|
+
"insertText": "JSONEncoder()",
|
|
1702
|
+
"insertTextRules": 4,
|
|
1703
|
+
"sortText": "05_type_JSONEncoder"
|
|
1704
|
+
},
|
|
1705
|
+
{
|
|
1706
|
+
"label": "URLSession",
|
|
1707
|
+
"kind": 5,
|
|
1708
|
+
"detail": "URL session",
|
|
1709
|
+
"documentation": {"value": "```swift\nclass URLSession\n```\nCoordinates a group of network data transfer tasks."},
|
|
1710
|
+
"insertText": "URLSession.shared",
|
|
1711
|
+
"insertTextRules": 4,
|
|
1712
|
+
"sortText": "05_type_URLSession"
|
|
1713
|
+
},
|
|
1714
|
+
{
|
|
1715
|
+
"label": "NotificationCenter",
|
|
1716
|
+
"kind": 5,
|
|
1717
|
+
"detail": "Notification center",
|
|
1718
|
+
"documentation": {"value": "A notification dispatch mechanism for broadcasting information."},
|
|
1719
|
+
"insertText": "NotificationCenter.default",
|
|
1720
|
+
"insertTextRules": 4,
|
|
1721
|
+
"sortText": "05_type_NotificationCenter"
|
|
1722
|
+
},
|
|
1723
|
+
{
|
|
1724
|
+
"label": "UserDefaults",
|
|
1725
|
+
"kind": 5,
|
|
1726
|
+
"detail": "User defaults storage",
|
|
1727
|
+
"documentation": {"value": "An interface to the user's defaults database for persistent storage."},
|
|
1728
|
+
"insertText": "UserDefaults.standard",
|
|
1729
|
+
"insertTextRules": 4,
|
|
1730
|
+
"sortText": "05_type_UserDefaults"
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
"label": "Tuple",
|
|
1734
|
+
"kind": 6,
|
|
1735
|
+
"detail": "Tuple type",
|
|
1736
|
+
"documentation": {"value": "```swift\nlet pair: (String, Int) = (\"hello\", 42)\n```\nA fixed-size group of values of different types."},
|
|
1737
|
+
"insertText": "(${1:Type1}, ${2:Type2})",
|
|
1738
|
+
"insertTextRules": 4,
|
|
1739
|
+
"sortText": "05_type_Tuple"
|
|
1740
|
+
}
|
|
1741
|
+
]
|
|
1742
|
+
}
|