@enjoys/context-engine 1.0.0 → 1.0.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/commands/adb.json +322 -0
- package/data/commands/alembic.json +301 -0
- package/data/commands/artisan.json +277 -0
- package/data/commands/atlas.json +426 -0
- package/data/commands/auth0.json +648 -0
- package/data/commands/bat.json +84 -0
- package/data/commands/bundle.json +321 -0
- package/data/commands/composer.json +507 -0
- package/data/commands/dart.json +216 -0
- package/data/commands/dbmate.json +257 -0
- package/data/commands/docker-compose.json +384 -0
- package/data/commands/drizzle-kit.json +217 -0
- package/data/commands/expo.json +65 -0
- package/data/commands/fastlane.json +243 -0
- package/data/commands/fd.json +86 -0
- package/data/commands/flutter.json +298 -0
- package/data/commands/flyway.json +261 -0
- package/data/commands/fzf.json +103 -0
- package/data/commands/gem.json +267 -0
- package/data/commands/jq.json +100 -0
- package/data/commands/k9s.json +62 -0
- package/data/commands/liquibase.json +399 -0
- package/data/commands/manifest.json +619 -0
- package/data/commands/minikube.json +60 -0
- package/data/commands/ng.json +64 -0
- package/data/commands/nuxt.json +60 -0
- package/data/commands/php.json +157 -0
- package/data/commands/pm2.json +259 -0
- package/data/commands/pod.json +175 -0
- package/data/commands/prisma.json +257 -0
- package/data/commands/rails.json +372 -0
- package/data/commands/rake.json +360 -0
- package/data/commands/react-native.json +57 -0
- package/data/commands/rg.json +103 -0
- package/data/commands/rspec.json +257 -0
- package/data/commands/ruby.json +108 -0
- package/data/commands/sequelize.json +342 -0
- package/data/commands/snyk.json +442 -0
- package/data/commands/sonar-scanner.json +219 -0
- package/data/commands/stripe.json +314 -0
- package/data/commands/symfony.json +449 -0
- package/data/commands/tmux.json +197 -0
- package/data/commands/trivy.json +367 -0
- package/data/commands/twilio.json +382 -0
- package/data/commands/typeorm.json +262 -0
- package/data/commands/vue.json +60 -0
- package/data/commands/wp.json +857 -0
- package/data/commands/xcodebuild.json +141 -0
- package/data/commands/yq.json +57 -0
- package/data/completion/bash.json +1184 -0
- package/data/completion/c.json +1067 -0
- package/data/completion/cpp.json +824 -0
- package/data/completion/csharp.json +860 -0
- package/data/completion/dockerfile.json +536 -0
- package/data/completion/go.json +1346 -0
- package/data/completion/html.json +806 -0
- package/data/completion/java.json +1112 -0
- package/data/completion/javascript.json +914 -0
- package/data/completion/lua.json +968 -0
- package/data/completion/php.json +1535 -0
- package/data/completion/python.json +1427 -0
- package/data/completion/ruby.json +1531 -0
- package/data/completion/rust.json +698 -0
- package/data/completion/sql.json +887 -0
- package/data/completion/toml.json +428 -0
- package/data/completion/typescript.json +338 -0
- package/data/completion/yaml.json +563 -0
- package/data/defination/bash.json +565 -0
- package/data/defination/c.json +865 -0
- package/data/defination/cpp.json +348 -0
- package/data/defination/csharp.json +144 -0
- package/data/defination/dockerfile.json +113 -0
- package/data/defination/go.json +561 -0
- package/data/defination/html.json +559 -0
- package/data/defination/java.json +184 -0
- package/data/defination/javascript.json +265 -0
- package/data/defination/lua.json +181 -0
- package/data/defination/php.json +726 -0
- package/data/defination/python.json +717 -0
- package/data/defination/ruby.json +670 -0
- package/data/defination/rust.json +207 -0
- package/data/defination/sql.json +473 -0
- package/data/defination/toml.json +251 -0
- package/data/defination/typescript.json +29 -0
- package/data/defination/yaml.json +197 -0
- package/data/hover/bash.json +245 -0
- package/data/hover/c.json +265 -0
- package/data/hover/cpp.json +210 -0
- package/data/hover/csharp.json +290 -0
- package/data/hover/dockerfile.json +145 -0
- package/data/hover/go.json +580 -0
- package/data/hover/html.json +250 -0
- package/data/hover/java.json +395 -0
- package/data/hover/javascript.json +330 -0
- package/data/hover/lua.json +265 -0
- package/data/hover/php.json +300 -0
- package/data/hover/python.json +380 -0
- package/data/hover/ruby.json +265 -0
- package/data/hover/rust.json +275 -0
- package/data/hover/sql.json +230 -0
- package/data/hover/toml.json +145 -0
- package/data/hover/typescript.json +120 -0
- package/data/hover/yaml.json +165 -0
- package/data/manifest.json +242 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "java",
|
|
3
|
+
"completions": [
|
|
4
|
+
{
|
|
5
|
+
"label": "System.out.println",
|
|
6
|
+
"kind": 1,
|
|
7
|
+
"detail": "Print to standard output with newline",
|
|
8
|
+
"documentation": { "value": "Prints a message to the standard output stream followed by a newline.\n\n```java\nSystem.out.println(\"Hello, World!\");\nSystem.out.println(42);\nSystem.out.println(\"Value: \" + x);\n```" },
|
|
9
|
+
"insertText": "System.out.println(${1:message});",
|
|
10
|
+
"insertTextRules": 4,
|
|
11
|
+
"sortText": "00_sysout"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"label": "System.out.print",
|
|
15
|
+
"kind": 1,
|
|
16
|
+
"detail": "Print to standard output without newline",
|
|
17
|
+
"documentation": { "value": "Prints a message to the standard output stream without a trailing newline.\n\n```java\nSystem.out.print(\"Enter name: \");\nSystem.out.print(value);\n```" },
|
|
18
|
+
"insertText": "System.out.print(${1:message});",
|
|
19
|
+
"insertTextRules": 4,
|
|
20
|
+
"sortText": "00_sysprint"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"label": "System.out.printf",
|
|
24
|
+
"kind": 1,
|
|
25
|
+
"detail": "Formatted print to standard output",
|
|
26
|
+
"documentation": { "value": "Prints a formatted string to the standard output stream using format specifiers.\n\n```java\nSystem.out.printf(\"Name: %s, Age: %d%n\", name, age);\nSystem.out.printf(\"%.2f%n\", 3.14159);\nSystem.out.printf(\"%10s | %5d%n\", item, count);\n```" },
|
|
27
|
+
"insertText": "System.out.printf(\"${1:%s}%n\", ${2:args});",
|
|
28
|
+
"insertTextRules": 4,
|
|
29
|
+
"sortText": "00_sysprintf"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"label": "System.err.println",
|
|
33
|
+
"kind": 1,
|
|
34
|
+
"detail": "Print to standard error with newline",
|
|
35
|
+
"documentation": { "value": "Prints a message to the standard error stream followed by a newline.\n\n```java\nSystem.err.println(\"Error: something went wrong\");\nSystem.err.println(exception.getMessage());\n```" },
|
|
36
|
+
"insertText": "System.err.println(${1:message});",
|
|
37
|
+
"insertTextRules": 4,
|
|
38
|
+
"sortText": "00_syserr"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"label": "public class",
|
|
42
|
+
"kind": 7,
|
|
43
|
+
"detail": "Declare a public class",
|
|
44
|
+
"documentation": { "value": "Declares a new public class. The file name must match the class name.\n\n```java\npublic class MyClass {\n // fields and methods\n}\n```" },
|
|
45
|
+
"insertText": "public class ${1:ClassName} {\n\t${0}\n}",
|
|
46
|
+
"insertTextRules": 4,
|
|
47
|
+
"sortText": "01_class"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"label": "private",
|
|
51
|
+
"kind": 13,
|
|
52
|
+
"detail": "Private access modifier",
|
|
53
|
+
"documentation": { "value": "Restricts access to the declaring class only.\n\n```java\nprivate int count;\nprivate void helper() { }\n```" },
|
|
54
|
+
"insertText": "private ",
|
|
55
|
+
"insertTextRules": 0,
|
|
56
|
+
"sortText": "01_private"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"label": "protected",
|
|
60
|
+
"kind": 13,
|
|
61
|
+
"detail": "Protected access modifier",
|
|
62
|
+
"documentation": { "value": "Allows access within the same package and subclasses.\n\n```java\nprotected String name;\nprotected void init() { }\n```" },
|
|
63
|
+
"insertText": "protected ",
|
|
64
|
+
"insertTextRules": 0,
|
|
65
|
+
"sortText": "01_protected"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"label": "static",
|
|
69
|
+
"kind": 13,
|
|
70
|
+
"detail": "Static modifier",
|
|
71
|
+
"documentation": { "value": "Declares a class-level member that belongs to the class rather than instances.\n\n```java\npublic static int count = 0;\npublic static void main(String[] args) { }\n```" },
|
|
72
|
+
"insertText": "static ",
|
|
73
|
+
"insertTextRules": 0,
|
|
74
|
+
"sortText": "01_static"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"label": "final",
|
|
78
|
+
"kind": 13,
|
|
79
|
+
"detail": "Final modifier",
|
|
80
|
+
"documentation": { "value": "Prevents modification: final variables cannot be reassigned, final methods cannot be overridden, final classes cannot be extended.\n\n```java\nfinal int MAX = 100;\nfinal List<String> items = new ArrayList<>();\n```" },
|
|
81
|
+
"insertText": "final ",
|
|
82
|
+
"insertTextRules": 0,
|
|
83
|
+
"sortText": "01_final"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"label": "abstract",
|
|
87
|
+
"kind": 13,
|
|
88
|
+
"detail": "Abstract modifier",
|
|
89
|
+
"documentation": { "value": "Declares an abstract class or method. Abstract classes cannot be instantiated; abstract methods must be implemented by subclasses.\n\n```java\npublic abstract class Shape {\n public abstract double area();\n}\n```" },
|
|
90
|
+
"insertText": "abstract ",
|
|
91
|
+
"insertTextRules": 0,
|
|
92
|
+
"sortText": "01_abstract"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"label": "interface",
|
|
96
|
+
"kind": 7,
|
|
97
|
+
"detail": "Declare an interface",
|
|
98
|
+
"documentation": { "value": "Declares an interface that classes can implement.\n\n```java\npublic interface Drawable {\n void draw();\n default void reset() { }\n}\n```" },
|
|
99
|
+
"insertText": "public interface ${1:InterfaceName} {\n\t${0}\n}",
|
|
100
|
+
"insertTextRules": 4,
|
|
101
|
+
"sortText": "01_interface"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"label": "extends",
|
|
105
|
+
"kind": 13,
|
|
106
|
+
"detail": "Extend a class",
|
|
107
|
+
"documentation": { "value": "Indicates that a class inherits from a superclass.\n\n```java\npublic class Dog extends Animal {\n // inherited and new members\n}\n```" },
|
|
108
|
+
"insertText": "extends ${1:SuperClass}",
|
|
109
|
+
"insertTextRules": 4,
|
|
110
|
+
"sortText": "01_extends"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"label": "implements",
|
|
114
|
+
"kind": 13,
|
|
115
|
+
"detail": "Implement an interface",
|
|
116
|
+
"documentation": { "value": "Indicates that a class implements one or more interfaces.\n\n```java\npublic class Circle implements Drawable, Serializable {\n // implement interface methods\n}\n```" },
|
|
117
|
+
"insertText": "implements ${1:Interface}",
|
|
118
|
+
"insertTextRules": 4,
|
|
119
|
+
"sortText": "01_implements"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"label": "new",
|
|
123
|
+
"kind": 13,
|
|
124
|
+
"detail": "Create a new instance",
|
|
125
|
+
"documentation": { "value": "Creates a new instance of a class by invoking its constructor.\n\n```java\nList<String> list = new ArrayList<>();\nMyClass obj = new MyClass(arg1, arg2);\n```" },
|
|
126
|
+
"insertText": "new ${1:ClassName}(${2})",
|
|
127
|
+
"insertTextRules": 4,
|
|
128
|
+
"sortText": "01_new"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"label": "return",
|
|
132
|
+
"kind": 13,
|
|
133
|
+
"detail": "Return statement",
|
|
134
|
+
"documentation": { "value": "Returns a value from a method or exits a void method.\n\n```java\nreturn result;\nreturn x + y;\nreturn;\n```" },
|
|
135
|
+
"insertText": "return ${1:value};",
|
|
136
|
+
"insertTextRules": 4,
|
|
137
|
+
"sortText": "01_return"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"label": "throw",
|
|
141
|
+
"kind": 13,
|
|
142
|
+
"detail": "Throw an exception",
|
|
143
|
+
"documentation": { "value": "Throws an exception to be caught by a try-catch block or propagated up the call stack.\n\n```java\nthrow new IllegalArgumentException(\"Invalid value: \" + value);\nthrow new RuntimeException(\"Unexpected error\", cause);\n```" },
|
|
144
|
+
"insertText": "throw new ${1:RuntimeException}(${2:\"message\"});",
|
|
145
|
+
"insertTextRules": 4,
|
|
146
|
+
"sortText": "01_throw"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"label": "throws",
|
|
150
|
+
"kind": 13,
|
|
151
|
+
"detail": "Declare thrown exceptions",
|
|
152
|
+
"documentation": { "value": "Declares that a method may throw checked exceptions.\n\n```java\npublic void readFile(String path) throws IOException {\n // may throw IOException\n}\n```" },
|
|
153
|
+
"insertText": "throws ${1:Exception}",
|
|
154
|
+
"insertTextRules": 4,
|
|
155
|
+
"sortText": "01_throws"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"label": "try-catch",
|
|
159
|
+
"kind": 14,
|
|
160
|
+
"detail": "Try-catch block",
|
|
161
|
+
"documentation": { "value": "Wraps code that may throw exceptions and handles them gracefully.\n\n```java\ntry {\n // risky code\n} catch (Exception e) {\n e.printStackTrace();\n} finally {\n // cleanup\n}\n```" },
|
|
162
|
+
"insertText": "try {\n\t${1}\n} catch (${2:Exception} ${3:e}) {\n\t${4:e.printStackTrace();}\n}",
|
|
163
|
+
"insertTextRules": 4,
|
|
164
|
+
"sortText": "01_trycatch"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"label": "try-with-resources",
|
|
168
|
+
"kind": 14,
|
|
169
|
+
"detail": "Try-with-resources block",
|
|
170
|
+
"documentation": { "value": "Automatically closes resources that implement AutoCloseable when the block exits.\n\n```java\ntry (var reader = new BufferedReader(new FileReader(path))) {\n String line = reader.readLine();\n} catch (IOException e) {\n e.printStackTrace();\n}\n```" },
|
|
171
|
+
"insertText": "try (${1:var resource = new Resource()}) {\n\t${2}\n} catch (${3:Exception} ${4:e}) {\n\t${5:e.printStackTrace();}\n}",
|
|
172
|
+
"insertTextRules": 4,
|
|
173
|
+
"sortText": "01_trywith"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"label": "synchronized",
|
|
177
|
+
"kind": 13,
|
|
178
|
+
"detail": "Synchronized block or method",
|
|
179
|
+
"documentation": { "value": "Ensures only one thread at a time can execute the synchronized code, providing mutual exclusion.\n\n```java\nsynchronized (lock) {\n // thread-safe code\n}\n\npublic synchronized void update() { }\n```" },
|
|
180
|
+
"insertText": "synchronized (${1:this}) {\n\t${0}\n}",
|
|
181
|
+
"insertTextRules": 4,
|
|
182
|
+
"sortText": "01_synchronized"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"label": "volatile",
|
|
186
|
+
"kind": 13,
|
|
187
|
+
"detail": "Volatile field modifier",
|
|
188
|
+
"documentation": { "value": "Ensures that reads and writes to the variable are visible across threads, preventing caching in CPU registers.\n\n```java\nprivate volatile boolean running = true;\n```" },
|
|
189
|
+
"insertText": "volatile ",
|
|
190
|
+
"insertTextRules": 0,
|
|
191
|
+
"sortText": "01_volatile"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"label": "transient",
|
|
195
|
+
"kind": 13,
|
|
196
|
+
"detail": "Transient field modifier",
|
|
197
|
+
"documentation": { "value": "Marks a field to be excluded from serialization.\n\n```java\nprivate transient int cachedValue;\n```" },
|
|
198
|
+
"insertText": "transient ",
|
|
199
|
+
"insertTextRules": 0,
|
|
200
|
+
"sortText": "01_transient"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"label": "instanceof",
|
|
204
|
+
"kind": 13,
|
|
205
|
+
"detail": "Type check operator",
|
|
206
|
+
"documentation": { "value": "Tests whether an object is an instance of a specific type. Supports pattern matching (Java 16+).\n\n```java\nif (obj instanceof String s) {\n System.out.println(s.length());\n}\nif (animal instanceof Dog) { }\n```" },
|
|
207
|
+
"insertText": "instanceof ${1:Type} ${2:var}",
|
|
208
|
+
"insertTextRules": 4,
|
|
209
|
+
"sortText": "01_instanceof"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"label": "switch expression",
|
|
213
|
+
"kind": 14,
|
|
214
|
+
"detail": "Switch expression (Java 14+)",
|
|
215
|
+
"documentation": { "value": "A switch expression that yields a value using arrow syntax.\n\n```java\nString result = switch (day) {\n case MONDAY, FRIDAY -> \"Work\";\n case SATURDAY, SUNDAY -> \"Rest\";\n default -> \"Unknown\";\n};\n```" },
|
|
216
|
+
"insertText": "switch (${1:variable}) {\n\tcase ${2:value1} -> ${3:result1};\n\tcase ${4:value2} -> ${5:result2};\n\tdefault -> ${6:defaultResult};\n}",
|
|
217
|
+
"insertTextRules": 4,
|
|
218
|
+
"sortText": "01_switch"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"label": "record",
|
|
222
|
+
"kind": 7,
|
|
223
|
+
"detail": "Record class (Java 16+)",
|
|
224
|
+
"documentation": { "value": "Declares a record — a concise immutable data carrier that auto-generates equals, hashCode, toString, and accessor methods.\n\n```java\npublic record Point(int x, int y) { }\npublic record Person(String name, int age) { }\n```" },
|
|
225
|
+
"insertText": "public record ${1:RecordName}(${2:fields}) {\n\t${0}\n}",
|
|
226
|
+
"insertTextRules": 4,
|
|
227
|
+
"sortText": "01_record"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"label": "sealed",
|
|
231
|
+
"kind": 13,
|
|
232
|
+
"detail": "Sealed class modifier (Java 17+)",
|
|
233
|
+
"documentation": { "value": "Restricts which classes can extend or implement the declared type.\n\n```java\npublic sealed class Shape permits Circle, Rectangle, Triangle { }\n```" },
|
|
234
|
+
"insertText": "sealed ",
|
|
235
|
+
"insertTextRules": 0,
|
|
236
|
+
"sortText": "01_sealed"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"label": "permits",
|
|
240
|
+
"kind": 13,
|
|
241
|
+
"detail": "Permitted subclasses (Java 17+)",
|
|
242
|
+
"documentation": { "value": "Specifies the allowed subclasses of a sealed class.\n\n```java\npublic sealed class Shape permits Circle, Rectangle { }\n```" },
|
|
243
|
+
"insertText": "permits ${1:SubClass}",
|
|
244
|
+
"insertTextRules": 4,
|
|
245
|
+
"sortText": "01_permits"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"label": "var",
|
|
249
|
+
"kind": 13,
|
|
250
|
+
"detail": "Local variable type inference (Java 10+)",
|
|
251
|
+
"documentation": { "value": "Infers the type of a local variable from the initializer expression.\n\n```java\nvar list = new ArrayList<String>();\nvar map = Map.of(\"key\", \"value\");\nvar count = 0;\n```" },
|
|
252
|
+
"insertText": "var ${1:name} = ${2:value};",
|
|
253
|
+
"insertTextRules": 4,
|
|
254
|
+
"sortText": "01_var"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"label": "String.valueOf",
|
|
258
|
+
"kind": 1,
|
|
259
|
+
"detail": "Convert to String",
|
|
260
|
+
"documentation": { "value": "Returns the string representation of the argument.\n\n```java\nString s = String.valueOf(42);\nString s = String.valueOf(true);\nString s = String.valueOf(charArray);\n```" },
|
|
261
|
+
"insertText": "String.valueOf(${1:value})",
|
|
262
|
+
"insertTextRules": 4,
|
|
263
|
+
"sortText": "02_string_valueof"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"label": "String.format",
|
|
267
|
+
"kind": 1,
|
|
268
|
+
"detail": "Create a formatted String",
|
|
269
|
+
"documentation": { "value": "Returns a formatted string using the specified format string and arguments.\n\n```java\nString s = String.format(\"Name: %s, Age: %d\", name, age);\nString s = String.format(\"%.2f\", price);\n```" },
|
|
270
|
+
"insertText": "String.format(\"${1:%s}\", ${2:args})",
|
|
271
|
+
"insertTextRules": 4,
|
|
272
|
+
"sortText": "02_string_format"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"label": "String.join",
|
|
276
|
+
"kind": 1,
|
|
277
|
+
"detail": "Join strings with delimiter",
|
|
278
|
+
"documentation": { "value": "Returns a new String composed of elements joined together with the specified delimiter.\n\n```java\nString csv = String.join(\", \", \"a\", \"b\", \"c\");\nString path = String.join(\"/\", parts);\n```" },
|
|
279
|
+
"insertText": "String.join(\"${1:, }\", ${2:elements})",
|
|
280
|
+
"insertTextRules": 4,
|
|
281
|
+
"sortText": "02_string_join"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"label": ".length()",
|
|
285
|
+
"kind": 1,
|
|
286
|
+
"detail": "String length",
|
|
287
|
+
"documentation": { "value": "Returns the number of characters in the string.\n\n```java\nint len = str.length();\nif (name.length() > 0) { }\n```" },
|
|
288
|
+
"insertText": ".length()",
|
|
289
|
+
"insertTextRules": 0,
|
|
290
|
+
"sortText": "02_length"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"label": ".charAt()",
|
|
294
|
+
"kind": 1,
|
|
295
|
+
"detail": "Get character at index",
|
|
296
|
+
"documentation": { "value": "Returns the char value at the specified index.\n\n```java\nchar c = str.charAt(0);\nchar last = str.charAt(str.length() - 1);\n```" },
|
|
297
|
+
"insertText": ".charAt(${1:index})",
|
|
298
|
+
"insertTextRules": 4,
|
|
299
|
+
"sortText": "02_charat"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"label": ".substring()",
|
|
303
|
+
"kind": 1,
|
|
304
|
+
"detail": "Extract substring",
|
|
305
|
+
"documentation": { "value": "Returns a substring from the specified begin index to the end index.\n\n```java\nString sub = str.substring(0, 5);\nString rest = str.substring(3);\n```" },
|
|
306
|
+
"insertText": ".substring(${1:beginIndex}, ${2:endIndex})",
|
|
307
|
+
"insertTextRules": 4,
|
|
308
|
+
"sortText": "02_substring"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"label": ".equals()",
|
|
312
|
+
"kind": 1,
|
|
313
|
+
"detail": "Compare string equality",
|
|
314
|
+
"documentation": { "value": "Compares this string to the specified object for content equality.\n\n```java\nif (str.equals(\"hello\")) { }\nif (a.equals(b)) { }\n```" },
|
|
315
|
+
"insertText": ".equals(${1:other})",
|
|
316
|
+
"insertTextRules": 4,
|
|
317
|
+
"sortText": "02_equals"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"label": ".equalsIgnoreCase()",
|
|
321
|
+
"kind": 1,
|
|
322
|
+
"detail": "Compare strings ignoring case",
|
|
323
|
+
"documentation": { "value": "Compares this string to another string, ignoring case differences.\n\n```java\nif (input.equalsIgnoreCase(\"yes\")) { }\n```" },
|
|
324
|
+
"insertText": ".equalsIgnoreCase(${1:other})",
|
|
325
|
+
"insertTextRules": 4,
|
|
326
|
+
"sortText": "02_equalsignorecase"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"label": ".contains()",
|
|
330
|
+
"kind": 1,
|
|
331
|
+
"detail": "Check if string contains a sequence",
|
|
332
|
+
"documentation": { "value": "Returns true if this string contains the specified sequence of characters.\n\n```java\nif (str.contains(\"search\")) { }\nboolean found = text.contains(keyword);\n```" },
|
|
333
|
+
"insertText": ".contains(${1:sequence})",
|
|
334
|
+
"insertTextRules": 4,
|
|
335
|
+
"sortText": "02_contains"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"label": ".startsWith()",
|
|
339
|
+
"kind": 1,
|
|
340
|
+
"detail": "Check if string starts with prefix",
|
|
341
|
+
"documentation": { "value": "Tests if this string starts with the specified prefix.\n\n```java\nif (url.startsWith(\"https://\")) { }\n```" },
|
|
342
|
+
"insertText": ".startsWith(${1:prefix})",
|
|
343
|
+
"insertTextRules": 4,
|
|
344
|
+
"sortText": "02_startswith"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"label": ".endsWith()",
|
|
348
|
+
"kind": 1,
|
|
349
|
+
"detail": "Check if string ends with suffix",
|
|
350
|
+
"documentation": { "value": "Tests if this string ends with the specified suffix.\n\n```java\nif (file.endsWith(\".java\")) { }\n```" },
|
|
351
|
+
"insertText": ".endsWith(${1:suffix})",
|
|
352
|
+
"insertTextRules": 4,
|
|
353
|
+
"sortText": "02_endswith"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"label": ".indexOf()",
|
|
357
|
+
"kind": 1,
|
|
358
|
+
"detail": "Find index of substring",
|
|
359
|
+
"documentation": { "value": "Returns the index of the first occurrence of the specified substring, or -1 if not found.\n\n```java\nint idx = str.indexOf(\"find\");\nint pos = str.indexOf('@');\n```" },
|
|
360
|
+
"insertText": ".indexOf(${1:str})",
|
|
361
|
+
"insertTextRules": 4,
|
|
362
|
+
"sortText": "02_indexof"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"label": ".replace()",
|
|
366
|
+
"kind": 1,
|
|
367
|
+
"detail": "Replace characters or sequences",
|
|
368
|
+
"documentation": { "value": "Returns a string with all occurrences of the target replaced by the replacement.\n\n```java\nString result = str.replace(\"old\", \"new\");\nString clean = str.replace(\" \", \"\");\n```" },
|
|
369
|
+
"insertText": ".replace(${1:target}, ${2:replacement})",
|
|
370
|
+
"insertTextRules": 4,
|
|
371
|
+
"sortText": "02_replace"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"label": ".replaceAll()",
|
|
375
|
+
"kind": 1,
|
|
376
|
+
"detail": "Replace all regex matches",
|
|
377
|
+
"documentation": { "value": "Replaces each substring matching the given regular expression with the replacement.\n\n```java\nString clean = str.replaceAll(\"\\\\s+\", \" \");\nString digits = str.replaceAll(\"[^0-9]\", \"\");\n```" },
|
|
378
|
+
"insertText": ".replaceAll(${1:regex}, ${2:replacement})",
|
|
379
|
+
"insertTextRules": 4,
|
|
380
|
+
"sortText": "02_replaceall"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"label": ".split()",
|
|
384
|
+
"kind": 1,
|
|
385
|
+
"detail": "Split string by regex",
|
|
386
|
+
"documentation": { "value": "Splits this string around matches of the given regular expression.\n\n```java\nString[] parts = str.split(\",\");\nString[] words = str.split(\"\\\\s+\");\n```" },
|
|
387
|
+
"insertText": ".split(\"${1:regex}\")",
|
|
388
|
+
"insertTextRules": 4,
|
|
389
|
+
"sortText": "02_split"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"label": ".trim()",
|
|
393
|
+
"kind": 1,
|
|
394
|
+
"detail": "Remove leading and trailing whitespace",
|
|
395
|
+
"documentation": { "value": "Returns a string with leading and trailing whitespace (char <= ' ') removed.\n\n```java\nString clean = input.trim();\n```" },
|
|
396
|
+
"insertText": ".trim()",
|
|
397
|
+
"insertTextRules": 0,
|
|
398
|
+
"sortText": "02_trim"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"label": ".strip()",
|
|
402
|
+
"kind": 1,
|
|
403
|
+
"detail": "Strip whitespace (Unicode-aware)",
|
|
404
|
+
"documentation": { "value": "Returns a string with all leading and trailing Unicode whitespace removed. Preferred over trim() for Unicode support (Java 11+).\n\n```java\nString clean = input.strip();\n```" },
|
|
405
|
+
"insertText": ".strip()",
|
|
406
|
+
"insertTextRules": 0,
|
|
407
|
+
"sortText": "02_strip"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"label": ".toUpperCase()",
|
|
411
|
+
"kind": 1,
|
|
412
|
+
"detail": "Convert to uppercase",
|
|
413
|
+
"documentation": { "value": "Converts all characters to upper case using the rules of the default locale.\n\n```java\nString upper = str.toUpperCase();\n```" },
|
|
414
|
+
"insertText": ".toUpperCase()",
|
|
415
|
+
"insertTextRules": 0,
|
|
416
|
+
"sortText": "02_touppercase"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"label": ".toLowerCase()",
|
|
420
|
+
"kind": 1,
|
|
421
|
+
"detail": "Convert to lowercase",
|
|
422
|
+
"documentation": { "value": "Converts all characters to lower case using the rules of the default locale.\n\n```java\nString lower = str.toLowerCase();\n```" },
|
|
423
|
+
"insertText": ".toLowerCase()",
|
|
424
|
+
"insertTextRules": 0,
|
|
425
|
+
"sortText": "02_tolowercase"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"label": ".isEmpty()",
|
|
429
|
+
"kind": 1,
|
|
430
|
+
"detail": "Check if string is empty",
|
|
431
|
+
"documentation": { "value": "Returns true if length() is 0.\n\n```java\nif (str.isEmpty()) { }\n```" },
|
|
432
|
+
"insertText": ".isEmpty()",
|
|
433
|
+
"insertTextRules": 0,
|
|
434
|
+
"sortText": "02_isempty"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"label": ".isBlank()",
|
|
438
|
+
"kind": 1,
|
|
439
|
+
"detail": "Check if string is blank (Java 11+)",
|
|
440
|
+
"documentation": { "value": "Returns true if the string is empty or contains only whitespace characters.\n\n```java\nif (str.isBlank()) { }\n\" \".isBlank(); // true\n```" },
|
|
441
|
+
"insertText": ".isBlank()",
|
|
442
|
+
"insertTextRules": 0,
|
|
443
|
+
"sortText": "02_isblank"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"label": ".toCharArray()",
|
|
447
|
+
"kind": 1,
|
|
448
|
+
"detail": "Convert string to char array",
|
|
449
|
+
"documentation": { "value": "Converts this string to a new character array.\n\n```java\nchar[] chars = str.toCharArray();\nfor (char c : str.toCharArray()) { }\n```" },
|
|
450
|
+
"insertText": ".toCharArray()",
|
|
451
|
+
"insertTextRules": 0,
|
|
452
|
+
"sortText": "02_tochararray"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"label": ".matches()",
|
|
456
|
+
"kind": 1,
|
|
457
|
+
"detail": "Match against regex",
|
|
458
|
+
"documentation": { "value": "Tells whether this string matches the given regular expression.\n\n```java\nboolean valid = email.matches(\"[\\\\w.]+@[\\\\w.]+\");\nif (str.matches(\"\\\\d+\")) { }\n```" },
|
|
459
|
+
"insertText": ".matches(\"${1:regex}\")",
|
|
460
|
+
"insertTextRules": 4,
|
|
461
|
+
"sortText": "02_matches"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"label": "List.of",
|
|
465
|
+
"kind": 1,
|
|
466
|
+
"detail": "Create immutable list (Java 9+)",
|
|
467
|
+
"documentation": { "value": "Returns an unmodifiable list containing the specified elements.\n\n```java\nList<String> names = List.of(\"Alice\", \"Bob\", \"Charlie\");\nList<Integer> nums = List.of(1, 2, 3);\n```" },
|
|
468
|
+
"insertText": "List.of(${1:elements})",
|
|
469
|
+
"insertTextRules": 4,
|
|
470
|
+
"sortText": "03_list_of"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"label": "List.copyOf",
|
|
474
|
+
"kind": 1,
|
|
475
|
+
"detail": "Create immutable copy of list (Java 10+)",
|
|
476
|
+
"documentation": { "value": "Returns an unmodifiable list containing the elements of the given collection.\n\n```java\nList<String> copy = List.copyOf(mutableList);\n```" },
|
|
477
|
+
"insertText": "List.copyOf(${1:collection})",
|
|
478
|
+
"insertTextRules": 4,
|
|
479
|
+
"sortText": "03_list_copyof"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"label": "ArrayList",
|
|
483
|
+
"kind": 7,
|
|
484
|
+
"detail": "Resizable array list",
|
|
485
|
+
"documentation": { "value": "A resizable-array implementation of the List interface.\n\n```java\nList<String> list = new ArrayList<>();\nList<Integer> nums = new ArrayList<>(List.of(1, 2, 3));\nlist.add(\"item\");\n```" },
|
|
486
|
+
"insertText": "new ArrayList<${1:Type}>(${2})",
|
|
487
|
+
"insertTextRules": 4,
|
|
488
|
+
"sortText": "03_arraylist"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"label": "LinkedList",
|
|
492
|
+
"kind": 7,
|
|
493
|
+
"detail": "Doubly-linked list",
|
|
494
|
+
"documentation": { "value": "A doubly-linked list implementation of the List and Deque interfaces.\n\n```java\nLinkedList<String> list = new LinkedList<>();\nlist.addFirst(\"first\");\nlist.addLast(\"last\");\n```" },
|
|
495
|
+
"insertText": "new LinkedList<${1:Type}>()",
|
|
496
|
+
"insertTextRules": 4,
|
|
497
|
+
"sortText": "03_linkedlist"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"label": "HashMap",
|
|
501
|
+
"kind": 7,
|
|
502
|
+
"detail": "Hash table based map",
|
|
503
|
+
"documentation": { "value": "Hash table based implementation of the Map interface. Permits null keys and values.\n\n```java\nMap<String, Integer> map = new HashMap<>();\nmap.put(\"key\", 42);\nint val = map.getOrDefault(\"key\", 0);\n```" },
|
|
504
|
+
"insertText": "new HashMap<${1:Key}, ${2:Value}>()",
|
|
505
|
+
"insertTextRules": 4,
|
|
506
|
+
"sortText": "03_hashmap"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"label": "TreeMap",
|
|
510
|
+
"kind": 7,
|
|
511
|
+
"detail": "Sorted map (red-black tree)",
|
|
512
|
+
"documentation": { "value": "A NavigableMap implementation based on a Red-Black tree. Keys are sorted in natural order or by a provided Comparator.\n\n```java\nTreeMap<String, Integer> map = new TreeMap<>();\nmap.put(\"banana\", 2);\nmap.firstKey(); // smallest key\n```" },
|
|
513
|
+
"insertText": "new TreeMap<${1:Key}, ${2:Value}>()",
|
|
514
|
+
"insertTextRules": 4,
|
|
515
|
+
"sortText": "03_treemap"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"label": "HashSet",
|
|
519
|
+
"kind": 7,
|
|
520
|
+
"detail": "Hash table based set",
|
|
521
|
+
"documentation": { "value": "Implements the Set interface backed by a hash table. Does not guarantee iteration order.\n\n```java\nSet<String> set = new HashSet<>();\nset.add(\"item\");\nboolean exists = set.contains(\"item\");\n```" },
|
|
522
|
+
"insertText": "new HashSet<${1:Type}>()",
|
|
523
|
+
"insertTextRules": 4,
|
|
524
|
+
"sortText": "03_hashset"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"label": "TreeSet",
|
|
528
|
+
"kind": 7,
|
|
529
|
+
"detail": "Sorted set (red-black tree)",
|
|
530
|
+
"documentation": { "value": "A NavigableSet implementation based on a TreeMap. Elements are sorted in natural order or by a provided Comparator.\n\n```java\nTreeSet<Integer> sorted = new TreeSet<>();\nsorted.add(3);\nsorted.add(1);\nsorted.first(); // 1\n```" },
|
|
531
|
+
"insertText": "new TreeSet<${1:Type}>()",
|
|
532
|
+
"insertTextRules": 4,
|
|
533
|
+
"sortText": "03_treeset"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"label": "Collections.sort",
|
|
537
|
+
"kind": 1,
|
|
538
|
+
"detail": "Sort a list",
|
|
539
|
+
"documentation": { "value": "Sorts the specified list into ascending order according to natural ordering or a provided Comparator.\n\n```java\nCollections.sort(list);\nCollections.sort(list, Comparator.reverseOrder());\n```" },
|
|
540
|
+
"insertText": "Collections.sort(${1:list})",
|
|
541
|
+
"insertTextRules": 4,
|
|
542
|
+
"sortText": "03_collections_sort"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"label": "Collections.unmodifiableList",
|
|
546
|
+
"kind": 1,
|
|
547
|
+
"detail": "Create unmodifiable list view",
|
|
548
|
+
"documentation": { "value": "Returns an unmodifiable view of the specified list.\n\n```java\nList<String> readOnly = Collections.unmodifiableList(mutableList);\n```" },
|
|
549
|
+
"insertText": "Collections.unmodifiableList(${1:list})",
|
|
550
|
+
"insertTextRules": 4,
|
|
551
|
+
"sortText": "03_collections_unmod"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"label": "Arrays.asList",
|
|
555
|
+
"kind": 1,
|
|
556
|
+
"detail": "Convert array to fixed-size list",
|
|
557
|
+
"documentation": { "value": "Returns a fixed-size list backed by the specified array.\n\n```java\nList<String> list = Arrays.asList(\"a\", \"b\", \"c\");\n```" },
|
|
558
|
+
"insertText": "Arrays.asList(${1:elements})",
|
|
559
|
+
"insertTextRules": 4,
|
|
560
|
+
"sortText": "03_arrays_aslist"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"label": "Arrays.sort",
|
|
564
|
+
"kind": 1,
|
|
565
|
+
"detail": "Sort an array",
|
|
566
|
+
"documentation": { "value": "Sorts the specified array into ascending numerical order.\n\n```java\nArrays.sort(arr);\nArrays.sort(arr, Comparator.reverseOrder());\n```" },
|
|
567
|
+
"insertText": "Arrays.sort(${1:array})",
|
|
568
|
+
"insertTextRules": 4,
|
|
569
|
+
"sortText": "03_arrays_sort"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"label": "Arrays.stream",
|
|
573
|
+
"kind": 1,
|
|
574
|
+
"detail": "Create stream from array",
|
|
575
|
+
"documentation": { "value": "Returns a sequential Stream with the specified array as its source.\n\n```java\nArrays.stream(arr).filter(x -> x > 0).forEach(System.out::println);\n```" },
|
|
576
|
+
"insertText": "Arrays.stream(${1:array})",
|
|
577
|
+
"insertTextRules": 4,
|
|
578
|
+
"sortText": "03_arrays_stream"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"label": "Map.of",
|
|
582
|
+
"kind": 1,
|
|
583
|
+
"detail": "Create immutable map (Java 9+)",
|
|
584
|
+
"documentation": { "value": "Returns an unmodifiable map containing the specified key-value pairs.\n\n```java\nMap<String, Integer> map = Map.of(\"a\", 1, \"b\", 2);\n```" },
|
|
585
|
+
"insertText": "Map.of(${1:key}, ${2:value})",
|
|
586
|
+
"insertTextRules": 4,
|
|
587
|
+
"sortText": "03_map_of"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"label": "Map.entry",
|
|
591
|
+
"kind": 1,
|
|
592
|
+
"detail": "Create immutable Map.Entry (Java 9+)",
|
|
593
|
+
"documentation": { "value": "Returns an unmodifiable Map.Entry containing the specified key and value.\n\n```java\nMap.Entry<String, Integer> e = Map.entry(\"key\", 42);\nMap<String, Integer> map = Map.ofEntries(Map.entry(\"a\", 1));\n```" },
|
|
594
|
+
"insertText": "Map.entry(${1:key}, ${2:value})",
|
|
595
|
+
"insertTextRules": 4,
|
|
596
|
+
"sortText": "03_map_entry"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"label": "Set.of",
|
|
600
|
+
"kind": 1,
|
|
601
|
+
"detail": "Create immutable set (Java 9+)",
|
|
602
|
+
"documentation": { "value": "Returns an unmodifiable set containing the specified elements.\n\n```java\nSet<String> set = Set.of(\"a\", \"b\", \"c\");\n```" },
|
|
603
|
+
"insertText": "Set.of(${1:elements})",
|
|
604
|
+
"insertTextRules": 4,
|
|
605
|
+
"sortText": "03_set_of"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"label": ".stream()",
|
|
609
|
+
"kind": 1,
|
|
610
|
+
"detail": "Create stream from collection",
|
|
611
|
+
"documentation": { "value": "Returns a sequential Stream with this collection as its source.\n\n```java\nlist.stream().filter(x -> x > 0).collect(Collectors.toList());\nset.stream().map(String::toUpperCase).toList();\n```" },
|
|
612
|
+
"insertText": ".stream()",
|
|
613
|
+
"insertTextRules": 0,
|
|
614
|
+
"sortText": "04_stream"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"label": ".filter()",
|
|
618
|
+
"kind": 1,
|
|
619
|
+
"detail": "Filter stream elements",
|
|
620
|
+
"documentation": { "value": "Returns a stream consisting of elements that match the given predicate.\n\n```java\nlist.stream().filter(s -> s.length() > 3)\nlist.stream().filter(Objects::nonNull)\n```" },
|
|
621
|
+
"insertText": ".filter(${1:element} -> ${2:condition})",
|
|
622
|
+
"insertTextRules": 4,
|
|
623
|
+
"sortText": "04_filter"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"label": ".map()",
|
|
627
|
+
"kind": 1,
|
|
628
|
+
"detail": "Transform stream elements",
|
|
629
|
+
"documentation": { "value": "Returns a stream with each element transformed by the given function.\n\n```java\nlist.stream().map(String::toUpperCase)\nlist.stream().map(x -> x * 2)\n```" },
|
|
630
|
+
"insertText": ".map(${1:element} -> ${2:transform})",
|
|
631
|
+
"insertTextRules": 4,
|
|
632
|
+
"sortText": "04_map"
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
"label": ".flatMap()",
|
|
636
|
+
"kind": 1,
|
|
637
|
+
"detail": "Flatten and transform stream elements",
|
|
638
|
+
"documentation": { "value": "Returns a stream where each element is replaced with the contents of a mapped stream.\n\n```java\nlist.stream().flatMap(Collection::stream)\nlist.stream().flatMap(s -> Arrays.stream(s.split(\",\")))\n```" },
|
|
639
|
+
"insertText": ".flatMap(${1:element} -> ${2:stream})",
|
|
640
|
+
"insertTextRules": 4,
|
|
641
|
+
"sortText": "04_flatmap"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"label": ".collect()",
|
|
645
|
+
"kind": 1,
|
|
646
|
+
"detail": "Collect stream into a container",
|
|
647
|
+
"documentation": { "value": "Performs a mutable reduction operation on stream elements using a Collector.\n\n```java\nList<String> result = stream.collect(Collectors.toList());\nMap<String, List<Item>> grouped = items.stream()\n .collect(Collectors.groupingBy(Item::category));\n```" },
|
|
648
|
+
"insertText": ".collect(Collectors.${1:toList}())",
|
|
649
|
+
"insertTextRules": 4,
|
|
650
|
+
"sortText": "04_collect"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"label": ".reduce()",
|
|
654
|
+
"kind": 1,
|
|
655
|
+
"detail": "Reduce stream to a single value",
|
|
656
|
+
"documentation": { "value": "Performs a reduction on the elements using an associative accumulation function.\n\n```java\nint sum = list.stream().reduce(0, Integer::sum);\nOptional<String> concat = list.stream().reduce(String::concat);\n```" },
|
|
657
|
+
"insertText": ".reduce(${1:identity}, ${2:accumulator})",
|
|
658
|
+
"insertTextRules": 4,
|
|
659
|
+
"sortText": "04_reduce"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"label": ".forEach()",
|
|
663
|
+
"kind": 1,
|
|
664
|
+
"detail": "Perform action for each element",
|
|
665
|
+
"documentation": { "value": "Performs an action for each element of the stream.\n\n```java\nlist.forEach(System.out::println);\nmap.forEach((k, v) -> System.out.println(k + \"=\" + v));\n```" },
|
|
666
|
+
"insertText": ".forEach(${1:element} -> ${2:action})",
|
|
667
|
+
"insertTextRules": 4,
|
|
668
|
+
"sortText": "04_foreach"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"label": ".sorted()",
|
|
672
|
+
"kind": 1,
|
|
673
|
+
"detail": "Sort stream elements",
|
|
674
|
+
"documentation": { "value": "Returns a stream with elements sorted in natural order or by a comparator.\n\n```java\nlist.stream().sorted()\nlist.stream().sorted(Comparator.comparing(Person::name))\n```" },
|
|
675
|
+
"insertText": ".sorted(${1})",
|
|
676
|
+
"insertTextRules": 4,
|
|
677
|
+
"sortText": "04_sorted"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"label": ".distinct()",
|
|
681
|
+
"kind": 1,
|
|
682
|
+
"detail": "Remove duplicates from stream",
|
|
683
|
+
"documentation": { "value": "Returns a stream with distinct elements (by Object.equals).\n\n```java\nList<Integer> unique = list.stream().distinct().toList();\n```" },
|
|
684
|
+
"insertText": ".distinct()",
|
|
685
|
+
"insertTextRules": 0,
|
|
686
|
+
"sortText": "04_distinct"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"label": ".limit()",
|
|
690
|
+
"kind": 1,
|
|
691
|
+
"detail": "Limit stream to n elements",
|
|
692
|
+
"documentation": { "value": "Returns a stream consisting of at most maxSize elements.\n\n```java\nlist.stream().limit(10).forEach(System.out::println);\n```" },
|
|
693
|
+
"insertText": ".limit(${1:maxSize})",
|
|
694
|
+
"insertTextRules": 4,
|
|
695
|
+
"sortText": "04_limit"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"label": ".skip()",
|
|
699
|
+
"kind": 1,
|
|
700
|
+
"detail": "Skip first n elements",
|
|
701
|
+
"documentation": { "value": "Returns a stream with the first n elements discarded.\n\n```java\nlist.stream().skip(5).forEach(System.out::println);\n```" },
|
|
702
|
+
"insertText": ".skip(${1:n})",
|
|
703
|
+
"insertTextRules": 4,
|
|
704
|
+
"sortText": "04_skip"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"label": ".count()",
|
|
708
|
+
"kind": 1,
|
|
709
|
+
"detail": "Count stream elements",
|
|
710
|
+
"documentation": { "value": "Returns the count of elements in the stream.\n\n```java\nlong n = list.stream().filter(x -> x > 0).count();\n```" },
|
|
711
|
+
"insertText": ".count()",
|
|
712
|
+
"insertTextRules": 0,
|
|
713
|
+
"sortText": "04_count"
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"label": ".findFirst()",
|
|
717
|
+
"kind": 1,
|
|
718
|
+
"detail": "Find first element",
|
|
719
|
+
"documentation": { "value": "Returns an Optional describing the first element, or empty if the stream is empty.\n\n```java\nOptional<String> first = list.stream().filter(s -> s.startsWith(\"A\")).findFirst();\n```" },
|
|
720
|
+
"insertText": ".findFirst()",
|
|
721
|
+
"insertTextRules": 0,
|
|
722
|
+
"sortText": "04_findfirst"
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"label": ".findAny()",
|
|
726
|
+
"kind": 1,
|
|
727
|
+
"detail": "Find any element",
|
|
728
|
+
"documentation": { "value": "Returns an Optional describing some element of the stream. May return any match in parallel streams.\n\n```java\nOptional<String> any = list.parallelStream().filter(s -> s.length() > 3).findAny();\n```" },
|
|
729
|
+
"insertText": ".findAny()",
|
|
730
|
+
"insertTextRules": 0,
|
|
731
|
+
"sortText": "04_findany"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"label": ".anyMatch()",
|
|
735
|
+
"kind": 1,
|
|
736
|
+
"detail": "Check if any element matches",
|
|
737
|
+
"documentation": { "value": "Returns whether any element matches the provided predicate.\n\n```java\nboolean hasNegative = list.stream().anyMatch(x -> x < 0);\n```" },
|
|
738
|
+
"insertText": ".anyMatch(${1:element} -> ${2:condition})",
|
|
739
|
+
"insertTextRules": 4,
|
|
740
|
+
"sortText": "04_anymatch"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"label": ".allMatch()",
|
|
744
|
+
"kind": 1,
|
|
745
|
+
"detail": "Check if all elements match",
|
|
746
|
+
"documentation": { "value": "Returns whether all elements match the provided predicate.\n\n```java\nboolean allPositive = list.stream().allMatch(x -> x > 0);\n```" },
|
|
747
|
+
"insertText": ".allMatch(${1:element} -> ${2:condition})",
|
|
748
|
+
"insertTextRules": 4,
|
|
749
|
+
"sortText": "04_allmatch"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
"label": ".noneMatch()",
|
|
753
|
+
"kind": 1,
|
|
754
|
+
"detail": "Check if no elements match",
|
|
755
|
+
"documentation": { "value": "Returns whether no elements match the provided predicate.\n\n```java\nboolean noNulls = list.stream().noneMatch(Objects::isNull);\n```" },
|
|
756
|
+
"insertText": ".noneMatch(${1:element} -> ${2:condition})",
|
|
757
|
+
"insertTextRules": 4,
|
|
758
|
+
"sortText": "04_nonematch"
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"label": "Collectors.toList()",
|
|
762
|
+
"kind": 1,
|
|
763
|
+
"detail": "Collect stream to List",
|
|
764
|
+
"documentation": { "value": "Returns a Collector that accumulates elements into a new List.\n\n```java\nList<String> result = stream.collect(Collectors.toList());\n```" },
|
|
765
|
+
"insertText": "Collectors.toList()",
|
|
766
|
+
"insertTextRules": 0,
|
|
767
|
+
"sortText": "04_collectors_tolist"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"label": "Collectors.toMap()",
|
|
771
|
+
"kind": 1,
|
|
772
|
+
"detail": "Collect stream to Map",
|
|
773
|
+
"documentation": { "value": "Returns a Collector that accumulates elements into a Map.\n\n```java\nMap<String, Integer> map = items.stream()\n .collect(Collectors.toMap(Item::name, Item::price));\n```" },
|
|
774
|
+
"insertText": "Collectors.toMap(${1:keyMapper}, ${2:valueMapper})",
|
|
775
|
+
"insertTextRules": 4,
|
|
776
|
+
"sortText": "04_collectors_tomap"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"label": "Collectors.groupingBy()",
|
|
780
|
+
"kind": 1,
|
|
781
|
+
"detail": "Group stream elements",
|
|
782
|
+
"documentation": { "value": "Returns a Collector that groups elements by a classifier function.\n\n```java\nMap<String, List<Person>> byCity = people.stream()\n .collect(Collectors.groupingBy(Person::city));\n```" },
|
|
783
|
+
"insertText": "Collectors.groupingBy(${1:classifier})",
|
|
784
|
+
"insertTextRules": 4,
|
|
785
|
+
"sortText": "04_collectors_groupingby"
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"label": "Collectors.joining()",
|
|
789
|
+
"kind": 1,
|
|
790
|
+
"detail": "Join stream elements to String",
|
|
791
|
+
"documentation": { "value": "Returns a Collector that concatenates stream elements into a single String.\n\n```java\nString csv = list.stream().collect(Collectors.joining(\", \"));\nString wrapped = list.stream().collect(Collectors.joining(\", \", \"[\", \"]\"));\n```" },
|
|
792
|
+
"insertText": "Collectors.joining(\"${1:, }\")",
|
|
793
|
+
"insertTextRules": 4,
|
|
794
|
+
"sortText": "04_collectors_joining"
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"label": "Optional.of",
|
|
798
|
+
"kind": 1,
|
|
799
|
+
"detail": "Create Optional with non-null value",
|
|
800
|
+
"documentation": { "value": "Returns an Optional describing the specified non-null value. Throws NullPointerException if value is null.\n\n```java\nOptional<String> opt = Optional.of(\"hello\");\n```" },
|
|
801
|
+
"insertText": "Optional.of(${1:value})",
|
|
802
|
+
"insertTextRules": 4,
|
|
803
|
+
"sortText": "05_optional_of"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"label": "Optional.ofNullable",
|
|
807
|
+
"kind": 1,
|
|
808
|
+
"detail": "Create Optional that may be null",
|
|
809
|
+
"documentation": { "value": "Returns an Optional describing the value, or empty if null.\n\n```java\nOptional<String> opt = Optional.ofNullable(getValue());\n```" },
|
|
810
|
+
"insertText": "Optional.ofNullable(${1:value})",
|
|
811
|
+
"insertTextRules": 4,
|
|
812
|
+
"sortText": "05_optional_ofnullable"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"label": "Optional.empty",
|
|
816
|
+
"kind": 1,
|
|
817
|
+
"detail": "Create empty Optional",
|
|
818
|
+
"documentation": { "value": "Returns an empty Optional instance.\n\n```java\nOptional<String> opt = Optional.empty();\n```" },
|
|
819
|
+
"insertText": "Optional.empty()",
|
|
820
|
+
"insertTextRules": 0,
|
|
821
|
+
"sortText": "05_optional_empty"
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
"label": ".isPresent()",
|
|
825
|
+
"kind": 1,
|
|
826
|
+
"detail": "Check if Optional has value",
|
|
827
|
+
"documentation": { "value": "Returns true if a value is present.\n\n```java\nif (opt.isPresent()) {\n System.out.println(opt.get());\n}\n```" },
|
|
828
|
+
"insertText": ".isPresent()",
|
|
829
|
+
"insertTextRules": 0,
|
|
830
|
+
"sortText": "05_ispresent"
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
"label": ".orElse()",
|
|
834
|
+
"kind": 1,
|
|
835
|
+
"detail": "Get value or default",
|
|
836
|
+
"documentation": { "value": "Returns the value if present, otherwise returns the specified default.\n\n```java\nString name = opt.orElse(\"Unknown\");\nint val = optInt.orElse(0);\n```" },
|
|
837
|
+
"insertText": ".orElse(${1:defaultValue})",
|
|
838
|
+
"insertTextRules": 4,
|
|
839
|
+
"sortText": "05_orelse"
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
"label": ".orElseGet()",
|
|
843
|
+
"kind": 1,
|
|
844
|
+
"detail": "Get value or compute default",
|
|
845
|
+
"documentation": { "value": "Returns the value if present, otherwise invokes the supplier and returns its result.\n\n```java\nString name = opt.orElseGet(() -> computeDefault());\n```" },
|
|
846
|
+
"insertText": ".orElseGet(() -> ${1:defaultSupplier})",
|
|
847
|
+
"insertTextRules": 4,
|
|
848
|
+
"sortText": "05_orelseget"
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
"label": ".orElseThrow()",
|
|
852
|
+
"kind": 1,
|
|
853
|
+
"detail": "Get value or throw exception",
|
|
854
|
+
"documentation": { "value": "Returns the value if present, otherwise throws an exception produced by the supplier.\n\n```java\nString name = opt.orElseThrow(() -> new NoSuchElementException(\"Not found\"));\nString val = opt.orElseThrow();\n```" },
|
|
855
|
+
"insertText": ".orElseThrow(() -> new ${1:RuntimeException}(${2:\"message\"}))",
|
|
856
|
+
"insertTextRules": 4,
|
|
857
|
+
"sortText": "05_orelsethrow"
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
"label": ".ifPresent()",
|
|
861
|
+
"kind": 1,
|
|
862
|
+
"detail": "Execute action if value present",
|
|
863
|
+
"documentation": { "value": "If a value is present, performs the given action with the value.\n\n```java\nopt.ifPresent(System.out::println);\nopt.ifPresent(val -> process(val));\n```" },
|
|
864
|
+
"insertText": ".ifPresent(${1:value} -> ${2:action})",
|
|
865
|
+
"insertTextRules": 4,
|
|
866
|
+
"sortText": "05_ifpresent"
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"label": "Thread",
|
|
870
|
+
"kind": 7,
|
|
871
|
+
"detail": "Create a new thread",
|
|
872
|
+
"documentation": { "value": "Creates and starts a new thread of execution.\n\n```java\nThread t = new Thread(() -> {\n System.out.println(\"Running in thread\");\n});\nt.start();\n```" },
|
|
873
|
+
"insertText": "new Thread(() -> {\n\t${1}\n}).start();",
|
|
874
|
+
"insertTextRules": 4,
|
|
875
|
+
"sortText": "06_thread"
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
"label": "Runnable",
|
|
879
|
+
"kind": 7,
|
|
880
|
+
"detail": "Runnable functional interface",
|
|
881
|
+
"documentation": { "value": "A functional interface for tasks that can be executed by a thread.\n\n```java\nRunnable task = () -> System.out.println(\"task\");\nnew Thread(task).start();\n```" },
|
|
882
|
+
"insertText": "Runnable ${1:task} = () -> {\n\t${2}\n};",
|
|
883
|
+
"insertTextRules": 4,
|
|
884
|
+
"sortText": "06_runnable"
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
"label": "CompletableFuture",
|
|
888
|
+
"kind": 7,
|
|
889
|
+
"detail": "Asynchronous computation",
|
|
890
|
+
"documentation": { "value": "A Future that can be explicitly completed, composed, and combined for asynchronous programming.\n\n```java\nCompletableFuture.supplyAsync(() -> fetchData())\n .thenApply(data -> process(data))\n .thenAccept(result -> System.out.println(result));\n```" },
|
|
891
|
+
"insertText": "CompletableFuture.supplyAsync(() -> ${1:value})",
|
|
892
|
+
"insertTextRules": 4,
|
|
893
|
+
"sortText": "06_completablefuture"
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
"label": "ExecutorService",
|
|
897
|
+
"kind": 7,
|
|
898
|
+
"detail": "Thread pool executor",
|
|
899
|
+
"documentation": { "value": "Manages a pool of threads for executing tasks.\n\n```java\nExecutorService executor = Executors.newFixedThreadPool(4);\nexecutor.submit(() -> doWork());\nexecutor.shutdown();\n```" },
|
|
900
|
+
"insertText": "ExecutorService ${1:executor} = Executors.newFixedThreadPool(${2:4});",
|
|
901
|
+
"insertTextRules": 4,
|
|
902
|
+
"sortText": "06_executorservice"
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
"label": "Executors.newFixedThreadPool",
|
|
906
|
+
"kind": 1,
|
|
907
|
+
"detail": "Create fixed-size thread pool",
|
|
908
|
+
"documentation": { "value": "Creates a thread pool that reuses a fixed number of threads.\n\n```java\nExecutorService pool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());\n```" },
|
|
909
|
+
"insertText": "Executors.newFixedThreadPool(${1:nThreads})",
|
|
910
|
+
"insertTextRules": 4,
|
|
911
|
+
"sortText": "06_executors_fixed"
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
"label": "Future",
|
|
915
|
+
"kind": 7,
|
|
916
|
+
"detail": "Future result of async computation",
|
|
917
|
+
"documentation": { "value": "Represents the result of an asynchronous computation. Use get() to retrieve the result.\n\n```java\nFuture<String> future = executor.submit(() -> compute());\nString result = future.get();\n```" },
|
|
918
|
+
"insertText": "Future<${1:Type}> ${2:future} = ${3:executor}.submit(() -> ${4:value});",
|
|
919
|
+
"insertTextRules": 4,
|
|
920
|
+
"sortText": "06_future"
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"label": "Callable",
|
|
924
|
+
"kind": 7,
|
|
925
|
+
"detail": "Callable task returning a result",
|
|
926
|
+
"documentation": { "value": "A task that returns a result and may throw an exception. Like Runnable but with a return value.\n\n```java\nCallable<Integer> task = () -> {\n return computeValue();\n};\nFuture<Integer> future = executor.submit(task);\n```" },
|
|
927
|
+
"insertText": "Callable<${1:Type}> ${2:task} = () -> {\n\treturn ${3:value};\n};",
|
|
928
|
+
"insertTextRules": 4,
|
|
929
|
+
"sortText": "06_callable"
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
"label": "Files.readString",
|
|
933
|
+
"kind": 1,
|
|
934
|
+
"detail": "Read file contents as String (Java 11+)",
|
|
935
|
+
"documentation": { "value": "Reads all content from a file into a string.\n\n```java\nString content = Files.readString(Path.of(\"file.txt\"));\nString data = Files.readString(path, StandardCharsets.UTF_8);\n```" },
|
|
936
|
+
"insertText": "Files.readString(Path.of(\"${1:file.txt}\"))",
|
|
937
|
+
"insertTextRules": 4,
|
|
938
|
+
"sortText": "07_files_readstring"
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
"label": "Files.writeString",
|
|
942
|
+
"kind": 1,
|
|
943
|
+
"detail": "Write String to file (Java 11+)",
|
|
944
|
+
"documentation": { "value": "Writes a CharSequence to a file.\n\n```java\nFiles.writeString(Path.of(\"output.txt\"), content);\nFiles.writeString(path, data, StandardOpenOption.APPEND);\n```" },
|
|
945
|
+
"insertText": "Files.writeString(Path.of(\"${1:file.txt}\"), ${2:content})",
|
|
946
|
+
"insertTextRules": 4,
|
|
947
|
+
"sortText": "07_files_writestring"
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
"label": "Files.readAllLines",
|
|
951
|
+
"kind": 1,
|
|
952
|
+
"detail": "Read all lines from a file",
|
|
953
|
+
"documentation": { "value": "Reads all lines from a file as a List of Strings.\n\n```java\nList<String> lines = Files.readAllLines(Path.of(\"data.txt\"));\n```" },
|
|
954
|
+
"insertText": "Files.readAllLines(Path.of(\"${1:file.txt}\"))",
|
|
955
|
+
"insertTextRules": 4,
|
|
956
|
+
"sortText": "07_files_readalllines"
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
"label": "Path.of",
|
|
960
|
+
"kind": 1,
|
|
961
|
+
"detail": "Create a Path instance (Java 11+)",
|
|
962
|
+
"documentation": { "value": "Returns a Path by converting a path string or URI.\n\n```java\nPath p = Path.of(\"src\", \"main\", \"java\");\nPath file = Path.of(\"/tmp/data.txt\");\n```" },
|
|
963
|
+
"insertText": "Path.of(\"${1:path}\")",
|
|
964
|
+
"insertTextRules": 4,
|
|
965
|
+
"sortText": "07_path_of"
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
"label": "BufferedReader",
|
|
969
|
+
"kind": 7,
|
|
970
|
+
"detail": "Buffered character-input stream reader",
|
|
971
|
+
"documentation": { "value": "Reads text from a character-input stream with buffering for efficient reading.\n\n```java\ntry (var reader = new BufferedReader(new FileReader(\"file.txt\"))) {\n String line;\n while ((line = reader.readLine()) != null) {\n System.out.println(line);\n }\n}\n```" },
|
|
972
|
+
"insertText": "new BufferedReader(new FileReader(\"${1:file.txt}\"))",
|
|
973
|
+
"insertTextRules": 4,
|
|
974
|
+
"sortText": "07_bufferedreader"
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
"label": "Scanner",
|
|
978
|
+
"kind": 7,
|
|
979
|
+
"detail": "Simple text scanner",
|
|
980
|
+
"documentation": { "value": "A simple text scanner for parsing primitive types and strings using regular expressions.\n\n```java\nScanner scanner = new Scanner(System.in);\nString name = scanner.nextLine();\nint num = scanner.nextInt();\nscanner.close();\n```" },
|
|
981
|
+
"insertText": "new Scanner(${1:System.in})",
|
|
982
|
+
"insertTextRules": 4,
|
|
983
|
+
"sortText": "07_scanner"
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"label": "Math.max",
|
|
987
|
+
"kind": 1,
|
|
988
|
+
"detail": "Return the greater of two values",
|
|
989
|
+
"documentation": { "value": "Returns the greater of two values.\n\n```java\nint max = Math.max(a, b);\ndouble bigger = Math.max(3.14, 2.71);\n```" },
|
|
990
|
+
"insertText": "Math.max(${1:a}, ${2:b})",
|
|
991
|
+
"insertTextRules": 4,
|
|
992
|
+
"sortText": "08_math_max"
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
"label": "Math.min",
|
|
996
|
+
"kind": 1,
|
|
997
|
+
"detail": "Return the smaller of two values",
|
|
998
|
+
"documentation": { "value": "Returns the smaller of two values.\n\n```java\nint min = Math.min(a, b);\n```" },
|
|
999
|
+
"insertText": "Math.min(${1:a}, ${2:b})",
|
|
1000
|
+
"insertTextRules": 4,
|
|
1001
|
+
"sortText": "08_math_min"
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
"label": "Math.abs",
|
|
1005
|
+
"kind": 1,
|
|
1006
|
+
"detail": "Return absolute value",
|
|
1007
|
+
"documentation": { "value": "Returns the absolute value of the argument.\n\n```java\nint pos = Math.abs(-5); // 5\ndouble d = Math.abs(-3.14); // 3.14\n```" },
|
|
1008
|
+
"insertText": "Math.abs(${1:value})",
|
|
1009
|
+
"insertTextRules": 4,
|
|
1010
|
+
"sortText": "08_math_abs"
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
"label": "Math.sqrt",
|
|
1014
|
+
"kind": 1,
|
|
1015
|
+
"detail": "Return square root",
|
|
1016
|
+
"documentation": { "value": "Returns the correctly rounded positive square root of a double value.\n\n```java\ndouble root = Math.sqrt(16); // 4.0\n```" },
|
|
1017
|
+
"insertText": "Math.sqrt(${1:value})",
|
|
1018
|
+
"insertTextRules": 4,
|
|
1019
|
+
"sortText": "08_math_sqrt"
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
"label": "Math.pow",
|
|
1023
|
+
"kind": 1,
|
|
1024
|
+
"detail": "Return base raised to exponent",
|
|
1025
|
+
"documentation": { "value": "Returns the value of the first argument raised to the power of the second argument.\n\n```java\ndouble result = Math.pow(2, 10); // 1024.0\n```" },
|
|
1026
|
+
"insertText": "Math.pow(${1:base}, ${2:exponent})",
|
|
1027
|
+
"insertTextRules": 4,
|
|
1028
|
+
"sortText": "08_math_pow"
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
"label": "Math.random",
|
|
1032
|
+
"kind": 1,
|
|
1033
|
+
"detail": "Return random double [0.0, 1.0)",
|
|
1034
|
+
"documentation": { "value": "Returns a random double value between 0.0 (inclusive) and 1.0 (exclusive).\n\n```java\ndouble r = Math.random();\nint dice = (int)(Math.random() * 6) + 1;\n```" },
|
|
1035
|
+
"insertText": "Math.random()",
|
|
1036
|
+
"insertTextRules": 0,
|
|
1037
|
+
"sortText": "08_math_random"
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
"label": "Integer.parseInt",
|
|
1041
|
+
"kind": 1,
|
|
1042
|
+
"detail": "Parse string to int",
|
|
1043
|
+
"documentation": { "value": "Parses the string argument as a signed decimal integer.\n\n```java\nint num = Integer.parseInt(\"42\");\nint hex = Integer.parseInt(\"FF\", 16);\n```" },
|
|
1044
|
+
"insertText": "Integer.parseInt(${1:str})",
|
|
1045
|
+
"insertTextRules": 4,
|
|
1046
|
+
"sortText": "08_integer_parseint"
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
"label": "Integer.valueOf",
|
|
1050
|
+
"kind": 1,
|
|
1051
|
+
"detail": "Parse string to Integer object",
|
|
1052
|
+
"documentation": { "value": "Returns an Integer object holding the value of the specified String.\n\n```java\nInteger num = Integer.valueOf(\"42\");\nInteger cached = Integer.valueOf(127); // uses cache\n```" },
|
|
1053
|
+
"insertText": "Integer.valueOf(${1:str})",
|
|
1054
|
+
"insertTextRules": 4,
|
|
1055
|
+
"sortText": "08_integer_valueof"
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
"label": "Double.parseDouble",
|
|
1059
|
+
"kind": 1,
|
|
1060
|
+
"detail": "Parse string to double",
|
|
1061
|
+
"documentation": { "value": "Returns a new double initialized to the value represented by the specified String.\n\n```java\ndouble d = Double.parseDouble(\"3.14\");\n```" },
|
|
1062
|
+
"insertText": "Double.parseDouble(${1:str})",
|
|
1063
|
+
"insertTextRules": 4,
|
|
1064
|
+
"sortText": "08_double_parsedouble"
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
"label": "Objects.requireNonNull",
|
|
1068
|
+
"kind": 1,
|
|
1069
|
+
"detail": "Check for null with message",
|
|
1070
|
+
"documentation": { "value": "Checks that the specified object reference is not null, throws NullPointerException if it is.\n\n```java\nthis.name = Objects.requireNonNull(name, \"name must not be null\");\n```" },
|
|
1071
|
+
"insertText": "Objects.requireNonNull(${1:obj}, \"${2:message}\")",
|
|
1072
|
+
"insertTextRules": 4,
|
|
1073
|
+
"sortText": "08_objects_requirenonnull"
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
"label": "Objects.equals",
|
|
1077
|
+
"kind": 1,
|
|
1078
|
+
"detail": "Null-safe equality check",
|
|
1079
|
+
"documentation": { "value": "Returns true if the arguments are equal to each other and false otherwise. Handles null safely.\n\n```java\nboolean eq = Objects.equals(a, b);\nif (Objects.equals(name, \"admin\")) { }\n```" },
|
|
1080
|
+
"insertText": "Objects.equals(${1:a}, ${2:b})",
|
|
1081
|
+
"insertTextRules": 4,
|
|
1082
|
+
"sortText": "08_objects_equals"
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
"label": "public static void main",
|
|
1086
|
+
"kind": 1,
|
|
1087
|
+
"detail": "Main method entry point",
|
|
1088
|
+
"documentation": { "value": "The entry point for a Java application.\n\n```java\npublic static void main(String[] args) {\n System.out.println(\"Hello, World!\");\n}\n```" },
|
|
1089
|
+
"insertText": "public static void main(String[] args) {\n\t${0}\n}",
|
|
1090
|
+
"insertTextRules": 4,
|
|
1091
|
+
"sortText": "00_main"
|
|
1092
|
+
},
|
|
1093
|
+
{
|
|
1094
|
+
"label": "for-each loop",
|
|
1095
|
+
"kind": 14,
|
|
1096
|
+
"detail": "Enhanced for loop",
|
|
1097
|
+
"documentation": { "value": "Iterates over each element of an array or Iterable.\n\n```java\nfor (String item : list) {\n System.out.println(item);\n}\n```" },
|
|
1098
|
+
"insertText": "for (${1:Type} ${2:item} : ${3:collection}) {\n\t${0}\n}",
|
|
1099
|
+
"insertTextRules": 4,
|
|
1100
|
+
"sortText": "01_foreach_loop"
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
"label": "for loop",
|
|
1104
|
+
"kind": 14,
|
|
1105
|
+
"detail": "Classic for loop",
|
|
1106
|
+
"documentation": { "value": "A traditional index-based for loop.\n\n```java\nfor (int i = 0; i < n; i++) {\n System.out.println(i);\n}\n```" },
|
|
1107
|
+
"insertText": "for (int ${1:i} = 0; ${1:i} < ${2:n}; ${1:i}++) {\n\t${0}\n}",
|
|
1108
|
+
"insertTextRules": 4,
|
|
1109
|
+
"sortText": "01_for_loop"
|
|
1110
|
+
}
|
|
1111
|
+
]
|
|
1112
|
+
}
|