@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,1076 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "scala",
|
|
3
|
+
"completions": [
|
|
4
|
+
{
|
|
5
|
+
"label": "def",
|
|
6
|
+
"kind": 17,
|
|
7
|
+
"detail": "Method definition",
|
|
8
|
+
"documentation": {"value": "```scala\ndef name(param: Type): ReturnType = {\n // body\n}\n```\nDefines a method or function."},
|
|
9
|
+
"insertText": "def ${1:name}(${2:params}): ${3:Unit} = {\n $0\n}",
|
|
10
|
+
"insertTextRules": 4,
|
|
11
|
+
"sortText": "01_keyword_def"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"label": "val",
|
|
15
|
+
"kind": 17,
|
|
16
|
+
"detail": "Immutable value",
|
|
17
|
+
"documentation": {"value": "```scala\nval name: Type = value\n```\nDeclares an immutable binding."},
|
|
18
|
+
"insertText": "val ${1:name}: ${2:Type} = ${3:value}",
|
|
19
|
+
"insertTextRules": 4,
|
|
20
|
+
"sortText": "01_keyword_val"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"label": "var",
|
|
24
|
+
"kind": 17,
|
|
25
|
+
"detail": "Mutable variable",
|
|
26
|
+
"documentation": {"value": "```scala\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",
|
|
35
|
+
"documentation": {"value": "```scala\nclass MyClass(val field: Type) {\n // body\n}\n```\nDefines a class."},
|
|
36
|
+
"insertText": "class ${1:Name}(${2:params}) {\n $0\n}",
|
|
37
|
+
"insertTextRules": 4,
|
|
38
|
+
"sortText": "01_keyword_class"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"label": "object",
|
|
42
|
+
"kind": 17,
|
|
43
|
+
"detail": "Singleton object",
|
|
44
|
+
"documentation": {"value": "```scala\nobject MyObject {\n // body\n}\n```\nDefines a singleton object."},
|
|
45
|
+
"insertText": "object ${1:Name} {\n $0\n}",
|
|
46
|
+
"insertTextRules": 4,
|
|
47
|
+
"sortText": "01_keyword_object"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"label": "trait",
|
|
51
|
+
"kind": 17,
|
|
52
|
+
"detail": "Trait declaration",
|
|
53
|
+
"documentation": {"value": "```scala\ntrait MyTrait {\n def method: Type\n}\n```\nDefines a trait (interface with optional implementations)."},
|
|
54
|
+
"insertText": "trait ${1:Name} {\n $0\n}",
|
|
55
|
+
"insertTextRules": 4,
|
|
56
|
+
"sortText": "01_keyword_trait"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"label": "abstract",
|
|
60
|
+
"kind": 17,
|
|
61
|
+
"detail": "Abstract modifier",
|
|
62
|
+
"documentation": {"value": "```scala\nabstract class Base {\n def abstractMethod: Unit\n}\n```\nMarks a class or member as abstract."},
|
|
63
|
+
"insertText": "abstract",
|
|
64
|
+
"insertTextRules": 4,
|
|
65
|
+
"sortText": "01_keyword_abstract"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"label": "case",
|
|
69
|
+
"kind": 17,
|
|
70
|
+
"detail": "Case clause / case class modifier",
|
|
71
|
+
"documentation": {"value": "```scala\nx match {\n case pattern => result\n}\n```\nUsed in pattern matching or to define case classes."},
|
|
72
|
+
"insertText": "case ${1:pattern} => ${2:result}",
|
|
73
|
+
"insertTextRules": 4,
|
|
74
|
+
"sortText": "01_keyword_case"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"label": "catch",
|
|
78
|
+
"kind": 17,
|
|
79
|
+
"detail": "Catch block",
|
|
80
|
+
"documentation": {"value": "```scala\ntry { ... } catch {\n case e: Exception => ...\n}\n```\nCatches exceptions in a try block."},
|
|
81
|
+
"insertText": "catch {\n case ${1:e}: ${2:Exception} => $0\n}",
|
|
82
|
+
"insertTextRules": 4,
|
|
83
|
+
"sortText": "01_keyword_catch"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"label": "do",
|
|
87
|
+
"kind": 17,
|
|
88
|
+
"detail": "Do-while loop",
|
|
89
|
+
"documentation": {"value": "```scala\ndo {\n // body\n} while (condition)\n```\nExecutes body then checks condition."},
|
|
90
|
+
"insertText": "do {\n $0\n} while (${1:condition})",
|
|
91
|
+
"insertTextRules": 4,
|
|
92
|
+
"sortText": "01_keyword_do"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"label": "else",
|
|
96
|
+
"kind": 17,
|
|
97
|
+
"detail": "Else branch",
|
|
98
|
+
"documentation": {"value": "```scala\nif (cond) expr1 else expr2\n```\nAlternative branch in conditional expression."},
|
|
99
|
+
"insertText": "else {\n $0\n}",
|
|
100
|
+
"insertTextRules": 4,
|
|
101
|
+
"sortText": "01_keyword_else"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"label": "extends",
|
|
105
|
+
"kind": 17,
|
|
106
|
+
"detail": "Inheritance keyword",
|
|
107
|
+
"documentation": {"value": "```scala\nclass Child extends Parent\n```\nSpecifies superclass or trait."},
|
|
108
|
+
"insertText": "extends ${1:Parent}",
|
|
109
|
+
"insertTextRules": 4,
|
|
110
|
+
"sortText": "01_keyword_extends"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"label": "false",
|
|
114
|
+
"kind": 17,
|
|
115
|
+
"detail": "Boolean literal false",
|
|
116
|
+
"documentation": {"value": "Boolean literal representing the false value."},
|
|
117
|
+
"insertText": "false",
|
|
118
|
+
"insertTextRules": 4,
|
|
119
|
+
"sortText": "01_keyword_false"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"label": "final",
|
|
123
|
+
"kind": 17,
|
|
124
|
+
"detail": "Final modifier",
|
|
125
|
+
"documentation": {"value": "```scala\nfinal class Sealed\nfinal val x = 42\n```\nPrevents overriding or subclassing."},
|
|
126
|
+
"insertText": "final",
|
|
127
|
+
"insertTextRules": 4,
|
|
128
|
+
"sortText": "01_keyword_final"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"label": "finally",
|
|
132
|
+
"kind": 17,
|
|
133
|
+
"detail": "Finally block",
|
|
134
|
+
"documentation": {"value": "```scala\ntry { ... } finally { cleanup() }\n```\nExecutes cleanup code regardless of exceptions."},
|
|
135
|
+
"insertText": "finally {\n $0\n}",
|
|
136
|
+
"insertTextRules": 4,
|
|
137
|
+
"sortText": "01_keyword_finally"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"label": "for",
|
|
141
|
+
"kind": 17,
|
|
142
|
+
"detail": "For loop / comprehension",
|
|
143
|
+
"documentation": {"value": "```scala\nfor (x <- xs) yield x * 2\nfor {\n x <- xs\n y <- ys\n} yield (x, y)\n```\nFor loop or for-comprehension."},
|
|
144
|
+
"insertText": "for (${1:x} <- ${2:xs}) {\n $0\n}",
|
|
145
|
+
"insertTextRules": 4,
|
|
146
|
+
"sortText": "01_keyword_for"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"label": "forSome",
|
|
150
|
+
"kind": 17,
|
|
151
|
+
"detail": "Existential type qualifier",
|
|
152
|
+
"documentation": {"value": "```scala\nList[T] forSome { type T }\n```\nExistential type quantifier (Scala 2)."},
|
|
153
|
+
"insertText": "forSome { type ${1:T} }",
|
|
154
|
+
"insertTextRules": 4,
|
|
155
|
+
"sortText": "01_keyword_forSome"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"label": "if",
|
|
159
|
+
"kind": 17,
|
|
160
|
+
"detail": "Conditional expression",
|
|
161
|
+
"documentation": {"value": "```scala\nif (condition) expr1 else expr2\n```\nConditional expression. Returns a value."},
|
|
162
|
+
"insertText": "if (${1:condition}) {\n $0\n}",
|
|
163
|
+
"insertTextRules": 4,
|
|
164
|
+
"sortText": "01_keyword_if"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"label": "implicit",
|
|
168
|
+
"kind": 17,
|
|
169
|
+
"detail": "Implicit modifier",
|
|
170
|
+
"documentation": {"value": "```scala\nimplicit val ord: Ordering[Int] = ...\nimplicit def convert(x: A): B = ...\n```\nMarks a value, method, or class as implicit."},
|
|
171
|
+
"insertText": "implicit",
|
|
172
|
+
"insertTextRules": 4,
|
|
173
|
+
"sortText": "01_keyword_implicit"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"label": "import",
|
|
177
|
+
"kind": 17,
|
|
178
|
+
"detail": "Import declaration",
|
|
179
|
+
"documentation": {"value": "```scala\nimport scala.collection.mutable.ListBuffer\nimport java.util.{List, Map}\n```\nImports packages, classes, or members."},
|
|
180
|
+
"insertText": "import ${1:package.Name}",
|
|
181
|
+
"insertTextRules": 4,
|
|
182
|
+
"sortText": "01_keyword_import"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"label": "lazy",
|
|
186
|
+
"kind": 17,
|
|
187
|
+
"detail": "Lazy evaluation modifier",
|
|
188
|
+
"documentation": {"value": "```scala\nlazy val expensive = computeValue()\n```\nDefers evaluation until first access."},
|
|
189
|
+
"insertText": "lazy val ${1:name} = ${2:value}",
|
|
190
|
+
"insertTextRules": 4,
|
|
191
|
+
"sortText": "01_keyword_lazy"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"label": "match",
|
|
195
|
+
"kind": 17,
|
|
196
|
+
"detail": "Pattern matching",
|
|
197
|
+
"documentation": {"value": "```scala\nx match {\n case Some(v) => v\n case None => default\n}\n```\nPattern matching expression."},
|
|
198
|
+
"insertText": "match {\n case ${1:pattern} => $0\n}",
|
|
199
|
+
"insertTextRules": 4,
|
|
200
|
+
"sortText": "01_keyword_match"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"label": "new",
|
|
204
|
+
"kind": 17,
|
|
205
|
+
"detail": "Object instantiation",
|
|
206
|
+
"documentation": {"value": "```scala\nnew MyClass(args)\n```\nCreates a new instance."},
|
|
207
|
+
"insertText": "new ${1:ClassName}(${2:args})",
|
|
208
|
+
"insertTextRules": 4,
|
|
209
|
+
"sortText": "01_keyword_new"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"label": "null",
|
|
213
|
+
"kind": 17,
|
|
214
|
+
"detail": "Null reference",
|
|
215
|
+
"documentation": {"value": "The null reference. Use Option instead when possible."},
|
|
216
|
+
"insertText": "null",
|
|
217
|
+
"insertTextRules": 4,
|
|
218
|
+
"sortText": "01_keyword_null"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"label": "override",
|
|
222
|
+
"kind": 17,
|
|
223
|
+
"detail": "Override modifier",
|
|
224
|
+
"documentation": {"value": "```scala\noverride def toString: String = ...\n```\nOverrides a member from a parent class or trait."},
|
|
225
|
+
"insertText": "override",
|
|
226
|
+
"insertTextRules": 4,
|
|
227
|
+
"sortText": "01_keyword_override"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"label": "package",
|
|
231
|
+
"kind": 17,
|
|
232
|
+
"detail": "Package declaration",
|
|
233
|
+
"documentation": {"value": "```scala\npackage com.example.myapp\n```\nDeclares the package namespace."},
|
|
234
|
+
"insertText": "package ${1:com.example}",
|
|
235
|
+
"insertTextRules": 4,
|
|
236
|
+
"sortText": "01_keyword_package"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"label": "private",
|
|
240
|
+
"kind": 17,
|
|
241
|
+
"detail": "Private access modifier",
|
|
242
|
+
"documentation": {"value": "```scala\nprivate val secret = 42\nprivate[this] val instanceOnly = 1\n```\nRestricts access to the enclosing class."},
|
|
243
|
+
"insertText": "private",
|
|
244
|
+
"insertTextRules": 4,
|
|
245
|
+
"sortText": "01_keyword_private"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"label": "protected",
|
|
249
|
+
"kind": 17,
|
|
250
|
+
"detail": "Protected access modifier",
|
|
251
|
+
"documentation": {"value": "```scala\nprotected def helper(): Unit = ...\n```\nRestricts access to the class and its subclasses."},
|
|
252
|
+
"insertText": "protected",
|
|
253
|
+
"insertTextRules": 4,
|
|
254
|
+
"sortText": "01_keyword_protected"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"label": "return",
|
|
258
|
+
"kind": 17,
|
|
259
|
+
"detail": "Return statement",
|
|
260
|
+
"documentation": {"value": "```scala\ndef f(): Int = { return 42 }\n```\nExplicitly returns from a method. Rarely needed in Scala."},
|
|
261
|
+
"insertText": "return ${1:value}",
|
|
262
|
+
"insertTextRules": 4,
|
|
263
|
+
"sortText": "01_keyword_return"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"label": "sealed",
|
|
267
|
+
"kind": 17,
|
|
268
|
+
"detail": "Sealed modifier",
|
|
269
|
+
"documentation": {"value": "```scala\nsealed trait Shape\ncase class Circle(r: Double) extends Shape\n```\nRestricts subtypes to the same file for exhaustive matching."},
|
|
270
|
+
"insertText": "sealed",
|
|
271
|
+
"insertTextRules": 4,
|
|
272
|
+
"sortText": "01_keyword_sealed"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"label": "super",
|
|
276
|
+
"kind": 17,
|
|
277
|
+
"detail": "Superclass reference",
|
|
278
|
+
"documentation": {"value": "```scala\nsuper.method()\nsuper[TraitName].method()\n```\nRefers to the parent class or trait."},
|
|
279
|
+
"insertText": "super",
|
|
280
|
+
"insertTextRules": 4,
|
|
281
|
+
"sortText": "01_keyword_super"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"label": "this",
|
|
285
|
+
"kind": 17,
|
|
286
|
+
"detail": "Current instance reference",
|
|
287
|
+
"documentation": {"value": "```scala\nthis.field\ndef this(x: Int) = this(x, 0)\n```\nRefers to the current instance."},
|
|
288
|
+
"insertText": "this",
|
|
289
|
+
"insertTextRules": 4,
|
|
290
|
+
"sortText": "01_keyword_this"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"label": "throw",
|
|
294
|
+
"kind": 17,
|
|
295
|
+
"detail": "Throw expression",
|
|
296
|
+
"documentation": {"value": "```scala\nthrow new IllegalArgumentException(\"msg\")\n```\nThrows an exception."},
|
|
297
|
+
"insertText": "throw new ${1:Exception}(\"${2:message}\")",
|
|
298
|
+
"insertTextRules": 4,
|
|
299
|
+
"sortText": "01_keyword_throw"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"label": "true",
|
|
303
|
+
"kind": 17,
|
|
304
|
+
"detail": "Boolean literal true",
|
|
305
|
+
"documentation": {"value": "Boolean literal representing the true value."},
|
|
306
|
+
"insertText": "true",
|
|
307
|
+
"insertTextRules": 4,
|
|
308
|
+
"sortText": "01_keyword_true"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"label": "try",
|
|
312
|
+
"kind": 17,
|
|
313
|
+
"detail": "Try block",
|
|
314
|
+
"documentation": {"value": "```scala\ntry {\n riskyOp()\n} catch {\n case e: Exception => handle(e)\n} finally {\n cleanup()\n}\n```\nException handling block."},
|
|
315
|
+
"insertText": "try {\n $0\n} catch {\n case ${1:e}: ${2:Exception} => ${3:???}\n}",
|
|
316
|
+
"insertTextRules": 4,
|
|
317
|
+
"sortText": "01_keyword_try"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"label": "type",
|
|
321
|
+
"kind": 17,
|
|
322
|
+
"detail": "Type alias / abstract type",
|
|
323
|
+
"documentation": {"value": "```scala\ntype Name = String\ntype F[A] = List[A]\n```\nDefines a type alias or abstract type member."},
|
|
324
|
+
"insertText": "type ${1:Name} = ${2:Type}",
|
|
325
|
+
"insertTextRules": 4,
|
|
326
|
+
"sortText": "01_keyword_type"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"label": "while",
|
|
330
|
+
"kind": 17,
|
|
331
|
+
"detail": "While loop",
|
|
332
|
+
"documentation": {"value": "```scala\nwhile (condition) {\n // body\n}\n```\nRepeats while condition is true."},
|
|
333
|
+
"insertText": "while (${1:condition}) {\n $0\n}",
|
|
334
|
+
"insertTextRules": 4,
|
|
335
|
+
"sortText": "01_keyword_while"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"label": "with",
|
|
339
|
+
"kind": 17,
|
|
340
|
+
"detail": "Mixin composition",
|
|
341
|
+
"documentation": {"value": "```scala\nclass A extends B with C with D\n```\nMixes in additional traits."},
|
|
342
|
+
"insertText": "with ${1:Trait}",
|
|
343
|
+
"insertTextRules": 4,
|
|
344
|
+
"sortText": "01_keyword_with"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"label": "yield",
|
|
348
|
+
"kind": 17,
|
|
349
|
+
"detail": "For-comprehension yield",
|
|
350
|
+
"documentation": {"value": "```scala\nfor (x <- xs) yield x * 2\n```\nProduces a value in a for-comprehension."},
|
|
351
|
+
"insertText": "yield ${1:expr}",
|
|
352
|
+
"insertTextRules": 4,
|
|
353
|
+
"sortText": "01_keyword_yield"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"label": "given",
|
|
357
|
+
"kind": 17,
|
|
358
|
+
"detail": "Given instance (Scala 3)",
|
|
359
|
+
"documentation": {"value": "```scala\ngiven ord: Ordering[Int] = Ordering.Int\ngiven Ordering[Int] with { ... }\n```\nDeclares a given instance for contextual abstraction."},
|
|
360
|
+
"insertText": "given ${1:name}: ${2:Type} = ${3:value}",
|
|
361
|
+
"insertTextRules": 4,
|
|
362
|
+
"sortText": "01_keyword_given"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"label": "using",
|
|
366
|
+
"kind": 17,
|
|
367
|
+
"detail": "Using clause (Scala 3)",
|
|
368
|
+
"documentation": {"value": "```scala\ndef f(using ord: Ordering[Int]): Unit = ...\n```\nDeclares contextual parameters."},
|
|
369
|
+
"insertText": "using ${1:name}: ${2:Type}",
|
|
370
|
+
"insertTextRules": 4,
|
|
371
|
+
"sortText": "01_keyword_using"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"label": "enum",
|
|
375
|
+
"kind": 17,
|
|
376
|
+
"detail": "Enum declaration (Scala 3)",
|
|
377
|
+
"documentation": {"value": "```scala\nenum Color {\n case Red, Green, Blue\n}\nenum Planet(mass: Double, radius: Double) {\n case Mercury extends Planet(3.3e23, 2.4e6)\n}\n```\nDefines an enumeration type."},
|
|
378
|
+
"insertText": "enum ${1:Name} {\n case ${2:Value1}, ${3:Value2}\n}",
|
|
379
|
+
"insertTextRules": 4,
|
|
380
|
+
"sortText": "01_keyword_enum"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"label": "export",
|
|
384
|
+
"kind": 17,
|
|
385
|
+
"detail": "Export clause (Scala 3)",
|
|
386
|
+
"documentation": {"value": "```scala\nexport myObj.{member1, member2}\n```\nRe-exports members from another object."},
|
|
387
|
+
"insertText": "export ${1:obj}.{${2:members}}",
|
|
388
|
+
"insertTextRules": 4,
|
|
389
|
+
"sortText": "01_keyword_export"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"label": "then",
|
|
393
|
+
"kind": 17,
|
|
394
|
+
"detail": "Then keyword (Scala 3)",
|
|
395
|
+
"documentation": {"value": "```scala\nif condition then expr1 else expr2\n```\nOptional keyword after if condition in Scala 3."},
|
|
396
|
+
"insertText": "then",
|
|
397
|
+
"insertTextRules": 4,
|
|
398
|
+
"sortText": "01_keyword_then"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"label": "end",
|
|
402
|
+
"kind": 17,
|
|
403
|
+
"detail": "End marker (Scala 3)",
|
|
404
|
+
"documentation": {"value": "```scala\ndef longMethod =\n ...\nend longMethod\n```\nOptional end marker for long definitions."},
|
|
405
|
+
"insertText": "end ${1:name}",
|
|
406
|
+
"insertTextRules": 4,
|
|
407
|
+
"sortText": "01_keyword_end"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"label": "extension",
|
|
411
|
+
"kind": 17,
|
|
412
|
+
"detail": "Extension method (Scala 3)",
|
|
413
|
+
"documentation": {"value": "```scala\nextension (s: String)\n def greet: String = s\"Hello, $s\"\n```\nAdds methods to existing types."},
|
|
414
|
+
"insertText": "extension (${1:x}: ${2:Type})\n def ${3:method}: ${4:ReturnType} = $0",
|
|
415
|
+
"insertTextRules": 4,
|
|
416
|
+
"sortText": "01_keyword_extension"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"label": "transparent",
|
|
420
|
+
"kind": 17,
|
|
421
|
+
"detail": "Transparent modifier (Scala 3)",
|
|
422
|
+
"documentation": {"value": "```scala\ntransparent inline def f: Any = ...\n```\nAllows the compiler to specialize the return type."},
|
|
423
|
+
"insertText": "transparent",
|
|
424
|
+
"insertTextRules": 4,
|
|
425
|
+
"sortText": "01_keyword_transparent"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"label": "inline",
|
|
429
|
+
"kind": 17,
|
|
430
|
+
"detail": "Inline modifier (Scala 3)",
|
|
431
|
+
"documentation": {"value": "```scala\ninline def power(x: Double, inline n: Int): Double = ...\n```\nInlines the method at call sites."},
|
|
432
|
+
"insertText": "inline",
|
|
433
|
+
"insertTextRules": 4,
|
|
434
|
+
"sortText": "01_keyword_inline"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"label": "opaque",
|
|
438
|
+
"kind": 17,
|
|
439
|
+
"detail": "Opaque type alias (Scala 3)",
|
|
440
|
+
"documentation": {"value": "```scala\nopaque type UserId = Int\n```\nDefines a type alias whose underlying type is hidden outside its scope."},
|
|
441
|
+
"insertText": "opaque type ${1:Name} = ${2:Type}",
|
|
442
|
+
"insertTextRules": 4,
|
|
443
|
+
"sortText": "01_keyword_opaque"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"label": "open",
|
|
447
|
+
"kind": 17,
|
|
448
|
+
"detail": "Open modifier (Scala 3)",
|
|
449
|
+
"documentation": {"value": "```scala\nopen class Base\n```\nExplicitly allows a class to be extended."},
|
|
450
|
+
"insertText": "open",
|
|
451
|
+
"insertTextRules": 4,
|
|
452
|
+
"sortText": "01_keyword_open"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"label": "derives",
|
|
456
|
+
"kind": 17,
|
|
457
|
+
"detail": "Derives clause (Scala 3)",
|
|
458
|
+
"documentation": {"value": "```scala\ncase class Point(x: Int, y: Int) derives Eq, Show\n```\nAutomatically derives type class instances."},
|
|
459
|
+
"insertText": "derives ${1:TypeClass}",
|
|
460
|
+
"insertTextRules": 4,
|
|
461
|
+
"sortText": "01_keyword_derives"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"label": "println",
|
|
465
|
+
"kind": 1,
|
|
466
|
+
"detail": "Print with newline",
|
|
467
|
+
"documentation": {"value": "```scala\nprintln(\"Hello, World!\")\nprintln(s\"Value: $x\")\n```\nPrints a value followed by a newline to stdout."},
|
|
468
|
+
"insertText": "println(${1:\"message\"})",
|
|
469
|
+
"insertTextRules": 4,
|
|
470
|
+
"sortText": "02_builtin_println"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"label": "print",
|
|
474
|
+
"kind": 1,
|
|
475
|
+
"detail": "Print without newline",
|
|
476
|
+
"documentation": {"value": "```scala\nprint(\"Hello\")\n```\nPrints a value to stdout without a trailing newline."},
|
|
477
|
+
"insertText": "print(${1:\"message\"})",
|
|
478
|
+
"insertTextRules": 4,
|
|
479
|
+
"sortText": "02_builtin_print"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"label": "require",
|
|
483
|
+
"kind": 1,
|
|
484
|
+
"detail": "Precondition check",
|
|
485
|
+
"documentation": {"value": "```scala\nrequire(x > 0, \"x must be positive\")\n```\nThrows IllegalArgumentException if condition is false."},
|
|
486
|
+
"insertText": "require(${1:condition}, \"${2:message}\")",
|
|
487
|
+
"insertTextRules": 4,
|
|
488
|
+
"sortText": "02_builtin_require"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"label": "assert",
|
|
492
|
+
"kind": 1,
|
|
493
|
+
"detail": "Assertion check",
|
|
494
|
+
"documentation": {"value": "```scala\nassert(list.nonEmpty, \"list must not be empty\")\n```\nThrows AssertionError if condition is false."},
|
|
495
|
+
"insertText": "assert(${1:condition}, \"${2:message}\")",
|
|
496
|
+
"insertTextRules": 4,
|
|
497
|
+
"sortText": "02_builtin_assert"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"label": "sys.exit",
|
|
501
|
+
"kind": 1,
|
|
502
|
+
"detail": "Exit program",
|
|
503
|
+
"documentation": {"value": "```scala\nsys.exit(0)\n```\nTerminates the JVM with the given status code."},
|
|
504
|
+
"insertText": "sys.exit(${1:0})",
|
|
505
|
+
"insertTextRules": 4,
|
|
506
|
+
"sortText": "02_builtin_sys_exit"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"label": "sys.error",
|
|
510
|
+
"kind": 1,
|
|
511
|
+
"detail": "Throw runtime exception",
|
|
512
|
+
"documentation": {"value": "```scala\nsys.error(\"something went wrong\")\n```\nThrows a RuntimeException with the given message."},
|
|
513
|
+
"insertText": "sys.error(\"${1:message}\")",
|
|
514
|
+
"insertTextRules": 4,
|
|
515
|
+
"sortText": "02_builtin_sys_error"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"label": "Some",
|
|
519
|
+
"kind": 1,
|
|
520
|
+
"detail": "Some(value) constructor",
|
|
521
|
+
"documentation": {"value": "```scala\nval x: Option[Int] = Some(42)\n```\nWraps a value in an Option."},
|
|
522
|
+
"insertText": "Some(${1:value})",
|
|
523
|
+
"insertTextRules": 4,
|
|
524
|
+
"sortText": "02_builtin_Some"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"label": "None",
|
|
528
|
+
"kind": 1,
|
|
529
|
+
"detail": "None value",
|
|
530
|
+
"documentation": {"value": "```scala\nval x: Option[Int] = None\n```\nRepresents the absence of a value."},
|
|
531
|
+
"insertText": "None",
|
|
532
|
+
"insertTextRules": 4,
|
|
533
|
+
"sortText": "02_builtin_None"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"label": "Left",
|
|
537
|
+
"kind": 1,
|
|
538
|
+
"detail": "Left(value) constructor",
|
|
539
|
+
"documentation": {"value": "```scala\nval result: Either[String, Int] = Left(\"error\")\n```\nCreates the left (typically error) side of an Either."},
|
|
540
|
+
"insertText": "Left(${1:value})",
|
|
541
|
+
"insertTextRules": 4,
|
|
542
|
+
"sortText": "02_builtin_Left"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"label": "Right",
|
|
546
|
+
"kind": 1,
|
|
547
|
+
"detail": "Right(value) constructor",
|
|
548
|
+
"documentation": {"value": "```scala\nval result: Either[String, Int] = Right(42)\n```\nCreates the right (typically success) side of an Either."},
|
|
549
|
+
"insertText": "Right(${1:value})",
|
|
550
|
+
"insertTextRules": 4,
|
|
551
|
+
"sortText": "02_builtin_Right"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"label": "Nil",
|
|
555
|
+
"kind": 1,
|
|
556
|
+
"detail": "Empty list",
|
|
557
|
+
"documentation": {"value": "```scala\nval empty: List[Int] = Nil\nval list = 1 :: 2 :: 3 :: Nil\n```\nThe empty list."},
|
|
558
|
+
"insertText": "Nil",
|
|
559
|
+
"insertTextRules": 4,
|
|
560
|
+
"sortText": "02_builtin_Nil"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"label": "List",
|
|
564
|
+
"kind": 1,
|
|
565
|
+
"detail": "List constructor",
|
|
566
|
+
"documentation": {"value": "```scala\nval xs = List(1, 2, 3)\nval ys = List.empty[String]\n```\nCreates an immutable linked list."},
|
|
567
|
+
"insertText": "List(${1:elements})",
|
|
568
|
+
"insertTextRules": 4,
|
|
569
|
+
"sortText": "02_builtin_List"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"label": "Map",
|
|
573
|
+
"kind": 1,
|
|
574
|
+
"detail": "Map constructor",
|
|
575
|
+
"documentation": {"value": "```scala\nval m = Map(\"a\" -> 1, \"b\" -> 2)\n```\nCreates an immutable map."},
|
|
576
|
+
"insertText": "Map(${1:key} -> ${2:value})",
|
|
577
|
+
"insertTextRules": 4,
|
|
578
|
+
"sortText": "02_builtin_Map"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"label": "Set",
|
|
582
|
+
"kind": 1,
|
|
583
|
+
"detail": "Set constructor",
|
|
584
|
+
"documentation": {"value": "```scala\nval s = Set(1, 2, 3)\n```\nCreates an immutable set."},
|
|
585
|
+
"insertText": "Set(${1:elements})",
|
|
586
|
+
"insertTextRules": 4,
|
|
587
|
+
"sortText": "02_builtin_Set"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"label": "Vector",
|
|
591
|
+
"kind": 1,
|
|
592
|
+
"detail": "Vector constructor",
|
|
593
|
+
"documentation": {"value": "```scala\nval v = Vector(1, 2, 3)\n```\nCreates an immutable indexed sequence with efficient random access."},
|
|
594
|
+
"insertText": "Vector(${1:elements})",
|
|
595
|
+
"insertTextRules": 4,
|
|
596
|
+
"sortText": "02_builtin_Vector"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"label": "Array",
|
|
600
|
+
"kind": 1,
|
|
601
|
+
"detail": "Array constructor",
|
|
602
|
+
"documentation": {"value": "```scala\nval arr = Array(1, 2, 3)\nval arr2 = new Array[Int](10)\n```\nCreates a mutable indexed sequence backed by a Java array."},
|
|
603
|
+
"insertText": "Array(${1:elements})",
|
|
604
|
+
"insertTextRules": 4,
|
|
605
|
+
"sortText": "02_builtin_Array"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"label": "Option",
|
|
609
|
+
"kind": 1,
|
|
610
|
+
"detail": "Option type",
|
|
611
|
+
"documentation": {"value": "```scala\nval opt: Option[Int] = Option(maybeNull)\nopt.getOrElse(0)\n```\nRepresents an optional value: either Some(value) or None."},
|
|
612
|
+
"insertText": "Option(${1:value})",
|
|
613
|
+
"insertTextRules": 4,
|
|
614
|
+
"sortText": "02_builtin_Option"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"label": "Either",
|
|
618
|
+
"kind": 1,
|
|
619
|
+
"detail": "Either type",
|
|
620
|
+
"documentation": {"value": "```scala\ndef divide(a: Int, b: Int): Either[String, Int] =\n if (b == 0) Left(\"div by zero\") else Right(a / b)\n```\nRepresents a value of two possible types: Left or Right."},
|
|
621
|
+
"insertText": "Either[${1:L}, ${2:R}]",
|
|
622
|
+
"insertTextRules": 4,
|
|
623
|
+
"sortText": "02_builtin_Either"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"label": "Try",
|
|
627
|
+
"kind": 1,
|
|
628
|
+
"detail": "Try container",
|
|
629
|
+
"documentation": {"value": "```scala\nimport scala.util.Try\nval result = Try(riskyOperation())\n```\nWraps a computation that may throw, yielding Success or Failure."},
|
|
630
|
+
"insertText": "Try(${1:expr})",
|
|
631
|
+
"insertTextRules": 4,
|
|
632
|
+
"sortText": "02_builtin_Try"
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
"label": "Future",
|
|
636
|
+
"kind": 1,
|
|
637
|
+
"detail": "Future computation",
|
|
638
|
+
"documentation": {"value": "```scala\nimport scala.concurrent.Future\nimport scala.concurrent.ExecutionContext.Implicits.global\nval f = Future { expensiveComputation() }\n```\nRepresents an asynchronous computation."},
|
|
639
|
+
"insertText": "Future {\n $0\n}",
|
|
640
|
+
"insertTextRules": 4,
|
|
641
|
+
"sortText": "02_builtin_Future"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"label": "Promise",
|
|
645
|
+
"kind": 1,
|
|
646
|
+
"detail": "Promise for Future",
|
|
647
|
+
"documentation": {"value": "```scala\nimport scala.concurrent.Promise\nval p = Promise[Int]()\np.success(42)\np.future\n```\nA writable, single-assignment container that completes a Future."},
|
|
648
|
+
"insertText": "Promise[${1:Type}]()",
|
|
649
|
+
"insertTextRules": 4,
|
|
650
|
+
"sortText": "02_builtin_Promise"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"label": "Stream",
|
|
654
|
+
"kind": 1,
|
|
655
|
+
"detail": "Lazy stream (Scala 2)",
|
|
656
|
+
"documentation": {"value": "```scala\nval s = Stream.from(1)\n```\nLazily evaluated stream (deprecated in Scala 2.13, use LazyList)."},
|
|
657
|
+
"insertText": "Stream(${1:elements})",
|
|
658
|
+
"insertTextRules": 4,
|
|
659
|
+
"sortText": "02_builtin_Stream"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"label": "LazyList",
|
|
663
|
+
"kind": 1,
|
|
664
|
+
"detail": "Lazy list",
|
|
665
|
+
"documentation": {"value": "```scala\nval naturals = LazyList.from(1)\nval fibs: LazyList[Int] = 0 #:: 1 #:: fibs.zip(fibs.tail).map(_ + _)\n```\nLazily evaluated immutable linked list (replaces Stream in 2.13+)."},
|
|
666
|
+
"insertText": "LazyList(${1:elements})",
|
|
667
|
+
"insertTextRules": 4,
|
|
668
|
+
"sortText": "02_builtin_LazyList"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"label": "Range",
|
|
672
|
+
"kind": 1,
|
|
673
|
+
"detail": "Range of integers",
|
|
674
|
+
"documentation": {"value": "```scala\nval r = 1 to 10\nval r2 = 0 until 100 by 2\n```\nRepresents an ordered sequence of integers."},
|
|
675
|
+
"insertText": "${1:1} to ${2:10}",
|
|
676
|
+
"insertTextRules": 4,
|
|
677
|
+
"sortText": "02_builtin_Range"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"label": "Seq",
|
|
681
|
+
"kind": 1,
|
|
682
|
+
"detail": "Sequence trait",
|
|
683
|
+
"documentation": {"value": "```scala\nval s: Seq[Int] = Seq(1, 2, 3)\n```\nGeneral sequence type. Default implementation is List."},
|
|
684
|
+
"insertText": "Seq(${1:elements})",
|
|
685
|
+
"insertTextRules": 4,
|
|
686
|
+
"sortText": "02_builtin_Seq"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"label": "IndexedSeq",
|
|
690
|
+
"kind": 1,
|
|
691
|
+
"detail": "Indexed sequence",
|
|
692
|
+
"documentation": {"value": "```scala\nval is: IndexedSeq[Int] = IndexedSeq(1, 2, 3)\n```\nA sequence with efficient indexed access. Default implementation is Vector."},
|
|
693
|
+
"insertText": "IndexedSeq(${1:elements})",
|
|
694
|
+
"insertTextRules": 4,
|
|
695
|
+
"sortText": "02_builtin_IndexedSeq"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"label": "Iterator",
|
|
699
|
+
"kind": 1,
|
|
700
|
+
"detail": "Iterator",
|
|
701
|
+
"documentation": {"value": "```scala\nval it = Iterator(1, 2, 3)\nwhile (it.hasNext) println(it.next())\n```\nA one-time traversable collection of elements."},
|
|
702
|
+
"insertText": "Iterator(${1:elements})",
|
|
703
|
+
"insertTextRules": 4,
|
|
704
|
+
"sortText": "02_builtin_Iterator"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"label": "Tuple",
|
|
708
|
+
"kind": 1,
|
|
709
|
+
"detail": "Tuple literal",
|
|
710
|
+
"documentation": {"value": "```scala\nval t = (1, \"hello\", true)\nval (a, b, c) = t\n```\nHeterogeneous fixed-size collection."},
|
|
711
|
+
"insertText": "(${1:a}, ${2:b})",
|
|
712
|
+
"insertTextRules": 4,
|
|
713
|
+
"sortText": "02_builtin_Tuple"
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"label": "main method",
|
|
717
|
+
"kind": 27,
|
|
718
|
+
"detail": "Scala main entry point",
|
|
719
|
+
"documentation": {"value": "```scala\n@main def run(): Unit =\n println(\"Hello, World!\")\n```\nScala 3 main method entry point."},
|
|
720
|
+
"insertText": "@main def ${1:run}(): Unit =\n ${2:println(\"Hello, World!\")}",
|
|
721
|
+
"insertTextRules": 4,
|
|
722
|
+
"sortText": "03_snippet_main"
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"label": "main object (Scala 2)",
|
|
726
|
+
"kind": 27,
|
|
727
|
+
"detail": "Scala 2 App object",
|
|
728
|
+
"documentation": {"value": "```scala\nobject Main extends App {\n println(\"Hello, World!\")\n}\n```\nScala 2 entry point using App trait."},
|
|
729
|
+
"insertText": "object ${1:Main} extends App {\n ${2:println(\"Hello, World!\")}\n}",
|
|
730
|
+
"insertTextRules": 4,
|
|
731
|
+
"sortText": "03_snippet_main_object"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"label": "case class",
|
|
735
|
+
"kind": 27,
|
|
736
|
+
"detail": "Case class definition",
|
|
737
|
+
"documentation": {"value": "```scala\ncase class Person(name: String, age: Int)\n```\nDefines an immutable data class with auto-generated equals, hashCode, toString, copy, and unapply."},
|
|
738
|
+
"insertText": "case class ${1:Name}(${2:field}: ${3:Type})",
|
|
739
|
+
"insertTextRules": 4,
|
|
740
|
+
"sortText": "03_snippet_case_class"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"label": "sealed trait ADT",
|
|
744
|
+
"kind": 27,
|
|
745
|
+
"detail": "Sealed trait with case classes",
|
|
746
|
+
"documentation": {"value": "```scala\nsealed trait Shape\ncase class Circle(radius: Double) extends Shape\ncase class Rectangle(w: Double, h: Double) extends Shape\n```\nAlgebraic data type pattern."},
|
|
747
|
+
"insertText": "sealed trait ${1:Base}\ncase class ${2:Variant1}(${3:field}: ${4:Type}) extends ${1:Base}\ncase class ${5:Variant2}(${6:field}: ${7:Type}) extends ${1:Base}",
|
|
748
|
+
"insertTextRules": 4,
|
|
749
|
+
"sortText": "03_snippet_sealed_trait"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
"label": "for comprehension",
|
|
753
|
+
"kind": 27,
|
|
754
|
+
"detail": "For-comprehension with yield",
|
|
755
|
+
"documentation": {"value": "```scala\nfor {\n x <- xs\n y <- ys\n if x > 0\n} yield (x, y)\n```\nMonadic for-comprehension."},
|
|
756
|
+
"insertText": "for {\n ${1:x} <- ${2:xs}\n ${3:y} <- ${4:ys}\n} yield ${5:(${1:x}, ${3:y})}",
|
|
757
|
+
"insertTextRules": 4,
|
|
758
|
+
"sortText": "03_snippet_for_comp"
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"label": "pattern match",
|
|
762
|
+
"kind": 27,
|
|
763
|
+
"detail": "Pattern matching block",
|
|
764
|
+
"documentation": {"value": "```scala\nvalue match {\n case Some(x) => x\n case None => default\n}\n```\nExhaustive pattern matching."},
|
|
765
|
+
"insertText": "${1:value} match {\n case ${2:pattern1} => ${3:result1}\n case ${4:pattern2} => ${5:result2}\n case _ => ${6:default}\n}",
|
|
766
|
+
"insertTextRules": 4,
|
|
767
|
+
"sortText": "03_snippet_pattern_match"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"label": "implicit class",
|
|
771
|
+
"kind": 27,
|
|
772
|
+
"detail": "Implicit class (Scala 2 extension)",
|
|
773
|
+
"documentation": {"value": "```scala\nimplicit class RichInt(val n: Int) extends AnyVal {\n def isEven: Boolean = n % 2 == 0\n}\n```\nAdds extension methods via implicit conversion."},
|
|
774
|
+
"insertText": "implicit class ${1:Rich}${2:Type}(val ${3:x}: ${2:Type}) extends AnyVal {\n def ${4:method}: ${5:ReturnType} = $0\n}",
|
|
775
|
+
"insertTextRules": 4,
|
|
776
|
+
"sortText": "03_snippet_implicit_class"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"label": "extension method (Scala 3)",
|
|
780
|
+
"kind": 27,
|
|
781
|
+
"detail": "Extension method definition",
|
|
782
|
+
"documentation": {"value": "```scala\nextension (s: String)\n def greet: String = s\"Hello, $s!\"\n def exclaim: String = s + \"!\"\n```\nScala 3 extension methods."},
|
|
783
|
+
"insertText": "extension (${1:x}: ${2:Type})\n def ${3:method}: ${4:ReturnType} = $0",
|
|
784
|
+
"insertTextRules": 4,
|
|
785
|
+
"sortText": "03_snippet_extension"
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"label": "given/using",
|
|
789
|
+
"kind": 27,
|
|
790
|
+
"detail": "Given instance and using clause",
|
|
791
|
+
"documentation": {"value": "```scala\ngiven intOrd: Ordering[Int] with\n def compare(x: Int, y: Int) = x - y\n\ndef sort[T](xs: List[T])(using ord: Ordering[T]) = xs.sorted\n```\nScala 3 contextual abstractions."},
|
|
792
|
+
"insertText": "given ${1:name}: ${2:TypeClass}[${3:Type}] with\n def ${4:method}(${5:params}): ${6:ReturnType} = $0",
|
|
793
|
+
"insertTextRules": 4,
|
|
794
|
+
"sortText": "03_snippet_given_using"
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"label": "Future with map/flatMap",
|
|
798
|
+
"kind": 27,
|
|
799
|
+
"detail": "Future composition",
|
|
800
|
+
"documentation": {"value": "```scala\nimport scala.concurrent.Future\nimport scala.concurrent.ExecutionContext.Implicits.global\n\nval result = for {\n a <- Future(computeA())\n b <- Future(computeB(a))\n} yield combine(a, b)\n```\nComposing Futures with for-comprehension."},
|
|
801
|
+
"insertText": "import scala.concurrent.Future\nimport scala.concurrent.ExecutionContext.Implicits.global\n\nval ${1:result} = for {\n ${2:a} <- Future(${3:computeA()})\n ${4:b} <- Future(${5:computeB(${2:a})})\n} yield ${6:combine(${2:a}, ${4:b})}",
|
|
802
|
+
"insertTextRules": 4,
|
|
803
|
+
"sortText": "03_snippet_future_comp"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"label": "actor (Akka)",
|
|
807
|
+
"kind": 27,
|
|
808
|
+
"detail": "Akka typed actor",
|
|
809
|
+
"documentation": {"value": "```scala\nimport akka.actor.typed.Behavior\nimport akka.actor.typed.scaladsl.Behaviors\n\nobject MyActor {\n sealed trait Command\n case class Greet(name: String) extends Command\n\n def apply(): Behavior[Command] =\n Behaviors.receive { (ctx, msg) =>\n msg match {\n case Greet(name) =>\n ctx.log.info(s\"Hello, $name!\")\n Behaviors.same\n }\n }\n}\n```\nAkka typed actor pattern."},
|
|
810
|
+
"insertText": "object ${1:MyActor} {\n sealed trait Command\n case class ${2:Msg}(${3:field}: ${4:String}) extends Command\n\n def apply(): Behavior[Command] =\n Behaviors.receive { (ctx, msg) =>\n msg match {\n case ${2:Msg}(${3:field}) =>\n ctx.log.info(s\"Received: $$${3:field}\")\n Behaviors.same\n }\n }\n}",
|
|
811
|
+
"insertTextRules": 4,
|
|
812
|
+
"sortText": "03_snippet_actor"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"label": "case object",
|
|
816
|
+
"kind": 27,
|
|
817
|
+
"detail": "Case object",
|
|
818
|
+
"documentation": {"value": "```scala\ncase object Singleton\n```\nDefines a singleton case object, often used in ADTs."},
|
|
819
|
+
"insertText": "case object ${1:Name}",
|
|
820
|
+
"insertTextRules": 4,
|
|
821
|
+
"sortText": "03_snippet_case_object"
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
"label": "implicit val",
|
|
825
|
+
"kind": 27,
|
|
826
|
+
"detail": "Implicit value",
|
|
827
|
+
"documentation": {"value": "```scala\nimplicit val ec: ExecutionContext = ExecutionContext.global\n```\nProvides an implicit value."},
|
|
828
|
+
"insertText": "implicit val ${1:name}: ${2:Type} = ${3:value}",
|
|
829
|
+
"insertTextRules": 4,
|
|
830
|
+
"sortText": "03_snippet_implicit_val"
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
"label": "implicit def",
|
|
834
|
+
"kind": 27,
|
|
835
|
+
"detail": "Implicit conversion",
|
|
836
|
+
"documentation": {"value": "```scala\nimplicit def intToString(i: Int): String = i.toString\n```\nDefines an implicit conversion."},
|
|
837
|
+
"insertText": "implicit def ${1:name}(${2:param}: ${3:From}): ${4:To} = $0",
|
|
838
|
+
"insertTextRules": 4,
|
|
839
|
+
"sortText": "03_snippet_implicit_def"
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
"label": "object companion",
|
|
843
|
+
"kind": 27,
|
|
844
|
+
"detail": "Companion object with apply",
|
|
845
|
+
"documentation": {"value": "```scala\nclass Foo(val x: Int)\nobject Foo {\n def apply(x: Int): Foo = new Foo(x)\n}\n```\nCompanion object pattern."},
|
|
846
|
+
"insertText": "object ${1:Name} {\n def apply(${2:params}): ${1:Name} = new ${1:Name}(${3:args})\n}",
|
|
847
|
+
"insertTextRules": 4,
|
|
848
|
+
"sortText": "03_snippet_companion"
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
"label": "trait with abstract",
|
|
852
|
+
"kind": 27,
|
|
853
|
+
"detail": "Trait with abstract members",
|
|
854
|
+
"documentation": {"value": "```scala\ntrait Repository[T] {\n def findById(id: Long): Option[T]\n def findAll: List[T]\n def save(entity: T): Unit\n}\n```\nTrait with abstract method signatures."},
|
|
855
|
+
"insertText": "trait ${1:Name}[${2:T}] {\n def ${3:method}(${4:params}): ${5:ReturnType}\n $0\n}",
|
|
856
|
+
"insertTextRules": 4,
|
|
857
|
+
"sortText": "03_snippet_trait_abstract"
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
"label": "enum (Scala 3)",
|
|
861
|
+
"kind": 27,
|
|
862
|
+
"detail": "Scala 3 enum with parameters",
|
|
863
|
+
"documentation": {"value": "```scala\nenum Color(val rgb: Int) {\n case Red extends Color(0xFF0000)\n case Green extends Color(0x00FF00)\n case Blue extends Color(0x0000FF)\n}\n```\nParameterized enum in Scala 3."},
|
|
864
|
+
"insertText": "enum ${1:Name}(val ${2:field}: ${3:Type}) {\n case ${4:Value1} extends ${1:Name}(${5:arg})\n case ${6:Value2} extends ${1:Name}(${7:arg})\n}",
|
|
865
|
+
"insertTextRules": 4,
|
|
866
|
+
"sortText": "03_snippet_enum"
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"label": "opaque type",
|
|
870
|
+
"kind": 27,
|
|
871
|
+
"detail": "Opaque type alias (Scala 3)",
|
|
872
|
+
"documentation": {"value": "```scala\nobject Types {\n opaque type UserId = Long\n object UserId {\n def apply(id: Long): UserId = id\n }\n extension (id: UserId)\n def value: Long = id\n}\n```\nType-safe wrapper without runtime overhead."},
|
|
873
|
+
"insertText": "opaque type ${1:Name} = ${2:Underlying}\nobject ${1:Name} {\n def apply(value: ${2:Underlying}): ${1:Name} = value\n}\nextension (x: ${1:Name})\n def value: ${2:Underlying} = x",
|
|
874
|
+
"insertTextRules": 4,
|
|
875
|
+
"sortText": "03_snippet_opaque_type"
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
"label": "given with typeclass",
|
|
879
|
+
"kind": 27,
|
|
880
|
+
"detail": "Type class instance with given",
|
|
881
|
+
"documentation": {"value": "```scala\ntrait Show[A]:\n extension (a: A) def show: String\n\ngiven Show[Int] with\n extension (i: Int) def show: String = i.toString\n```\nType class pattern in Scala 3."},
|
|
882
|
+
"insertText": "trait ${1:TypeClass}[${2:A}]:\n extension (a: ${2:A}) def ${3:method}: ${4:String}\n\ngiven ${1:TypeClass}[${5:ConcreteType}] with\n extension (a: ${5:ConcreteType}) def ${3:method}: ${4:String} = $0",
|
|
883
|
+
"insertTextRules": 4,
|
|
884
|
+
"sortText": "03_snippet_typeclass"
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
"label": "Success",
|
|
888
|
+
"kind": 1,
|
|
889
|
+
"detail": "Success case of Try",
|
|
890
|
+
"documentation": {"value": "```scala\nimport scala.util.Success\nresult match { case Success(v) => v }\n```\nRepresents the successful result of a Try."},
|
|
891
|
+
"insertText": "Success(${1:value})",
|
|
892
|
+
"insertTextRules": 4,
|
|
893
|
+
"sortText": "02_builtin_Success"
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
"label": "Failure",
|
|
897
|
+
"kind": 1,
|
|
898
|
+
"detail": "Failure case of Try",
|
|
899
|
+
"documentation": {"value": "```scala\nimport scala.util.Failure\nresult match { case Failure(e) => handle(e) }\n```\nRepresents a failed Try containing an exception."},
|
|
900
|
+
"insertText": "Failure(${1:exception})",
|
|
901
|
+
"insertTextRules": 4,
|
|
902
|
+
"sortText": "02_builtin_Failure"
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
"label": "ListBuffer",
|
|
906
|
+
"kind": 1,
|
|
907
|
+
"detail": "Mutable list buffer",
|
|
908
|
+
"documentation": {"value": "```scala\nimport scala.collection.mutable.ListBuffer\nval buf = ListBuffer(1, 2, 3)\nbuf += 4\n```\nA mutable buffer backed by a list."},
|
|
909
|
+
"insertText": "ListBuffer(${1:elements})",
|
|
910
|
+
"insertTextRules": 4,
|
|
911
|
+
"sortText": "02_builtin_ListBuffer"
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
"label": "ArrayBuffer",
|
|
915
|
+
"kind": 1,
|
|
916
|
+
"detail": "Mutable array buffer",
|
|
917
|
+
"documentation": {"value": "```scala\nimport scala.collection.mutable.ArrayBuffer\nval buf = ArrayBuffer(1, 2, 3)\nbuf += 4\n```\nA mutable buffer backed by an array."},
|
|
918
|
+
"insertText": "ArrayBuffer(${1:elements})",
|
|
919
|
+
"insertTextRules": 4,
|
|
920
|
+
"sortText": "02_builtin_ArrayBuffer"
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"label": "HashMap",
|
|
924
|
+
"kind": 1,
|
|
925
|
+
"detail": "Mutable hash map",
|
|
926
|
+
"documentation": {"value": "```scala\nimport scala.collection.mutable.HashMap\nval m = HashMap(\"a\" -> 1, \"b\" -> 2)\n```\nA mutable map backed by a hash table."},
|
|
927
|
+
"insertText": "HashMap(${1:key} -> ${2:value})",
|
|
928
|
+
"insertTextRules": 4,
|
|
929
|
+
"sortText": "02_builtin_HashMap"
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
"label": "TreeMap",
|
|
933
|
+
"kind": 1,
|
|
934
|
+
"detail": "Sorted immutable map",
|
|
935
|
+
"documentation": {"value": "```scala\nimport scala.collection.immutable.TreeMap\nval m = TreeMap(\"a\" -> 1, \"b\" -> 2)\n```\nAn immutable sorted map backed by a red-black tree."},
|
|
936
|
+
"insertText": "TreeMap(${1:key} -> ${2:value})",
|
|
937
|
+
"insertTextRules": 4,
|
|
938
|
+
"sortText": "02_builtin_TreeMap"
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
"label": "SortedSet",
|
|
942
|
+
"kind": 1,
|
|
943
|
+
"detail": "Sorted set",
|
|
944
|
+
"documentation": {"value": "```scala\nimport scala.collection.immutable.SortedSet\nval s = SortedSet(3, 1, 2)\n```\nAn immutable sorted set."},
|
|
945
|
+
"insertText": "SortedSet(${1:elements})",
|
|
946
|
+
"insertTextRules": 4,
|
|
947
|
+
"sortText": "02_builtin_SortedSet"
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
"label": "Queue",
|
|
951
|
+
"kind": 1,
|
|
952
|
+
"detail": "Immutable queue",
|
|
953
|
+
"documentation": {"value": "```scala\nimport scala.collection.immutable.Queue\nval q = Queue(1, 2, 3)\n```\nAn immutable FIFO queue."},
|
|
954
|
+
"insertText": "Queue(${1:elements})",
|
|
955
|
+
"insertTextRules": 4,
|
|
956
|
+
"sortText": "02_builtin_Queue"
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
"label": "Stack",
|
|
960
|
+
"kind": 1,
|
|
961
|
+
"detail": "Immutable stack (deprecated)",
|
|
962
|
+
"documentation": {"value": "```scala\nval s = List(1, 2, 3) // use List as stack\nval head :: tail = s\n```\nUse List as a stack with :: and pattern matching."},
|
|
963
|
+
"insertText": "List(${1:elements})",
|
|
964
|
+
"insertTextRules": 4,
|
|
965
|
+
"sortText": "02_builtin_Stack"
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
"label": "Using",
|
|
969
|
+
"kind": 1,
|
|
970
|
+
"detail": "Resource management",
|
|
971
|
+
"documentation": {"value": "```scala\nimport scala.util.Using\nUsing(new FileReader(\"file.txt\")) { reader =>\n reader.read()\n}\n```\nAutomatically manages resource cleanup."},
|
|
972
|
+
"insertText": "Using(${1:resource}) { ${2:r} =>\n $0\n}",
|
|
973
|
+
"insertTextRules": 4,
|
|
974
|
+
"sortText": "02_builtin_Using"
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
"label": "Source",
|
|
978
|
+
"kind": 1,
|
|
979
|
+
"detail": "File/URL source",
|
|
980
|
+
"documentation": {"value": "```scala\nimport scala.io.Source\nval lines = Source.fromFile(\"file.txt\").getLines().toList\n```\nReads data from files, URLs, or other sources."},
|
|
981
|
+
"insertText": "Source.fromFile(\"${1:path}\")",
|
|
982
|
+
"insertTextRules": 4,
|
|
983
|
+
"sortText": "02_builtin_Source"
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"label": "Await",
|
|
987
|
+
"kind": 1,
|
|
988
|
+
"detail": "Future await",
|
|
989
|
+
"documentation": {"value": "```scala\nimport scala.concurrent.Await\nimport scala.concurrent.duration._\nval result = Await.result(future, 10.seconds)\n```\nBlocks until a Future completes."},
|
|
990
|
+
"insertText": "Await.result(${1:future}, ${2:10}.seconds)",
|
|
991
|
+
"insertTextRules": 4,
|
|
992
|
+
"sortText": "02_builtin_Await"
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
"label": "Duration",
|
|
996
|
+
"kind": 1,
|
|
997
|
+
"detail": "Time duration",
|
|
998
|
+
"documentation": {"value": "```scala\nimport scala.concurrent.duration._\nval d = 5.seconds\nval d2 = Duration(10, MILLISECONDS)\n```\nRepresents a time duration."},
|
|
999
|
+
"insertText": "${1:5}.${2:seconds}",
|
|
1000
|
+
"insertTextRules": 4,
|
|
1001
|
+
"sortText": "02_builtin_Duration"
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
"label": "mutable.Map",
|
|
1005
|
+
"kind": 1,
|
|
1006
|
+
"detail": "Mutable map",
|
|
1007
|
+
"documentation": {"value": "```scala\nimport scala.collection.mutable\nval m = mutable.Map(\"a\" -> 1)\nm += (\"b\" -> 2)\n```\nA mutable map."},
|
|
1008
|
+
"insertText": "mutable.Map(${1:key} -> ${2:value})",
|
|
1009
|
+
"insertTextRules": 4,
|
|
1010
|
+
"sortText": "02_builtin_mutableMap"
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
"label": "mutable.Set",
|
|
1014
|
+
"kind": 1,
|
|
1015
|
+
"detail": "Mutable set",
|
|
1016
|
+
"documentation": {"value": "```scala\nimport scala.collection.mutable\nval s = mutable.Set(1, 2, 3)\ns += 4\n```\nA mutable set."},
|
|
1017
|
+
"insertText": "mutable.Set(${1:elements})",
|
|
1018
|
+
"insertTextRules": 4,
|
|
1019
|
+
"sortText": "02_builtin_mutableSet"
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
"label": "StringBuilder",
|
|
1023
|
+
"kind": 1,
|
|
1024
|
+
"detail": "Mutable string builder",
|
|
1025
|
+
"documentation": {"value": "```scala\nval sb = new StringBuilder\nsb.append(\"Hello\")\nsb.append(\" World\")\nsb.toString\n```\nEfficiently builds strings from parts."},
|
|
1026
|
+
"insertText": "new StringBuilder",
|
|
1027
|
+
"insertTextRules": 4,
|
|
1028
|
+
"sortText": "02_builtin_StringBuilder"
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
"label": "Regex",
|
|
1032
|
+
"kind": 1,
|
|
1033
|
+
"detail": "Regular expression",
|
|
1034
|
+
"documentation": {"value": "```scala\nimport scala.util.matching.Regex\nval pattern = \"\"\"(\\d+)\"\"\".r\npattern.findFirstIn(\"abc 123\")\n```\nRegular expression pattern."},
|
|
1035
|
+
"insertText": "\"\"\"${1:pattern}\"\"\".r",
|
|
1036
|
+
"insertTextRules": 4,
|
|
1037
|
+
"sortText": "02_builtin_Regex"
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
"label": "ClassTag",
|
|
1041
|
+
"kind": 1,
|
|
1042
|
+
"detail": "Runtime class info",
|
|
1043
|
+
"documentation": {"value": "```scala\nimport scala.reflect.ClassTag\ndef create[T: ClassTag]: Array[T] = new Array[T](10)\n```\nProvides runtime class information for generic types."},
|
|
1044
|
+
"insertText": "ClassTag",
|
|
1045
|
+
"insertTextRules": 4,
|
|
1046
|
+
"sortText": "02_builtin_ClassTag"
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
"label": "PartialFunction",
|
|
1050
|
+
"kind": 1,
|
|
1051
|
+
"detail": "Partial function",
|
|
1052
|
+
"documentation": {"value": "```scala\nval pf: PartialFunction[Int, String] = {\n case 1 => \"one\"\n case 2 => \"two\"\n}\n```\nA function defined only for certain inputs."},
|
|
1053
|
+
"insertText": "val ${1:pf}: PartialFunction[${2:Input}, ${3:Output}] = {\n case ${4:pattern} => $0\n}",
|
|
1054
|
+
"insertTextRules": 4,
|
|
1055
|
+
"sortText": "02_builtin_PartialFunction"
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
"label": "Ordering",
|
|
1059
|
+
"kind": 1,
|
|
1060
|
+
"detail": "Ordering type class",
|
|
1061
|
+
"documentation": {"value": "```scala\nimplicit val ord: Ordering[Person] =\n Ordering.by(_.name)\n```\nType class for ordering/comparison."},
|
|
1062
|
+
"insertText": "Ordering.by(_.${1:field})",
|
|
1063
|
+
"insertTextRules": 4,
|
|
1064
|
+
"sortText": "02_builtin_Ordering"
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
"label": "Numeric",
|
|
1068
|
+
"kind": 1,
|
|
1069
|
+
"detail": "Numeric type class",
|
|
1070
|
+
"documentation": {"value": "```scala\ndef sum[T: Numeric](xs: List[T]): T = xs.sum\n```\nType class for numeric operations."},
|
|
1071
|
+
"insertText": "Numeric[${1:T}]",
|
|
1072
|
+
"insertTextRules": 4,
|
|
1073
|
+
"sortText": "02_builtin_Numeric"
|
|
1074
|
+
}
|
|
1075
|
+
]
|
|
1076
|
+
}
|