@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,860 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "csharp",
|
|
3
|
+
"completions": [
|
|
4
|
+
{
|
|
5
|
+
"label": "Console.WriteLine",
|
|
6
|
+
"kind": 0,
|
|
7
|
+
"detail": "Write line to standard output",
|
|
8
|
+
"documentation": { "value": "Writes the specified data followed by a newline to the standard output stream.\n\n```csharp\nConsole.WriteLine(\"Hello, World!\");\nConsole.WriteLine($\"Value: {x}\");\nConsole.WriteLine(\"{0} + {1} = {2}\", a, b, a+b);\n```" },
|
|
9
|
+
"insertText": "Console.WriteLine(${1:value})",
|
|
10
|
+
"insertTextRules": 4,
|
|
11
|
+
"sortText": "00_writeline"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"label": "Console.Write",
|
|
15
|
+
"kind": 0,
|
|
16
|
+
"detail": "Write to standard output without newline",
|
|
17
|
+
"documentation": { "value": "Writes the specified data to the standard output stream without a trailing newline.\n\n```csharp\nConsole.Write(\"Enter name: \");\nConsole.Write($\"{item}, \");\n```" },
|
|
18
|
+
"insertText": "Console.Write(${1:value})",
|
|
19
|
+
"insertTextRules": 4,
|
|
20
|
+
"sortText": "00_write"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"label": "Console.ReadLine",
|
|
24
|
+
"kind": 0,
|
|
25
|
+
"detail": "Read line from standard input",
|
|
26
|
+
"documentation": { "value": "Reads the next line of characters from the standard input stream.\n\n```csharp\nstring? input = Console.ReadLine();\nvar name = Console.ReadLine() ?? \"\";\n```" },
|
|
27
|
+
"insertText": "Console.ReadLine()",
|
|
28
|
+
"insertTextRules": 4,
|
|
29
|
+
"sortText": "00_readline"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"label": "Console.ReadKey",
|
|
33
|
+
"kind": 0,
|
|
34
|
+
"detail": "Read a key press from input",
|
|
35
|
+
"documentation": { "value": "Obtains the next character or function key pressed by the user.\n\n```csharp\nConsoleKeyInfo key = Console.ReadKey();\nConsole.ReadKey(intercept: true); // don't display\nif (key.Key == ConsoleKey.Enter) { }\n```" },
|
|
36
|
+
"insertText": "Console.ReadKey(${1})",
|
|
37
|
+
"insertTextRules": 4,
|
|
38
|
+
"sortText": "00_readkey"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"label": "Debug.WriteLine",
|
|
42
|
+
"kind": 0,
|
|
43
|
+
"detail": "Write line to debug output",
|
|
44
|
+
"documentation": { "value": "Writes a message followed by a line terminator to the trace listeners in the Listeners collection.\n\n```csharp\nDebug.WriteLine(\"Entering method\");\nDebug.WriteLine($\"Value: {x}\");\n```" },
|
|
45
|
+
"insertText": "Debug.WriteLine(${1:message})",
|
|
46
|
+
"insertTextRules": 4,
|
|
47
|
+
"sortText": "00_debug_writeline"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"label": "class",
|
|
51
|
+
"kind": 17,
|
|
52
|
+
"detail": "Declare a class",
|
|
53
|
+
"documentation": { "value": "Declares a reference type that supports inheritance, polymorphism, and encapsulation.\n\n```csharp\npublic class MyClass\n{\n public string Name { get; set; }\n public void DoWork() { }\n}\n```" },
|
|
54
|
+
"insertText": "${1:public} class ${2:MyClass}\n{\n $0\n}",
|
|
55
|
+
"insertTextRules": 4,
|
|
56
|
+
"sortText": "01_class"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"label": "struct",
|
|
60
|
+
"kind": 17,
|
|
61
|
+
"detail": "Declare a struct",
|
|
62
|
+
"documentation": { "value": "Declares a value type that can encapsulate data and related functionality.\n\n```csharp\npublic struct Point\n{\n public double X { get; set; }\n public double Y { get; set; }\n}\n```" },
|
|
63
|
+
"insertText": "${1:public} struct ${2:MyStruct}\n{\n $0\n}",
|
|
64
|
+
"insertTextRules": 4,
|
|
65
|
+
"sortText": "01_struct"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"label": "record",
|
|
69
|
+
"kind": 17,
|
|
70
|
+
"detail": "Declare a record type",
|
|
71
|
+
"documentation": { "value": "Declares a reference type with value-based equality, immutability support, and concise syntax.\n\n```csharp\npublic record Person(string Name, int Age);\npublic record class Employee(string Name, string Department);\npublic record struct Point(double X, double Y);\n```" },
|
|
72
|
+
"insertText": "public record ${1:Name}(${2:string Property})",
|
|
73
|
+
"insertTextRules": 4,
|
|
74
|
+
"sortText": "01_record"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"label": "interface",
|
|
78
|
+
"kind": 17,
|
|
79
|
+
"detail": "Declare an interface",
|
|
80
|
+
"documentation": { "value": "Declares an interface that defines a contract for classes and structs.\n\n```csharp\npublic interface IRepository<T>\n{\n T GetById(int id);\n IEnumerable<T> GetAll();\n void Add(T entity);\n}\n```" },
|
|
81
|
+
"insertText": "${1:public} interface ${2:IMyInterface}\n{\n $0\n}",
|
|
82
|
+
"insertTextRules": 4,
|
|
83
|
+
"sortText": "01_interface"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"label": "enum",
|
|
87
|
+
"kind": 17,
|
|
88
|
+
"detail": "Declare an enumeration",
|
|
89
|
+
"documentation": { "value": "Declares an enumeration type consisting of a set of named constants.\n\n```csharp\npublic enum Status\n{\n Active,\n Inactive,\n Pending\n}\n```" },
|
|
90
|
+
"insertText": "${1:public} enum ${2:MyEnum}\n{\n ${3:Value1},\n ${4:Value2}\n}",
|
|
91
|
+
"insertTextRules": 4,
|
|
92
|
+
"sortText": "01_enum"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"label": "namespace",
|
|
96
|
+
"kind": 17,
|
|
97
|
+
"detail": "Declare a namespace",
|
|
98
|
+
"documentation": { "value": "Declares a scope for organizing code and controlling type visibility.\n\n```csharp\nnamespace MyApp.Models\n{\n public class User { }\n}\n```" },
|
|
99
|
+
"insertText": "namespace ${1:MyNamespace}\n{\n $0\n}",
|
|
100
|
+
"insertTextRules": 4,
|
|
101
|
+
"sortText": "01_namespace"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"label": "file-scoped namespace",
|
|
105
|
+
"kind": 17,
|
|
106
|
+
"detail": "File-scoped namespace declaration",
|
|
107
|
+
"documentation": { "value": "Declares a namespace that applies to the entire file without nesting braces.\n\n```csharp\nnamespace MyApp.Models;\n\npublic class User { }\npublic class Role { }\n```" },
|
|
108
|
+
"insertText": "namespace ${1:MyNamespace};",
|
|
109
|
+
"insertTextRules": 4,
|
|
110
|
+
"sortText": "01_namespace_filescoped"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"label": "using",
|
|
114
|
+
"kind": 17,
|
|
115
|
+
"detail": "Import namespace or create alias",
|
|
116
|
+
"documentation": { "value": "Imports types from a namespace or creates a type alias.\n\n```csharp\nusing System;\nusing System.Collections.Generic;\nusing static System.Math;\nusing Alias = System.Collections.Generic.List<int>;\n```" },
|
|
117
|
+
"insertText": "using ${1:System};",
|
|
118
|
+
"insertTextRules": 4,
|
|
119
|
+
"sortText": "01_using"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"label": "global using",
|
|
123
|
+
"kind": 17,
|
|
124
|
+
"detail": "Global using directive",
|
|
125
|
+
"documentation": { "value": "Applies a using directive to every source file in the project.\n\n```csharp\nglobal using System;\nglobal using System.Collections.Generic;\nglobal using static System.Math;\n```" },
|
|
126
|
+
"insertText": "global using ${1:System};",
|
|
127
|
+
"insertTextRules": 4,
|
|
128
|
+
"sortText": "01_global_using"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"label": "async/await",
|
|
132
|
+
"kind": 17,
|
|
133
|
+
"detail": "Asynchronous method pattern",
|
|
134
|
+
"documentation": { "value": "Marks a method as asynchronous and awaits the completion of tasks.\n\n```csharp\npublic async Task<string> FetchDataAsync()\n{\n var result = await httpClient.GetStringAsync(url);\n return result;\n}\n```" },
|
|
135
|
+
"insertText": "async ${1:Task<${2:string}>} ${3:MethodAsync}(${4})\n{\n ${5:var result = }await ${6:task};\n return ${7:result};\n}",
|
|
136
|
+
"insertTextRules": 4,
|
|
137
|
+
"sortText": "01_async_await"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"label": "var",
|
|
141
|
+
"kind": 17,
|
|
142
|
+
"detail": "Implicitly typed local variable",
|
|
143
|
+
"documentation": { "value": "Lets the compiler determine the type from the initializer expression.\n\n```csharp\nvar name = \"Alice\";\nvar numbers = new List<int> { 1, 2, 3 };\nvar result = await GetDataAsync();\n```" },
|
|
144
|
+
"insertText": "var ${1:name} = ${2:value};",
|
|
145
|
+
"insertTextRules": 4,
|
|
146
|
+
"sortText": "01_var"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"label": "new",
|
|
150
|
+
"kind": 17,
|
|
151
|
+
"detail": "Create a new instance",
|
|
152
|
+
"documentation": { "value": "Creates a new instance of a type. Supports target-typed new expressions (C# 9+).\n\n```csharp\nvar list = new List<int>();\nPerson p = new(\"Alice\", 30);\nvar dict = new Dictionary<string, int>();\n```" },
|
|
153
|
+
"insertText": "new ${1:Type}(${2})",
|
|
154
|
+
"insertTextRules": 4,
|
|
155
|
+
"sortText": "01_new"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"label": "yield return",
|
|
159
|
+
"kind": 17,
|
|
160
|
+
"detail": "Yield a value in an iterator",
|
|
161
|
+
"documentation": { "value": "Returns each element one at a time from an iterator method.\n\n```csharp\npublic IEnumerable<int> GetNumbers()\n{\n yield return 1;\n yield return 2;\n yield return 3;\n}\n```" },
|
|
162
|
+
"insertText": "yield return ${1:value};",
|
|
163
|
+
"insertTextRules": 4,
|
|
164
|
+
"sortText": "01_yield_return"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"label": "yield break",
|
|
168
|
+
"kind": 17,
|
|
169
|
+
"detail": "End an iterator",
|
|
170
|
+
"documentation": { "value": "Signals the end of iteration in an iterator method.\n\n```csharp\npublic IEnumerable<int> GetPositive(IEnumerable<int> items)\n{\n foreach (var item in items)\n {\n if (item < 0) yield break;\n yield return item;\n }\n}\n```" },
|
|
171
|
+
"insertText": "yield break;",
|
|
172
|
+
"insertTextRules": 4,
|
|
173
|
+
"sortText": "01_yield_break"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"label": "required",
|
|
177
|
+
"kind": 17,
|
|
178
|
+
"detail": "Required property modifier (C# 11)",
|
|
179
|
+
"documentation": { "value": "Indicates that a property or field must be set during object initialization.\n\n```csharp\npublic class Person\n{\n public required string Name { get; init; }\n public required int Age { get; init; }\n}\nvar p = new Person { Name = \"Alice\", Age = 30 };\n```" },
|
|
180
|
+
"insertText": "required ${1:string} ${2:Property} { get; init; }",
|
|
181
|
+
"insertTextRules": 4,
|
|
182
|
+
"sortText": "01_required"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"label": "init",
|
|
186
|
+
"kind": 17,
|
|
187
|
+
"detail": "Init-only property accessor (C# 9)",
|
|
188
|
+
"documentation": { "value": "Defines an init-only setter that can only be called during object construction or initialization.\n\n```csharp\npublic class Config\n{\n public string Name { get; init; }\n public int Value { get; init; }\n}\nvar c = new Config { Name = \"test\", Value = 42 };\n```" },
|
|
189
|
+
"insertText": "{ get; init; }",
|
|
190
|
+
"insertTextRules": 4,
|
|
191
|
+
"sortText": "01_init"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"label": "abstract class",
|
|
195
|
+
"kind": 17,
|
|
196
|
+
"detail": "Declare an abstract class",
|
|
197
|
+
"documentation": { "value": "Declares a class that cannot be instantiated directly and may contain abstract members.\n\n```csharp\npublic abstract class Shape\n{\n public abstract double Area();\n public virtual void Draw() { }\n}\n```" },
|
|
198
|
+
"insertText": "public abstract class ${1:MyClass}\n{\n ${2:public abstract ${3:void} ${4:Method}();}\n}",
|
|
199
|
+
"insertTextRules": 4,
|
|
200
|
+
"sortText": "01_abstract_class"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"label": "string.Format",
|
|
204
|
+
"kind": 0,
|
|
205
|
+
"detail": "Format a string with placeholders",
|
|
206
|
+
"documentation": { "value": "Replaces format items in a string with the string representations of corresponding objects.\n\n```csharp\nstring s = string.Format(\"{0} is {1} years old\", name, age);\nstring s2 = string.Format(\"{0:C2}\", price);\nstring s3 = string.Format(\"{0:D4}\", id);\n```" },
|
|
207
|
+
"insertText": "string.Format(\"${1:{0\\}}\", ${2:arg0})",
|
|
208
|
+
"insertTextRules": 4,
|
|
209
|
+
"sortText": "02_string_format"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"label": "string.Join",
|
|
213
|
+
"kind": 0,
|
|
214
|
+
"detail": "Join strings with separator",
|
|
215
|
+
"documentation": { "value": "Concatenates the elements of a collection, using the specified separator between each element.\n\n```csharp\nstring csv = string.Join(\", \", names);\nstring path = string.Join(\"/\", segments);\nstring line = string.Join(\"\\t\", values);\n```" },
|
|
216
|
+
"insertText": "string.Join(\"${1:, }\", ${2:values})",
|
|
217
|
+
"insertTextRules": 4,
|
|
218
|
+
"sortText": "02_string_join"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"label": "string.IsNullOrEmpty",
|
|
222
|
+
"kind": 0,
|
|
223
|
+
"detail": "Check if string is null or empty",
|
|
224
|
+
"documentation": { "value": "Indicates whether the specified string is null or an empty string (\"\").\n\n```csharp\nif (string.IsNullOrEmpty(input))\n return default;\n```" },
|
|
225
|
+
"insertText": "string.IsNullOrEmpty(${1:value})",
|
|
226
|
+
"insertTextRules": 4,
|
|
227
|
+
"sortText": "02_string_isnullorempty"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"label": "string.IsNullOrWhiteSpace",
|
|
231
|
+
"kind": 0,
|
|
232
|
+
"detail": "Check if string is null, empty, or whitespace",
|
|
233
|
+
"documentation": { "value": "Indicates whether a specified string is null, empty, or consists only of white-space characters.\n\n```csharp\nif (string.IsNullOrWhiteSpace(input))\n throw new ArgumentException(\"Input required\");\n```" },
|
|
234
|
+
"insertText": "string.IsNullOrWhiteSpace(${1:value})",
|
|
235
|
+
"insertTextRules": 4,
|
|
236
|
+
"sortText": "02_string_isnullorwhitespace"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"label": "string.Concat",
|
|
240
|
+
"kind": 0,
|
|
241
|
+
"detail": "Concatenate strings",
|
|
242
|
+
"documentation": { "value": "Concatenates one or more instances of String, or the String representations of the values of one or more objects.\n\n```csharp\nstring result = string.Concat(\"Hello\", \" \", \"World\");\nstring all = string.Concat(names);\n```" },
|
|
243
|
+
"insertText": "string.Concat(${1:str0}, ${2:str1})",
|
|
244
|
+
"insertTextRules": 4,
|
|
245
|
+
"sortText": "02_string_concat"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"label": "string.Compare",
|
|
249
|
+
"kind": 0,
|
|
250
|
+
"detail": "Compare two strings",
|
|
251
|
+
"documentation": { "value": "Compares two specified String objects and returns an integer that indicates their relative position in the sort order.\n\n```csharp\nint cmp = string.Compare(a, b, StringComparison.OrdinalIgnoreCase);\nif (string.Compare(s1, s2) == 0) { }\n```" },
|
|
252
|
+
"insertText": "string.Compare(${1:strA}, ${2:strB}, ${3:StringComparison.OrdinalIgnoreCase})",
|
|
253
|
+
"insertTextRules": 4,
|
|
254
|
+
"sortText": "02_string_compare"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"label": "$\"interpolation\"",
|
|
258
|
+
"kind": 27,
|
|
259
|
+
"detail": "String interpolation expression",
|
|
260
|
+
"documentation": { "value": "Creates a formatted string using embedded expressions prefixed with $.\n\n```csharp\nstring msg = $\"Hello, {name}!\";\nstring info = $\"{item.Name}: {item.Price:C2}\";\nstring raw = $\"\"\"Value is {value}\"\"\";\n```" },
|
|
261
|
+
"insertText": "\\$\"${1:text} {${2:expression}}\"",
|
|
262
|
+
"insertTextRules": 4,
|
|
263
|
+
"sortText": "02_string_interpolation"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"label": ".Substring()",
|
|
267
|
+
"kind": 0,
|
|
268
|
+
"detail": "Extract a substring",
|
|
269
|
+
"documentation": { "value": "Retrieves a substring from this instance.\n\n```csharp\nstring sub = text.Substring(0, 5);\nstring rest = text.Substring(3);\n```" },
|
|
270
|
+
"insertText": ".Substring(${1:startIndex}, ${2:length})",
|
|
271
|
+
"insertTextRules": 4,
|
|
272
|
+
"sortText": "02_substring"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"label": ".Contains()",
|
|
276
|
+
"kind": 0,
|
|
277
|
+
"detail": "Check if string contains value",
|
|
278
|
+
"documentation": { "value": "Returns a value indicating whether a specified substring occurs within this string.\n\n```csharp\nbool found = text.Contains(\"search\");\nbool ci = text.Contains(\"SEARCH\", StringComparison.OrdinalIgnoreCase);\n```" },
|
|
279
|
+
"insertText": ".Contains(${1:value})",
|
|
280
|
+
"insertTextRules": 4,
|
|
281
|
+
"sortText": "02_contains"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"label": ".Replace()",
|
|
285
|
+
"kind": 0,
|
|
286
|
+
"detail": "Replace occurrences in a string",
|
|
287
|
+
"documentation": { "value": "Returns a new string in which all occurrences of a specified string are replaced.\n\n```csharp\nstring result = text.Replace(\"old\", \"new\");\nstring clean = input.Replace(\"\\n\", \" \");\n```" },
|
|
288
|
+
"insertText": ".Replace(${1:oldValue}, ${2:newValue})",
|
|
289
|
+
"insertTextRules": 4,
|
|
290
|
+
"sortText": "02_replace"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"label": ".Split()",
|
|
294
|
+
"kind": 0,
|
|
295
|
+
"detail": "Split a string into an array",
|
|
296
|
+
"documentation": { "value": "Splits a string into substrings based on specified delimiters.\n\n```csharp\nstring[] words = text.Split(' ');\nstring[] parts = csv.Split(',', StringSplitOptions.TrimEntries);\nstring[] lines = text.Split('\\n');\n```" },
|
|
297
|
+
"insertText": ".Split(${1:separator})",
|
|
298
|
+
"insertTextRules": 4,
|
|
299
|
+
"sortText": "02_split"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"label": "List<T>",
|
|
303
|
+
"kind": 5,
|
|
304
|
+
"detail": "Generic list collection",
|
|
305
|
+
"documentation": { "value": "Represents a strongly typed list of objects that can be accessed by index.\n\n```csharp\nvar list = new List<string> { \"a\", \"b\", \"c\" };\nlist.Add(\"d\");\nlist.Remove(\"b\");\nint count = list.Count;\n```" },
|
|
306
|
+
"insertText": "List<${1:T}>",
|
|
307
|
+
"insertTextRules": 4,
|
|
308
|
+
"sortText": "03_list"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"label": "new List<T>()",
|
|
312
|
+
"kind": 5,
|
|
313
|
+
"detail": "Create a new List",
|
|
314
|
+
"documentation": { "value": "Initializes a new instance of the List<T> class.\n\n```csharp\nvar items = new List<string>();\nvar numbers = new List<int> { 1, 2, 3 };\nvar sized = new List<double>(capacity: 100);\n```" },
|
|
315
|
+
"insertText": "new List<${1:T}>(${2})",
|
|
316
|
+
"insertTextRules": 4,
|
|
317
|
+
"sortText": "03_new_list"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"label": "Dictionary<TKey,TValue>",
|
|
321
|
+
"kind": 5,
|
|
322
|
+
"detail": "Generic dictionary collection",
|
|
323
|
+
"documentation": { "value": "Represents a collection of key/value pairs with fast key lookups.\n\n```csharp\nvar dict = new Dictionary<string, int>\n{\n [\"alice\"] = 1,\n [\"bob\"] = 2\n};\ndict.TryGetValue(\"alice\", out int val);\n```" },
|
|
324
|
+
"insertText": "Dictionary<${1:string}, ${2:int}>",
|
|
325
|
+
"insertTextRules": 4,
|
|
326
|
+
"sortText": "03_dictionary"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"label": "new Dictionary<TKey,TValue>()",
|
|
330
|
+
"kind": 5,
|
|
331
|
+
"detail": "Create a new Dictionary",
|
|
332
|
+
"documentation": { "value": "Initializes a new instance of the Dictionary<TKey,TValue> class.\n\n```csharp\nvar map = new Dictionary<string, int>();\nvar lookup = new Dictionary<int, string>(capacity: 50);\n```" },
|
|
333
|
+
"insertText": "new Dictionary<${1:string}, ${2:int}>(${3})",
|
|
334
|
+
"insertTextRules": 4,
|
|
335
|
+
"sortText": "03_new_dictionary"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"label": "HashSet<T>",
|
|
339
|
+
"kind": 5,
|
|
340
|
+
"detail": "Unordered set of unique elements",
|
|
341
|
+
"documentation": { "value": "Represents a set of values with O(1) lookups and no duplicates.\n\n```csharp\nvar set = new HashSet<string> { \"a\", \"b\", \"c\" };\nset.Add(\"d\");\nbool exists = set.Contains(\"a\");\nset.UnionWith(otherSet);\n```" },
|
|
342
|
+
"insertText": "HashSet<${1:T}>",
|
|
343
|
+
"insertTextRules": 4,
|
|
344
|
+
"sortText": "03_hashset"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"label": "Queue<T>",
|
|
348
|
+
"kind": 5,
|
|
349
|
+
"detail": "First-in, first-out collection",
|
|
350
|
+
"documentation": { "value": "Represents a first-in, first-out (FIFO) collection of objects.\n\n```csharp\nvar queue = new Queue<string>();\nqueue.Enqueue(\"first\");\nstring next = queue.Dequeue();\nstring peek = queue.Peek();\n```" },
|
|
351
|
+
"insertText": "Queue<${1:T}>",
|
|
352
|
+
"insertTextRules": 4,
|
|
353
|
+
"sortText": "03_queue"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"label": "Stack<T>",
|
|
357
|
+
"kind": 5,
|
|
358
|
+
"detail": "Last-in, first-out collection",
|
|
359
|
+
"documentation": { "value": "Represents a last-in, first-out (LIFO) collection of objects.\n\n```csharp\nvar stack = new Stack<int>();\nstack.Push(1);\nint top = stack.Pop();\nint peek = stack.Peek();\n```" },
|
|
360
|
+
"insertText": "Stack<${1:T}>",
|
|
361
|
+
"insertTextRules": 4,
|
|
362
|
+
"sortText": "03_stack"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"label": ".Where()",
|
|
366
|
+
"kind": 0,
|
|
367
|
+
"detail": "LINQ: Filter elements",
|
|
368
|
+
"documentation": { "value": "Filters a sequence of values based on a predicate.\n\n```csharp\nvar adults = people.Where(p => p.Age >= 18);\nvar evens = numbers.Where(n => n % 2 == 0);\nvar active = items.Where(i => i.IsActive);\n```" },
|
|
369
|
+
"insertText": ".Where(${1:x} => ${2:condition})",
|
|
370
|
+
"insertTextRules": 4,
|
|
371
|
+
"sortText": "04_where"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"label": ".Select()",
|
|
375
|
+
"kind": 0,
|
|
376
|
+
"detail": "LINQ: Project elements",
|
|
377
|
+
"documentation": { "value": "Projects each element of a sequence into a new form.\n\n```csharp\nvar names = people.Select(p => p.Name);\nvar dtos = items.Select(i => new ItemDto(i.Id, i.Name));\nvar indexed = list.Select((item, i) => $\"{i}: {item}\");\n```" },
|
|
378
|
+
"insertText": ".Select(${1:x} => ${2:x.Property})",
|
|
379
|
+
"insertTextRules": 4,
|
|
380
|
+
"sortText": "04_select"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"label": ".SelectMany()",
|
|
384
|
+
"kind": 0,
|
|
385
|
+
"detail": "LINQ: Flatten nested sequences",
|
|
386
|
+
"documentation": { "value": "Projects each element to a sequence and flattens the resulting sequences into one.\n\n```csharp\nvar allOrders = customers.SelectMany(c => c.Orders);\nvar chars = words.SelectMany(w => w.ToCharArray());\n```" },
|
|
387
|
+
"insertText": ".SelectMany(${1:x} => ${2:x.Items})",
|
|
388
|
+
"insertTextRules": 4,
|
|
389
|
+
"sortText": "04_selectmany"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"label": ".OrderBy()",
|
|
393
|
+
"kind": 0,
|
|
394
|
+
"detail": "LINQ: Sort ascending",
|
|
395
|
+
"documentation": { "value": "Sorts the elements of a sequence in ascending order according to a key.\n\n```csharp\nvar sorted = people.OrderBy(p => p.Name);\nvar byAge = people.OrderBy(p => p.Age).ThenBy(p => p.Name);\n```" },
|
|
396
|
+
"insertText": ".OrderBy(${1:x} => ${2:x.Property})",
|
|
397
|
+
"insertTextRules": 4,
|
|
398
|
+
"sortText": "04_orderby"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"label": ".OrderByDescending()",
|
|
402
|
+
"kind": 0,
|
|
403
|
+
"detail": "LINQ: Sort descending",
|
|
404
|
+
"documentation": { "value": "Sorts the elements of a sequence in descending order according to a key.\n\n```csharp\nvar newest = items.OrderByDescending(i => i.CreatedAt);\nvar topScores = scores.OrderByDescending(s => s);\n```" },
|
|
405
|
+
"insertText": ".OrderByDescending(${1:x} => ${2:x.Property})",
|
|
406
|
+
"insertTextRules": 4,
|
|
407
|
+
"sortText": "04_orderbydescending"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"label": ".GroupBy()",
|
|
411
|
+
"kind": 0,
|
|
412
|
+
"detail": "LINQ: Group elements by key",
|
|
413
|
+
"documentation": { "value": "Groups the elements of a sequence according to a specified key selector function.\n\n```csharp\nvar groups = people.GroupBy(p => p.Department);\nforeach (var g in groups)\n Console.WriteLine($\"{g.Key}: {g.Count()}\");\n```" },
|
|
414
|
+
"insertText": ".GroupBy(${1:x} => ${2:x.Key})",
|
|
415
|
+
"insertTextRules": 4,
|
|
416
|
+
"sortText": "04_groupby"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"label": ".Join()",
|
|
420
|
+
"kind": 0,
|
|
421
|
+
"detail": "LINQ: Inner join two sequences",
|
|
422
|
+
"documentation": { "value": "Correlates elements of two sequences based on matching keys.\n\n```csharp\nvar result = orders.Join(customers,\n o => o.CustomerId,\n c => c.Id,\n (o, c) => new { o.OrderId, c.Name });\n```" },
|
|
423
|
+
"insertText": ".Join(${1:inner}, ${2:outerKey} => ${3:outerKey.Id}, ${4:innerKey} => ${5:innerKey.Id}, (${6:o}, ${7:i}) => new { ${8} })",
|
|
424
|
+
"insertTextRules": 4,
|
|
425
|
+
"sortText": "04_join"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"label": ".First()",
|
|
429
|
+
"kind": 0,
|
|
430
|
+
"detail": "LINQ: Get first element",
|
|
431
|
+
"documentation": { "value": "Returns the first element of a sequence. Throws InvalidOperationException if no elements.\n\n```csharp\nvar first = items.First();\nvar match = items.First(x => x.IsValid);\n```" },
|
|
432
|
+
"insertText": ".First(${1})",
|
|
433
|
+
"insertTextRules": 4,
|
|
434
|
+
"sortText": "04_first"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"label": ".FirstOrDefault()",
|
|
438
|
+
"kind": 0,
|
|
439
|
+
"detail": "LINQ: Get first element or default",
|
|
440
|
+
"documentation": { "value": "Returns the first element, or a default value if no element is found.\n\n```csharp\nvar item = items.FirstOrDefault();\nvar match = items.FirstOrDefault(x => x.Id == id);\nvar safe = items.FirstOrDefault(x => x.Id == id, fallback);\n```" },
|
|
441
|
+
"insertText": ".FirstOrDefault(${1})",
|
|
442
|
+
"insertTextRules": 4,
|
|
443
|
+
"sortText": "04_firstordefault"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"label": ".Single()",
|
|
447
|
+
"kind": 0,
|
|
448
|
+
"detail": "LINQ: Get the only element",
|
|
449
|
+
"documentation": { "value": "Returns the only element of a sequence. Throws if there is not exactly one element.\n\n```csharp\nvar only = items.Single();\nvar match = items.Single(x => x.Id == id);\n```" },
|
|
450
|
+
"insertText": ".Single(${1})",
|
|
451
|
+
"insertTextRules": 4,
|
|
452
|
+
"sortText": "04_single"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"label": ".SingleOrDefault()",
|
|
456
|
+
"kind": 0,
|
|
457
|
+
"detail": "LINQ: Get the only element or default",
|
|
458
|
+
"documentation": { "value": "Returns the only element, or a default value if no elements exist. Throws if more than one element.\n\n```csharp\nvar item = items.SingleOrDefault(x => x.Id == id);\n```" },
|
|
459
|
+
"insertText": ".SingleOrDefault(${1})",
|
|
460
|
+
"insertTextRules": 4,
|
|
461
|
+
"sortText": "04_singleordefault"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"label": ".Any()",
|
|
465
|
+
"kind": 0,
|
|
466
|
+
"detail": "LINQ: Check if any elements match",
|
|
467
|
+
"documentation": { "value": "Determines whether any element of a sequence satisfies a condition.\n\n```csharp\nbool hasItems = list.Any();\nbool hasAdults = people.Any(p => p.Age >= 18);\n```" },
|
|
468
|
+
"insertText": ".Any(${1:x => condition})",
|
|
469
|
+
"insertTextRules": 4,
|
|
470
|
+
"sortText": "04_any"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"label": ".All()",
|
|
474
|
+
"kind": 0,
|
|
475
|
+
"detail": "LINQ: Check if all elements match",
|
|
476
|
+
"documentation": { "value": "Determines whether all elements of a sequence satisfy a condition.\n\n```csharp\nbool allValid = items.All(i => i.IsValid);\nbool allPositive = numbers.All(n => n > 0);\n```" },
|
|
477
|
+
"insertText": ".All(${1:x} => ${2:condition})",
|
|
478
|
+
"insertTextRules": 4,
|
|
479
|
+
"sortText": "04_all"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"label": ".Count()",
|
|
483
|
+
"kind": 0,
|
|
484
|
+
"detail": "LINQ: Count elements",
|
|
485
|
+
"documentation": { "value": "Returns the number of elements in a sequence, optionally filtered by a predicate.\n\n```csharp\nint total = items.Count();\nint active = items.Count(i => i.IsActive);\n```" },
|
|
486
|
+
"insertText": ".Count(${1})",
|
|
487
|
+
"insertTextRules": 4,
|
|
488
|
+
"sortText": "04_count"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"label": ".Sum()",
|
|
492
|
+
"kind": 0,
|
|
493
|
+
"detail": "LINQ: Sum numeric values",
|
|
494
|
+
"documentation": { "value": "Computes the sum of a sequence of numeric values.\n\n```csharp\nint total = numbers.Sum();\ndecimal revenue = orders.Sum(o => o.Amount);\n```" },
|
|
495
|
+
"insertText": ".Sum(${1:x => x.Value})",
|
|
496
|
+
"insertTextRules": 4,
|
|
497
|
+
"sortText": "04_sum"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"label": ".Average()",
|
|
501
|
+
"kind": 0,
|
|
502
|
+
"detail": "LINQ: Compute average",
|
|
503
|
+
"documentation": { "value": "Computes the average of a sequence of numeric values.\n\n```csharp\ndouble avg = scores.Average();\ndouble avgAge = people.Average(p => p.Age);\n```" },
|
|
504
|
+
"insertText": ".Average(${1:x => x.Value})",
|
|
505
|
+
"insertTextRules": 4,
|
|
506
|
+
"sortText": "04_average"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"label": ".Min()",
|
|
510
|
+
"kind": 0,
|
|
511
|
+
"detail": "LINQ: Find minimum value",
|
|
512
|
+
"documentation": { "value": "Returns the minimum value in a sequence.\n\n```csharp\nint min = numbers.Min();\nDateTime earliest = events.Min(e => e.Date);\n```" },
|
|
513
|
+
"insertText": ".Min(${1})",
|
|
514
|
+
"insertTextRules": 4,
|
|
515
|
+
"sortText": "04_min"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"label": ".Max()",
|
|
519
|
+
"kind": 0,
|
|
520
|
+
"detail": "LINQ: Find maximum value",
|
|
521
|
+
"documentation": { "value": "Returns the maximum value in a sequence.\n\n```csharp\nint max = numbers.Max();\ndecimal highest = products.Max(p => p.Price);\n```" },
|
|
522
|
+
"insertText": ".Max(${1})",
|
|
523
|
+
"insertTextRules": 4,
|
|
524
|
+
"sortText": "04_max"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"label": ".Aggregate()",
|
|
528
|
+
"kind": 0,
|
|
529
|
+
"detail": "LINQ: Apply accumulator function",
|
|
530
|
+
"documentation": { "value": "Applies an accumulator function over a sequence.\n\n```csharp\nint product = numbers.Aggregate((a, b) => a * b);\nstring sentence = words.Aggregate((a, b) => $\"{a} {b}\");\nint sum = numbers.Aggregate(0, (acc, n) => acc + n);\n```" },
|
|
531
|
+
"insertText": ".Aggregate(${1:seed}, (${2:acc}, ${3:x}) => ${4:acc + x})",
|
|
532
|
+
"insertTextRules": 4,
|
|
533
|
+
"sortText": "04_aggregate"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"label": ".Distinct()",
|
|
537
|
+
"kind": 0,
|
|
538
|
+
"detail": "LINQ: Remove duplicates",
|
|
539
|
+
"documentation": { "value": "Returns distinct elements from a sequence.\n\n```csharp\nvar unique = numbers.Distinct();\nvar uniqueNames = people.Select(p => p.Name).Distinct();\n```" },
|
|
540
|
+
"insertText": ".Distinct()",
|
|
541
|
+
"insertTextRules": 4,
|
|
542
|
+
"sortText": "04_distinct"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"label": ".Take()",
|
|
546
|
+
"kind": 0,
|
|
547
|
+
"detail": "LINQ: Take first N elements",
|
|
548
|
+
"documentation": { "value": "Returns a specified number of contiguous elements from the start of a sequence.\n\n```csharp\nvar top5 = items.Take(5);\nvar page = items.Skip(20).Take(10);\nvar range = items.Take(3..7);\n```" },
|
|
549
|
+
"insertText": ".Take(${1:count})",
|
|
550
|
+
"insertTextRules": 4,
|
|
551
|
+
"sortText": "04_take"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"label": ".Skip()",
|
|
555
|
+
"kind": 0,
|
|
556
|
+
"detail": "LINQ: Skip first N elements",
|
|
557
|
+
"documentation": { "value": "Bypasses a specified number of elements in a sequence and returns the remaining elements.\n\n```csharp\nvar rest = items.Skip(5);\nvar page2 = items.Skip(10).Take(10);\n```" },
|
|
558
|
+
"insertText": ".Skip(${1:count})",
|
|
559
|
+
"insertTextRules": 4,
|
|
560
|
+
"sortText": "04_skip"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"label": ".ToList()",
|
|
564
|
+
"kind": 0,
|
|
565
|
+
"detail": "LINQ: Materialize to List<T>",
|
|
566
|
+
"documentation": { "value": "Creates a List<T> from an IEnumerable<T>.\n\n```csharp\nvar list = query.ToList();\nvar names = people.Select(p => p.Name).ToList();\n```" },
|
|
567
|
+
"insertText": ".ToList()",
|
|
568
|
+
"insertTextRules": 4,
|
|
569
|
+
"sortText": "04_tolist"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"label": ".ToArray()",
|
|
573
|
+
"kind": 0,
|
|
574
|
+
"detail": "LINQ: Materialize to array",
|
|
575
|
+
"documentation": { "value": "Creates an array from an IEnumerable<T>.\n\n```csharp\nint[] arr = numbers.ToArray();\nstring[] names = people.Select(p => p.Name).ToArray();\n```" },
|
|
576
|
+
"insertText": ".ToArray()",
|
|
577
|
+
"insertTextRules": 4,
|
|
578
|
+
"sortText": "04_toarray"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"label": ".ToDictionary()",
|
|
582
|
+
"kind": 0,
|
|
583
|
+
"detail": "LINQ: Materialize to Dictionary",
|
|
584
|
+
"documentation": { "value": "Creates a Dictionary<TKey,TValue> from an IEnumerable<T>.\n\n```csharp\nvar dict = people.ToDictionary(p => p.Id, p => p.Name);\nvar lookup = items.ToDictionary(i => i.Key);\n```" },
|
|
585
|
+
"insertText": ".ToDictionary(${1:x} => ${2:x.Key}, ${3:x} => ${4:x.Value})",
|
|
586
|
+
"insertTextRules": 4,
|
|
587
|
+
"sortText": "04_todictionary"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"label": ".Concat()",
|
|
591
|
+
"kind": 0,
|
|
592
|
+
"detail": "LINQ: Concatenate two sequences",
|
|
593
|
+
"documentation": { "value": "Concatenates two sequences.\n\n```csharp\nvar all = first.Concat(second);\nvar combined = list1.Concat(list2).ToList();\n```" },
|
|
594
|
+
"insertText": ".Concat(${1:second})",
|
|
595
|
+
"insertTextRules": 4,
|
|
596
|
+
"sortText": "04_concat"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"label": ".Zip()",
|
|
600
|
+
"kind": 0,
|
|
601
|
+
"detail": "LINQ: Merge two sequences pairwise",
|
|
602
|
+
"documentation": { "value": "Produces a sequence of tuples from two sequences element-by-element.\n\n```csharp\nvar pairs = names.Zip(scores);\nvar results = names.Zip(scores, (n, s) => $\"{n}: {s}\");\n```" },
|
|
603
|
+
"insertText": ".Zip(${1:second})",
|
|
604
|
+
"insertTextRules": 4,
|
|
605
|
+
"sortText": "04_zip"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"label": "Task.Run",
|
|
609
|
+
"kind": 0,
|
|
610
|
+
"detail": "Queue work to thread pool",
|
|
611
|
+
"documentation": { "value": "Queues the specified work to run on the ThreadPool and returns a Task representing that work.\n\n```csharp\nawait Task.Run(() => HeavyComputation());\nvar result = await Task.Run(() => Calculate(x));\n```" },
|
|
612
|
+
"insertText": "Task.Run(${1:() => ${2:work}})",
|
|
613
|
+
"insertTextRules": 4,
|
|
614
|
+
"sortText": "05_task_run"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"label": "Task.WhenAll",
|
|
618
|
+
"kind": 0,
|
|
619
|
+
"detail": "Await multiple tasks concurrently",
|
|
620
|
+
"documentation": { "value": "Creates a task that will complete when all of the supplied tasks have completed.\n\n```csharp\nawait Task.WhenAll(task1, task2, task3);\nvar results = await Task.WhenAll(tasks);\n```" },
|
|
621
|
+
"insertText": "Task.WhenAll(${1:tasks})",
|
|
622
|
+
"insertTextRules": 4,
|
|
623
|
+
"sortText": "05_task_whenall"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"label": "Task.WhenAny",
|
|
627
|
+
"kind": 0,
|
|
628
|
+
"detail": "Await first completing task",
|
|
629
|
+
"documentation": { "value": "Creates a task that completes when any of the supplied tasks have completed.\n\n```csharp\nvar completed = await Task.WhenAny(task1, task2);\nif (completed == task1) { }\n```" },
|
|
630
|
+
"insertText": "Task.WhenAny(${1:tasks})",
|
|
631
|
+
"insertTextRules": 4,
|
|
632
|
+
"sortText": "05_task_whenany"
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
"label": "Task.Delay",
|
|
636
|
+
"kind": 0,
|
|
637
|
+
"detail": "Asynchronous delay",
|
|
638
|
+
"documentation": { "value": "Creates a task that completes after a specified time delay.\n\n```csharp\nawait Task.Delay(1000); // 1 second\nawait Task.Delay(TimeSpan.FromSeconds(5));\n```" },
|
|
639
|
+
"insertText": "Task.Delay(${1:millisecondsDelay})",
|
|
640
|
+
"insertTextRules": 4,
|
|
641
|
+
"sortText": "05_task_delay"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"label": "Task.FromResult",
|
|
645
|
+
"kind": 0,
|
|
646
|
+
"detail": "Create completed task with result",
|
|
647
|
+
"documentation": { "value": "Creates a Task<TResult> that is completed with the specified result.\n\n```csharp\nreturn Task.FromResult(42);\nreturn Task.FromResult<string?>(null);\n```" },
|
|
648
|
+
"insertText": "Task.FromResult(${1:result})",
|
|
649
|
+
"insertTextRules": 4,
|
|
650
|
+
"sortText": "05_task_fromresult"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"label": "async Task method",
|
|
654
|
+
"kind": 27,
|
|
655
|
+
"detail": "Async method declaration",
|
|
656
|
+
"documentation": { "value": "Declares an asynchronous method that returns a Task.\n\n```csharp\npublic async Task DoWorkAsync()\n{\n await Task.Delay(100);\n}\n\npublic async Task<int> GetValueAsync()\n{\n return await FetchAsync();\n}\n```" },
|
|
657
|
+
"insertText": "public async ${1:Task<${2:int}>} ${3:MethodAsync}(${4})\n{\n $0\n}",
|
|
658
|
+
"insertTextRules": 4,
|
|
659
|
+
"sortText": "05_async_method"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"label": "Math.Max",
|
|
663
|
+
"kind": 0,
|
|
664
|
+
"detail": "Return the larger of two values",
|
|
665
|
+
"documentation": { "value": "Returns the larger of two specified numbers.\n\n```csharp\nint bigger = Math.Max(a, b);\ndouble max = Math.Max(3.14, 2.72);\n```" },
|
|
666
|
+
"insertText": "Math.Max(${1:val1}, ${2:val2})",
|
|
667
|
+
"insertTextRules": 4,
|
|
668
|
+
"sortText": "06_math_max"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"label": "Math.Min",
|
|
672
|
+
"kind": 0,
|
|
673
|
+
"detail": "Return the smaller of two values",
|
|
674
|
+
"documentation": { "value": "Returns the smaller of two specified numbers.\n\n```csharp\nint smaller = Math.Min(a, b);\ndouble min = Math.Min(x, y);\n```" },
|
|
675
|
+
"insertText": "Math.Min(${1:val1}, ${2:val2})",
|
|
676
|
+
"insertTextRules": 4,
|
|
677
|
+
"sortText": "06_math_min"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"label": "Math.Abs",
|
|
681
|
+
"kind": 0,
|
|
682
|
+
"detail": "Return absolute value",
|
|
683
|
+
"documentation": { "value": "Returns the absolute value of a specified number.\n\n```csharp\nint abs = Math.Abs(-5); // 5\ndouble d = Math.Abs(-3.14); // 3.14\n```" },
|
|
684
|
+
"insertText": "Math.Abs(${1:value})",
|
|
685
|
+
"insertTextRules": 4,
|
|
686
|
+
"sortText": "06_math_abs"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"label": "Math.Sqrt",
|
|
690
|
+
"kind": 0,
|
|
691
|
+
"detail": "Return square root",
|
|
692
|
+
"documentation": { "value": "Returns the square root of a specified number.\n\n```csharp\ndouble root = Math.Sqrt(25); // 5.0\ndouble hyp = Math.Sqrt(a*a + b*b);\n```" },
|
|
693
|
+
"insertText": "Math.Sqrt(${1:value})",
|
|
694
|
+
"insertTextRules": 4,
|
|
695
|
+
"sortText": "06_math_sqrt"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"label": "Math.Pow",
|
|
699
|
+
"kind": 0,
|
|
700
|
+
"detail": "Return a number raised to a power",
|
|
701
|
+
"documentation": { "value": "Returns a specified number raised to the specified power.\n\n```csharp\ndouble result = Math.Pow(2, 10); // 1024\ndouble cube = Math.Pow(x, 3);\n```" },
|
|
702
|
+
"insertText": "Math.Pow(${1:x}, ${2:y})",
|
|
703
|
+
"insertTextRules": 4,
|
|
704
|
+
"sortText": "06_math_pow"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"label": "Math.Round",
|
|
708
|
+
"kind": 0,
|
|
709
|
+
"detail": "Round to nearest value",
|
|
710
|
+
"documentation": { "value": "Rounds a value to the nearest integer or specified number of decimal places.\n\n```csharp\ndouble r = Math.Round(3.456, 2); // 3.46\nint n = (int)Math.Round(3.7); // 4\n```" },
|
|
711
|
+
"insertText": "Math.Round(${1:value}, ${2:decimals})",
|
|
712
|
+
"insertTextRules": 4,
|
|
713
|
+
"sortText": "06_math_round"
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"label": "Math.Floor",
|
|
717
|
+
"kind": 0,
|
|
718
|
+
"detail": "Round down to nearest integer",
|
|
719
|
+
"documentation": { "value": "Returns the largest integral value less than or equal to the specified number.\n\n```csharp\ndouble f = Math.Floor(3.7); // 3.0\ndouble neg = Math.Floor(-3.2); // -4.0\n```" },
|
|
720
|
+
"insertText": "Math.Floor(${1:value})",
|
|
721
|
+
"insertTextRules": 4,
|
|
722
|
+
"sortText": "06_math_floor"
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"label": "Math.Ceiling",
|
|
726
|
+
"kind": 0,
|
|
727
|
+
"detail": "Round up to nearest integer",
|
|
728
|
+
"documentation": { "value": "Returns the smallest integral value greater than or equal to the specified number.\n\n```csharp\ndouble c = Math.Ceiling(3.2); // 4.0\ndouble neg = Math.Ceiling(-3.7); // -3.0\n```" },
|
|
729
|
+
"insertText": "Math.Ceiling(${1:value})",
|
|
730
|
+
"insertTextRules": 4,
|
|
731
|
+
"sortText": "06_math_ceiling"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"label": "int.Parse",
|
|
735
|
+
"kind": 0,
|
|
736
|
+
"detail": "Parse string to integer",
|
|
737
|
+
"documentation": { "value": "Converts the string representation of a number to its 32-bit signed integer equivalent.\n\n```csharp\nint n = int.Parse(\"42\");\nint hex = int.Parse(\"FF\", NumberStyles.HexNumber);\n```" },
|
|
738
|
+
"insertText": "int.Parse(${1:s})",
|
|
739
|
+
"insertTextRules": 4,
|
|
740
|
+
"sortText": "06_int_parse"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"label": "int.TryParse",
|
|
744
|
+
"kind": 0,
|
|
745
|
+
"detail": "Try to parse string to integer",
|
|
746
|
+
"documentation": { "value": "Tries to convert the string representation of a number to its integer equivalent. Returns whether the conversion succeeded.\n\n```csharp\nif (int.TryParse(input, out int result))\n Console.WriteLine(result);\n```" },
|
|
747
|
+
"insertText": "int.TryParse(${1:s}, out ${2:int result})",
|
|
748
|
+
"insertTextRules": 4,
|
|
749
|
+
"sortText": "06_int_tryparse"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
"label": "Convert.ToInt32",
|
|
753
|
+
"kind": 0,
|
|
754
|
+
"detail": "Convert value to Int32",
|
|
755
|
+
"documentation": { "value": "Converts a specified value to a 32-bit signed integer.\n\n```csharp\nint n = Convert.ToInt32(\"42\");\nint d = Convert.ToInt32(3.99); // 4\nint b = Convert.ToInt32(true); // 1\n```" },
|
|
756
|
+
"insertText": "Convert.ToInt32(${1:value})",
|
|
757
|
+
"insertTextRules": 4,
|
|
758
|
+
"sortText": "06_convert_toint32"
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"label": "Guid.NewGuid",
|
|
762
|
+
"kind": 0,
|
|
763
|
+
"detail": "Generate a new GUID",
|
|
764
|
+
"documentation": { "value": "Initializes a new instance of the Guid structure with a unique value.\n\n```csharp\nGuid id = Guid.NewGuid();\nstring idStr = Guid.NewGuid().ToString();\n```" },
|
|
765
|
+
"insertText": "Guid.NewGuid()",
|
|
766
|
+
"insertTextRules": 4,
|
|
767
|
+
"sortText": "06_guid_newguid"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"label": "DateTime.Now",
|
|
771
|
+
"kind": 9,
|
|
772
|
+
"detail": "Get current local date and time",
|
|
773
|
+
"documentation": { "value": "Gets a DateTime object set to the current date and time on this computer, expressed as the local time.\n\n```csharp\nDateTime now = DateTime.Now;\nstring formatted = DateTime.Now.ToString(\"yyyy-MM-dd\");\n```" },
|
|
774
|
+
"insertText": "DateTime.Now",
|
|
775
|
+
"insertTextRules": 4,
|
|
776
|
+
"sortText": "06_datetime_now"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"label": "DateTime.UtcNow",
|
|
780
|
+
"kind": 9,
|
|
781
|
+
"detail": "Get current UTC date and time",
|
|
782
|
+
"documentation": { "value": "Gets a DateTime object set to the current date and time expressed as Coordinated Universal Time (UTC).\n\n```csharp\nDateTime utc = DateTime.UtcNow;\nlong timestamp = DateTime.UtcNow.Ticks;\n```" },
|
|
783
|
+
"insertText": "DateTime.UtcNow",
|
|
784
|
+
"insertTextRules": 4,
|
|
785
|
+
"sortText": "06_datetime_utcnow"
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"label": "TimeSpan.FromSeconds",
|
|
789
|
+
"kind": 0,
|
|
790
|
+
"detail": "Create TimeSpan from seconds",
|
|
791
|
+
"documentation": { "value": "Returns a TimeSpan that represents a specified number of seconds.\n\n```csharp\nvar ts = TimeSpan.FromSeconds(30);\nvar delay = TimeSpan.FromSeconds(2.5);\n```" },
|
|
792
|
+
"insertText": "TimeSpan.FromSeconds(${1:value})",
|
|
793
|
+
"insertTextRules": 4,
|
|
794
|
+
"sortText": "06_timespan_fromseconds"
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"label": "Enumerable.Range",
|
|
798
|
+
"kind": 0,
|
|
799
|
+
"detail": "Generate a sequence of integers",
|
|
800
|
+
"documentation": { "value": "Generates a sequence of integral numbers within a specified range.\n\n```csharp\nvar nums = Enumerable.Range(0, 10); // 0..9\nvar squares = Enumerable.Range(1, 5).Select(x => x * x);\n```" },
|
|
801
|
+
"insertText": "Enumerable.Range(${1:start}, ${2:count})",
|
|
802
|
+
"insertTextRules": 4,
|
|
803
|
+
"sortText": "06_enumerable_range"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"label": "Enumerable.Empty",
|
|
807
|
+
"kind": 0,
|
|
808
|
+
"detail": "Return an empty sequence",
|
|
809
|
+
"documentation": { "value": "Returns an empty IEnumerable<T> that has the specified type argument.\n\n```csharp\nIEnumerable<string> empty = Enumerable.Empty<string>();\nreturn items ?? Enumerable.Empty<Item>();\n```" },
|
|
810
|
+
"insertText": "Enumerable.Empty<${1:T}>()",
|
|
811
|
+
"insertTextRules": 4,
|
|
812
|
+
"sortText": "06_enumerable_empty"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"label": "Enumerable.Repeat",
|
|
816
|
+
"kind": 0,
|
|
817
|
+
"detail": "Generate a repeated sequence",
|
|
818
|
+
"documentation": { "value": "Generates a sequence that contains one repeated value.\n\n```csharp\nvar zeros = Enumerable.Repeat(0, 10);\nvar stars = Enumerable.Repeat(\"*\", 5);\n```" },
|
|
819
|
+
"insertText": "Enumerable.Repeat(${1:element}, ${2:count})",
|
|
820
|
+
"insertTextRules": 4,
|
|
821
|
+
"sortText": "06_enumerable_repeat"
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
"label": "is pattern",
|
|
825
|
+
"kind": 27,
|
|
826
|
+
"detail": "Pattern matching with is",
|
|
827
|
+
"documentation": { "value": "Tests an expression against a pattern using the is keyword.\n\n```csharp\nif (obj is string s)\n Console.WriteLine(s.Length);\nif (result is not null)\n Process(result);\nif (value is >= 0 and <= 100)\n Console.WriteLine(\"In range\");\n```" },
|
|
828
|
+
"insertText": "is ${1:Type} ${2:name}",
|
|
829
|
+
"insertTextRules": 4,
|
|
830
|
+
"sortText": "07_is_pattern"
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
"label": "switch expression",
|
|
834
|
+
"kind": 27,
|
|
835
|
+
"detail": "Switch expression (C# 8+)",
|
|
836
|
+
"documentation": { "value": "Evaluates an expression against a set of patterns and returns the matching result.\n\n```csharp\nvar result = status switch\n{\n Status.Active => \"Active\",\n Status.Inactive => \"Inactive\",\n _ => \"Unknown\"\n};\n\nvar msg = obj switch\n{\n int n => $\"int: {n}\",\n string s => $\"string: {s}\",\n null => \"null\",\n _ => \"other\"\n};\n```" },
|
|
837
|
+
"insertText": "${1:expression} switch\n{\n ${2:pattern} => ${3:result},\n _ => ${4:default}\n}",
|
|
838
|
+
"insertTextRules": 4,
|
|
839
|
+
"sortText": "07_switch_expression"
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
"label": "when clause",
|
|
843
|
+
"kind": 27,
|
|
844
|
+
"detail": "Guard clause in pattern matching",
|
|
845
|
+
"documentation": { "value": "Adds a condition guard to a pattern in a switch or catch clause.\n\n```csharp\nvar desc = value switch\n{\n int n when n > 0 => \"positive\",\n int n when n < 0 => \"negative\",\n _ => \"zero\"\n};\n\ncatch (Exception ex) when (ex.Message.Contains(\"timeout\"))\n{\n Retry();\n}\n```" },
|
|
846
|
+
"insertText": "when ${1:condition}",
|
|
847
|
+
"insertTextRules": 4,
|
|
848
|
+
"sortText": "07_when"
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
"label": "property pattern",
|
|
852
|
+
"kind": 27,
|
|
853
|
+
"detail": "Property pattern matching",
|
|
854
|
+
"documentation": { "value": "Matches objects by their property values in a pattern.\n\n```csharp\nif (person is { Name: \"Alice\", Age: >= 18 })\n Console.WriteLine(\"Adult Alice\");\n\nvar result = shape switch\n{\n { Area: > 100 } => \"large\",\n { Area: > 0 } => \"small\",\n _ => \"none\"\n};\n```" },
|
|
855
|
+
"insertText": "{ ${1:Property}: ${2:pattern} }",
|
|
856
|
+
"insertTextRules": 4,
|
|
857
|
+
"sortText": "07_property_pattern"
|
|
858
|
+
}
|
|
859
|
+
]
|
|
860
|
+
}
|