@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,824 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "cpp",
|
|
3
|
+
"completions": [
|
|
4
|
+
{
|
|
5
|
+
"label": "std::cout",
|
|
6
|
+
"kind": 5,
|
|
7
|
+
"detail": "Standard output stream",
|
|
8
|
+
"documentation": { "value": "The standard output stream object.\n\n```cpp\nstd::cout << \"Hello\" << std::endl;\nstd::cout << \"x = \" << x << '\\n';\n```" },
|
|
9
|
+
"insertText": "std::cout << ${1:value}",
|
|
10
|
+
"insertTextRules": 4,
|
|
11
|
+
"sortText": "00_cout"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"label": "std::cin",
|
|
15
|
+
"kind": 5,
|
|
16
|
+
"detail": "Standard input stream",
|
|
17
|
+
"documentation": { "value": "The standard input stream object.\n\n```cpp\nint x;\nstd::cin >> x;\nstd::string line;\nstd::getline(std::cin, line);\n```" },
|
|
18
|
+
"insertText": "std::cin >> ${1:variable}",
|
|
19
|
+
"insertTextRules": 4,
|
|
20
|
+
"sortText": "00_cin"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"label": "std::cerr",
|
|
24
|
+
"kind": 5,
|
|
25
|
+
"detail": "Standard error stream",
|
|
26
|
+
"documentation": { "value": "The standard error output stream (unbuffered).\n\n```cpp\nstd::cerr << \"Error: \" << msg << std::endl;\n```" },
|
|
27
|
+
"insertText": "std::cerr << ${1:message}",
|
|
28
|
+
"insertTextRules": 4,
|
|
29
|
+
"sortText": "00_cerr"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"label": "std::endl",
|
|
33
|
+
"kind": 5,
|
|
34
|
+
"detail": "End-of-line and flush",
|
|
35
|
+
"documentation": { "value": "Inserts a newline character and flushes the stream.\n\n```cpp\nstd::cout << \"Hello\" << std::endl;\n```\n\n**Note:** Prefer `'\\n'` when flushing is not needed for better performance." },
|
|
36
|
+
"insertText": "std::endl",
|
|
37
|
+
"insertTextRules": 0,
|
|
38
|
+
"sortText": "00_endl"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"label": "std::getline",
|
|
42
|
+
"kind": 1,
|
|
43
|
+
"detail": "Read a line from stream",
|
|
44
|
+
"documentation": { "value": "Reads a full line from an input stream into a string.\n\n```cpp\nstd::string line;\nstd::getline(std::cin, line);\nstd::getline(std::cin, line, ','); // custom delimiter\n```" },
|
|
45
|
+
"insertText": "std::getline(${1:std::cin}, ${2:str})",
|
|
46
|
+
"insertTextRules": 4,
|
|
47
|
+
"sortText": "00_getline"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"label": "std::string",
|
|
51
|
+
"kind": 6,
|
|
52
|
+
"detail": "String class (std::basic_string<char>)",
|
|
53
|
+
"documentation": { "value": "Dynamic character string with automatic memory management.\n\n```cpp\nstd::string s = \"hello\";\nstd::string s2(5, 'a'); // \"aaaaa\"\ns.append(\" world\");\nstd::cout << s.size() << std::endl;\n```" },
|
|
54
|
+
"insertText": "std::string ${1:name}",
|
|
55
|
+
"insertTextRules": 4,
|
|
56
|
+
"sortText": "01_string"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"label": "std::string_view",
|
|
60
|
+
"kind": 6,
|
|
61
|
+
"detail": "Non-owning string reference (C++17)",
|
|
62
|
+
"documentation": { "value": "A lightweight non-owning reference to a string or substring. Zero-copy.\n\n```cpp\nstd::string_view sv = \"hello world\";\nauto sub = sv.substr(0, 5); // \"hello\"\nvoid process(std::string_view s); // pass by value\n```" },
|
|
63
|
+
"insertText": "std::string_view ${1:name}",
|
|
64
|
+
"insertTextRules": 4,
|
|
65
|
+
"sortText": "01_string_view"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"label": "std::vector",
|
|
69
|
+
"kind": 6,
|
|
70
|
+
"detail": "Dynamic array container",
|
|
71
|
+
"documentation": { "value": "Sequence container with dynamic contiguous storage.\n\n```cpp\nstd::vector<int> v = {1, 2, 3};\nv.push_back(4);\nv.emplace_back(5);\nfor (auto& x : v) std::cout << x;\n```" },
|
|
72
|
+
"insertText": "std::vector<${1:int}> ${2:name}",
|
|
73
|
+
"insertTextRules": 4,
|
|
74
|
+
"sortText": "02_vector"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"label": "std::map",
|
|
78
|
+
"kind": 6,
|
|
79
|
+
"detail": "Sorted associative container",
|
|
80
|
+
"documentation": { "value": "Sorted key-value container using a red-black tree.\n\n```cpp\nstd::map<std::string, int> m;\nm[\"apple\"] = 1;\nm.insert({\"banana\", 2});\nfor (auto& [key, val] : m) { ... }\n```" },
|
|
81
|
+
"insertText": "std::map<${1:std::string}, ${2:int}> ${3:name}",
|
|
82
|
+
"insertTextRules": 4,
|
|
83
|
+
"sortText": "02_map"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"label": "std::unordered_map",
|
|
87
|
+
"kind": 6,
|
|
88
|
+
"detail": "Hash-based associative container",
|
|
89
|
+
"documentation": { "value": "Unordered key-value container using hash table. O(1) average lookup.\n\n```cpp\nstd::unordered_map<std::string, int> m;\nm[\"key\"] = 42;\nif (m.count(\"key\")) { ... }\nauto it = m.find(\"key\");\n```" },
|
|
90
|
+
"insertText": "std::unordered_map<${1:std::string}, ${2:int}> ${3:name}",
|
|
91
|
+
"insertTextRules": 4,
|
|
92
|
+
"sortText": "02_unordered_map"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"label": "std::set",
|
|
96
|
+
"kind": 6,
|
|
97
|
+
"detail": "Sorted unique-element container",
|
|
98
|
+
"documentation": { "value": "Sorted container of unique elements (red-black tree).\n\n```cpp\nstd::set<int> s = {3, 1, 4, 1, 5};\ns.insert(9);\nif (s.count(3)) { ... }\nfor (auto& x : s) std::cout << x;\n```" },
|
|
99
|
+
"insertText": "std::set<${1:int}> ${2:name}",
|
|
100
|
+
"insertTextRules": 4,
|
|
101
|
+
"sortText": "02_set"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"label": "std::unordered_set",
|
|
105
|
+
"kind": 6,
|
|
106
|
+
"detail": "Hash-based unique-element container",
|
|
107
|
+
"documentation": { "value": "Unordered container of unique elements using hash table.\n\n```cpp\nstd::unordered_set<std::string> s;\ns.insert(\"hello\");\nif (s.contains(\"hello\")) { ... } // C++20\n```" },
|
|
108
|
+
"insertText": "std::unordered_set<${1:int}> ${2:name}",
|
|
109
|
+
"insertTextRules": 4,
|
|
110
|
+
"sortText": "02_unordered_set"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"label": "std::array",
|
|
114
|
+
"kind": 6,
|
|
115
|
+
"detail": "Fixed-size array container",
|
|
116
|
+
"documentation": { "value": "Fixed-size array with STL interface. Stack-allocated.\n\n```cpp\nstd::array<int, 5> a = {1, 2, 3, 4, 5};\na[0] = 10;\nstd::cout << a.size(); // 5\nstd::sort(a.begin(), a.end());\n```" },
|
|
117
|
+
"insertText": "std::array<${1:int}, ${2:size}> ${3:name}",
|
|
118
|
+
"insertTextRules": 4,
|
|
119
|
+
"sortText": "02_array"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"label": "std::deque",
|
|
123
|
+
"kind": 6,
|
|
124
|
+
"detail": "Double-ended queue",
|
|
125
|
+
"documentation": { "value": "Double-ended queue with efficient insertion/removal at both ends.\n\n```cpp\nstd::deque<int> d = {1, 2, 3};\nd.push_front(0);\nd.push_back(4);\nd.pop_front();\n```" },
|
|
126
|
+
"insertText": "std::deque<${1:int}> ${2:name}",
|
|
127
|
+
"insertTextRules": 4,
|
|
128
|
+
"sortText": "02_deque"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"label": "std::list",
|
|
132
|
+
"kind": 6,
|
|
133
|
+
"detail": "Doubly-linked list",
|
|
134
|
+
"documentation": { "value": "Doubly-linked list with O(1) insertion/removal anywhere.\n\n```cpp\nstd::list<int> lst = {1, 2, 3};\nlst.push_back(4);\nlst.push_front(0);\nlst.sort();\n```" },
|
|
135
|
+
"insertText": "std::list<${1:int}> ${2:name}",
|
|
136
|
+
"insertTextRules": 4,
|
|
137
|
+
"sortText": "02_list"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"label": "std::stack",
|
|
141
|
+
"kind": 6,
|
|
142
|
+
"detail": "LIFO stack adapter",
|
|
143
|
+
"documentation": { "value": "Container adapter providing LIFO (last-in, first-out) access.\n\n```cpp\nstd::stack<int> s;\ns.push(1);\ns.push(2);\nint top = s.top(); // 2\ns.pop();\n```" },
|
|
144
|
+
"insertText": "std::stack<${1:int}> ${2:name}",
|
|
145
|
+
"insertTextRules": 4,
|
|
146
|
+
"sortText": "02_stack"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"label": "std::queue",
|
|
150
|
+
"kind": 6,
|
|
151
|
+
"detail": "FIFO queue adapter",
|
|
152
|
+
"documentation": { "value": "Container adapter providing FIFO (first-in, first-out) access.\n\n```cpp\nstd::queue<int> q;\nq.push(1);\nq.push(2);\nint front = q.front(); // 1\nq.pop();\n```" },
|
|
153
|
+
"insertText": "std::queue<${1:int}> ${2:name}",
|
|
154
|
+
"insertTextRules": 4,
|
|
155
|
+
"sortText": "02_queue"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"label": "std::priority_queue",
|
|
159
|
+
"kind": 6,
|
|
160
|
+
"detail": "Priority queue (max-heap by default)",
|
|
161
|
+
"documentation": { "value": "Container adapter providing priority-based access (max-heap).\n\n```cpp\nstd::priority_queue<int> pq;\npq.push(3); pq.push(1); pq.push(4);\nint top = pq.top(); // 4\n// Min-heap:\nstd::priority_queue<int, std::vector<int>, std::greater<int>> minpq;\n```" },
|
|
162
|
+
"insertText": "std::priority_queue<${1:int}> ${2:name}",
|
|
163
|
+
"insertTextRules": 4,
|
|
164
|
+
"sortText": "02_priority_queue"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"label": "std::pair",
|
|
168
|
+
"kind": 6,
|
|
169
|
+
"detail": "Pair of two values",
|
|
170
|
+
"documentation": { "value": "Holds two heterogeneous objects as a single unit.\n\n```cpp\nstd::pair<int, std::string> p = {1, \"hello\"};\nauto p2 = std::make_pair(42, 3.14);\nstd::cout << p.first << \" \" << p.second;\n```" },
|
|
171
|
+
"insertText": "std::pair<${1:int}, ${2:int}> ${3:name}",
|
|
172
|
+
"insertTextRules": 4,
|
|
173
|
+
"sortText": "02_pair"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"label": "std::tuple",
|
|
177
|
+
"kind": 6,
|
|
178
|
+
"detail": "Fixed-size heterogeneous collection",
|
|
179
|
+
"documentation": { "value": "Holds a fixed number of heterogeneous values.\n\n```cpp\nstd::tuple<int, double, std::string> t = {1, 3.14, \"hi\"};\nauto [a, b, c] = t; // structured bindings\nstd::cout << std::get<0>(t);\n```" },
|
|
180
|
+
"insertText": "std::tuple<${1:Types}> ${2:name}",
|
|
181
|
+
"insertTextRules": 4,
|
|
182
|
+
"sortText": "02_tuple"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"label": "std::sort",
|
|
186
|
+
"kind": 1,
|
|
187
|
+
"detail": "Sort elements in range",
|
|
188
|
+
"documentation": { "value": "Sorts elements in [first, last) range. Average O(n log n).\n\n```cpp\nstd::vector<int> v = {3, 1, 4, 1, 5};\nstd::sort(v.begin(), v.end());\nstd::sort(v.begin(), v.end(), std::greater<>()); // descending\nstd::sort(v.begin(), v.end(), [](int a, int b) { return a > b; });\n```" },
|
|
189
|
+
"insertText": "std::sort(${1:container}.begin(), ${1:container}.end())",
|
|
190
|
+
"insertTextRules": 4,
|
|
191
|
+
"sortText": "03_sort"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"label": "std::find",
|
|
195
|
+
"kind": 1,
|
|
196
|
+
"detail": "Find element in range",
|
|
197
|
+
"documentation": { "value": "Finds the first element equal to the given value.\n\n```cpp\nstd::vector<int> v = {1, 2, 3, 4};\nauto it = std::find(v.begin(), v.end(), 3);\nif (it != v.end()) { /* found */ }\n```" },
|
|
198
|
+
"insertText": "std::find(${1:container}.begin(), ${1:container}.end(), ${2:value})",
|
|
199
|
+
"insertTextRules": 4,
|
|
200
|
+
"sortText": "03_find"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"label": "std::for_each",
|
|
204
|
+
"kind": 1,
|
|
205
|
+
"detail": "Apply function to range",
|
|
206
|
+
"documentation": { "value": "Applies a function to each element in [first, last).\n\n```cpp\nstd::vector<int> v = {1, 2, 3};\nstd::for_each(v.begin(), v.end(), [](int x) {\n std::cout << x << ' ';\n});\n```" },
|
|
207
|
+
"insertText": "std::for_each(${1:container}.begin(), ${1:container}.end(), [](${2:auto}& ${3:elem}) {\n\t$0\n})",
|
|
208
|
+
"insertTextRules": 4,
|
|
209
|
+
"sortText": "03_for_each"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"label": "std::transform",
|
|
213
|
+
"kind": 1,
|
|
214
|
+
"detail": "Transform elements in range",
|
|
215
|
+
"documentation": { "value": "Applies a function and stores the result in a destination range.\n\n```cpp\nstd::vector<int> v = {1, 2, 3};\nstd::vector<int> result(v.size());\nstd::transform(v.begin(), v.end(), result.begin(), [](int x) {\n return x * 2;\n});\n```" },
|
|
216
|
+
"insertText": "std::transform(${1:src}.begin(), ${1:src}.end(), ${2:dst}.begin(), [](${3:auto} ${4:elem}) {\n\treturn ${5:elem};\n})",
|
|
217
|
+
"insertTextRules": 4,
|
|
218
|
+
"sortText": "03_transform"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"label": "std::accumulate",
|
|
222
|
+
"kind": 1,
|
|
223
|
+
"detail": "Accumulate values in range",
|
|
224
|
+
"documentation": { "value": "Computes the sum (or custom fold) of elements in a range.\n\n```cpp\n#include <numeric>\nstd::vector<int> v = {1, 2, 3, 4};\nint sum = std::accumulate(v.begin(), v.end(), 0);\nint product = std::accumulate(v.begin(), v.end(), 1, std::multiplies<>());\n```" },
|
|
225
|
+
"insertText": "std::accumulate(${1:container}.begin(), ${1:container}.end(), ${2:0})",
|
|
226
|
+
"insertTextRules": 4,
|
|
227
|
+
"sortText": "03_accumulate"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"label": "std::count",
|
|
231
|
+
"kind": 1,
|
|
232
|
+
"detail": "Count occurrences in range",
|
|
233
|
+
"documentation": { "value": "Counts elements equal to a given value.\n\n```cpp\nstd::vector<int> v = {1, 2, 2, 3, 2};\nauto n = std::count(v.begin(), v.end(), 2); // 3\n```" },
|
|
234
|
+
"insertText": "std::count(${1:container}.begin(), ${1:container}.end(), ${2:value})",
|
|
235
|
+
"insertTextRules": 4,
|
|
236
|
+
"sortText": "03_count"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"label": "std::count_if",
|
|
240
|
+
"kind": 1,
|
|
241
|
+
"detail": "Count elements satisfying predicate",
|
|
242
|
+
"documentation": { "value": "Counts elements for which the predicate returns true.\n\n```cpp\nstd::vector<int> v = {1, 2, 3, 4, 5};\nauto n = std::count_if(v.begin(), v.end(), [](int x) { return x > 3; }); // 2\n```" },
|
|
243
|
+
"insertText": "std::count_if(${1:container}.begin(), ${1:container}.end(), [](${2:auto} ${3:elem}) {\n\treturn ${4:condition};\n})",
|
|
244
|
+
"insertTextRules": 4,
|
|
245
|
+
"sortText": "03_count_if"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"label": "std::remove_if",
|
|
249
|
+
"kind": 1,
|
|
250
|
+
"detail": "Remove elements satisfying predicate",
|
|
251
|
+
"documentation": { "value": "Moves elements not satisfying the predicate to the front. Use with erase (erase-remove idiom).\n\n```cpp\nstd::vector<int> v = {1, 2, 3, 4, 5};\nv.erase(std::remove_if(v.begin(), v.end(), [](int x) { return x % 2 == 0; }), v.end());\n// v = {1, 3, 5}\n```" },
|
|
252
|
+
"insertText": "${1:container}.erase(std::remove_if(${1:container}.begin(), ${1:container}.end(), [](${2:auto} ${3:elem}) {\n\treturn ${4:condition};\n}), ${1:container}.end())",
|
|
253
|
+
"insertTextRules": 4,
|
|
254
|
+
"sortText": "03_remove_if"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"label": "std::unique",
|
|
258
|
+
"kind": 1,
|
|
259
|
+
"detail": "Remove consecutive duplicates",
|
|
260
|
+
"documentation": { "value": "Removes consecutive duplicate elements. Typically used after sorting.\n\n```cpp\nstd::vector<int> v = {1, 1, 2, 2, 3};\nauto last = std::unique(v.begin(), v.end());\nv.erase(last, v.end()); // v = {1, 2, 3}\n```" },
|
|
261
|
+
"insertText": "auto ${1:last} = std::unique(${2:container}.begin(), ${2:container}.end())",
|
|
262
|
+
"insertTextRules": 4,
|
|
263
|
+
"sortText": "03_unique"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"label": "std::reverse",
|
|
267
|
+
"kind": 1,
|
|
268
|
+
"detail": "Reverse elements in range",
|
|
269
|
+
"documentation": { "value": "Reverses the order of elements in [first, last).\n\n```cpp\nstd::vector<int> v = {1, 2, 3, 4};\nstd::reverse(v.begin(), v.end()); // {4, 3, 2, 1}\n```" },
|
|
270
|
+
"insertText": "std::reverse(${1:container}.begin(), ${1:container}.end())",
|
|
271
|
+
"insertTextRules": 4,
|
|
272
|
+
"sortText": "03_reverse"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"label": "std::min_element",
|
|
276
|
+
"kind": 1,
|
|
277
|
+
"detail": "Find minimum element",
|
|
278
|
+
"documentation": { "value": "Returns an iterator to the smallest element in [first, last).\n\n```cpp\nstd::vector<int> v = {3, 1, 4, 1, 5};\nauto it = std::min_element(v.begin(), v.end());\nstd::cout << *it; // 1\n```" },
|
|
279
|
+
"insertText": "std::min_element(${1:container}.begin(), ${1:container}.end())",
|
|
280
|
+
"insertTextRules": 4,
|
|
281
|
+
"sortText": "03_min_element"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"label": "std::max_element",
|
|
285
|
+
"kind": 1,
|
|
286
|
+
"detail": "Find maximum element",
|
|
287
|
+
"documentation": { "value": "Returns an iterator to the largest element in [first, last).\n\n```cpp\nstd::vector<int> v = {3, 1, 4, 1, 5};\nauto it = std::max_element(v.begin(), v.end());\nstd::cout << *it; // 5\n```" },
|
|
288
|
+
"insertText": "std::max_element(${1:container}.begin(), ${1:container}.end())",
|
|
289
|
+
"insertTextRules": 4,
|
|
290
|
+
"sortText": "03_max_element"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"label": "std::binary_search",
|
|
294
|
+
"kind": 1,
|
|
295
|
+
"detail": "Binary search in sorted range",
|
|
296
|
+
"documentation": { "value": "Checks if a value exists in a sorted range. O(log n).\n\n```cpp\nstd::vector<int> v = {1, 2, 3, 4, 5};\nbool found = std::binary_search(v.begin(), v.end(), 3); // true\n```" },
|
|
297
|
+
"insertText": "std::binary_search(${1:container}.begin(), ${1:container}.end(), ${2:value})",
|
|
298
|
+
"insertTextRules": 4,
|
|
299
|
+
"sortText": "03_binary_search"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"label": "std::lower_bound",
|
|
303
|
+
"kind": 1,
|
|
304
|
+
"detail": "Find first not-less-than element",
|
|
305
|
+
"documentation": { "value": "Returns iterator to the first element not less than value in a sorted range.\n\n```cpp\nstd::vector<int> v = {1, 2, 4, 5, 6};\nauto it = std::lower_bound(v.begin(), v.end(), 3);\n// *it == 4\n```" },
|
|
306
|
+
"insertText": "std::lower_bound(${1:container}.begin(), ${1:container}.end(), ${2:value})",
|
|
307
|
+
"insertTextRules": 4,
|
|
308
|
+
"sortText": "03_lower_bound"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"label": "std::upper_bound",
|
|
312
|
+
"kind": 1,
|
|
313
|
+
"detail": "Find first greater-than element",
|
|
314
|
+
"documentation": { "value": "Returns iterator to the first element greater than value in a sorted range.\n\n```cpp\nstd::vector<int> v = {1, 2, 3, 3, 5};\nauto it = std::upper_bound(v.begin(), v.end(), 3);\n// *it == 5\n```" },
|
|
315
|
+
"insertText": "std::upper_bound(${1:container}.begin(), ${1:container}.end(), ${2:value})",
|
|
316
|
+
"insertTextRules": 4,
|
|
317
|
+
"sortText": "03_upper_bound"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"label": "std::unique_ptr",
|
|
321
|
+
"kind": 6,
|
|
322
|
+
"detail": "Exclusive-ownership smart pointer",
|
|
323
|
+
"documentation": { "value": "Smart pointer with exclusive ownership semantics. Cannot be copied.\n\n```cpp\nauto ptr = std::make_unique<int>(42);\nstd::unique_ptr<MyClass> p(new MyClass());\nstd::cout << *ptr;\nptr.reset(); // release ownership\n```" },
|
|
324
|
+
"insertText": "std::unique_ptr<${1:Type}> ${2:name}",
|
|
325
|
+
"insertTextRules": 4,
|
|
326
|
+
"sortText": "04_unique_ptr"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"label": "std::shared_ptr",
|
|
330
|
+
"kind": 6,
|
|
331
|
+
"detail": "Shared-ownership smart pointer",
|
|
332
|
+
"documentation": { "value": "Smart pointer with shared (reference-counted) ownership.\n\n```cpp\nauto ptr = std::make_shared<int>(42);\nstd::shared_ptr<MyClass> p2 = ptr; // refcount = 2\nstd::cout << ptr.use_count();\n```" },
|
|
333
|
+
"insertText": "std::shared_ptr<${1:Type}> ${2:name}",
|
|
334
|
+
"insertTextRules": 4,
|
|
335
|
+
"sortText": "04_shared_ptr"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"label": "std::weak_ptr",
|
|
339
|
+
"kind": 6,
|
|
340
|
+
"detail": "Non-owning smart pointer observer",
|
|
341
|
+
"documentation": { "value": "Non-owning reference to a `std::shared_ptr`-managed object. Breaks circular references.\n\n```cpp\nstd::shared_ptr<int> sp = std::make_shared<int>(10);\nstd::weak_ptr<int> wp = sp;\nif (auto locked = wp.lock()) {\n std::cout << *locked;\n}\n```" },
|
|
342
|
+
"insertText": "std::weak_ptr<${1:Type}> ${2:name}",
|
|
343
|
+
"insertTextRules": 4,
|
|
344
|
+
"sortText": "04_weak_ptr"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"label": "std::make_unique",
|
|
348
|
+
"kind": 1,
|
|
349
|
+
"detail": "Create unique_ptr (C++14)",
|
|
350
|
+
"documentation": { "value": "Creates a `std::unique_ptr` with a new heap-allocated object.\n\n```cpp\nauto p = std::make_unique<int>(42);\nauto obj = std::make_unique<MyClass>(arg1, arg2);\nauto arr = std::make_unique<int[]>(10); // array of 10\n```" },
|
|
351
|
+
"insertText": "std::make_unique<${1:Type}>(${2:args})",
|
|
352
|
+
"insertTextRules": 4,
|
|
353
|
+
"sortText": "04_make_unique"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"label": "std::make_shared",
|
|
357
|
+
"kind": 1,
|
|
358
|
+
"detail": "Create shared_ptr",
|
|
359
|
+
"documentation": { "value": "Creates a `std::shared_ptr` with a single allocation for object and control block.\n\n```cpp\nauto p = std::make_shared<int>(42);\nauto obj = std::make_shared<MyClass>(arg1, arg2);\n```" },
|
|
360
|
+
"insertText": "std::make_shared<${1:Type}>(${2:args})",
|
|
361
|
+
"insertTextRules": 4,
|
|
362
|
+
"sortText": "04_make_shared"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"label": "std::move",
|
|
366
|
+
"kind": 1,
|
|
367
|
+
"detail": "Cast to rvalue reference",
|
|
368
|
+
"documentation": { "value": "Casts its argument to an rvalue reference, enabling move semantics.\n\n```cpp\nstd::string s = \"hello\";\nstd::string s2 = std::move(s); // s is now in a moved-from state\nvec.push_back(std::move(obj));\n```" },
|
|
369
|
+
"insertText": "std::move(${1:value})",
|
|
370
|
+
"insertTextRules": 4,
|
|
371
|
+
"sortText": "05_move"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"label": "std::forward",
|
|
375
|
+
"kind": 1,
|
|
376
|
+
"detail": "Perfect forwarding",
|
|
377
|
+
"documentation": { "value": "Forwards lvalues as lvalues and rvalues as rvalues (perfect forwarding).\n\n```cpp\ntemplate<typename T>\nvoid wrapper(T&& arg) {\n inner(std::forward<T>(arg));\n}\n```" },
|
|
378
|
+
"insertText": "std::forward<${1:T}>(${2:arg})",
|
|
379
|
+
"insertTextRules": 4,
|
|
380
|
+
"sortText": "05_forward"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"label": "std::swap",
|
|
384
|
+
"kind": 1,
|
|
385
|
+
"detail": "Swap two values",
|
|
386
|
+
"documentation": { "value": "Exchanges the values of two objects.\n\n```cpp\nint a = 1, b = 2;\nstd::swap(a, b); // a=2, b=1\n```" },
|
|
387
|
+
"insertText": "std::swap(${1:a}, ${2:b})",
|
|
388
|
+
"insertTextRules": 4,
|
|
389
|
+
"sortText": "05_swap"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"label": "std::optional",
|
|
393
|
+
"kind": 6,
|
|
394
|
+
"detail": "Optional value wrapper (C++17)",
|
|
395
|
+
"documentation": { "value": "Manages an optional contained value (may or may not hold a value).\n\n```cpp\nstd::optional<int> opt = 42;\nif (opt.has_value()) std::cout << *opt;\nstd::optional<std::string> empty = std::nullopt;\nauto val = opt.value_or(0);\n```" },
|
|
396
|
+
"insertText": "std::optional<${1:Type}> ${2:name}",
|
|
397
|
+
"insertTextRules": 4,
|
|
398
|
+
"sortText": "05_optional"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"label": "std::variant",
|
|
402
|
+
"kind": 6,
|
|
403
|
+
"detail": "Type-safe union (C++17)",
|
|
404
|
+
"documentation": { "value": "Type-safe discriminated union. Holds one of several alternative types.\n\n```cpp\nstd::variant<int, double, std::string> v = \"hello\";\nstd::cout << std::get<std::string>(v);\nstd::visit([](auto&& arg) { std::cout << arg; }, v);\n```" },
|
|
405
|
+
"insertText": "std::variant<${1:Types}> ${2:name}",
|
|
406
|
+
"insertTextRules": 4,
|
|
407
|
+
"sortText": "05_variant"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"label": "std::any",
|
|
411
|
+
"kind": 6,
|
|
412
|
+
"detail": "Type-safe container for any value (C++17)",
|
|
413
|
+
"documentation": { "value": "Type-safe container for single values of any type.\n\n```cpp\nstd::any a = 42;\na = std::string(\"hello\");\nstd::string s = std::any_cast<std::string>(a);\n```" },
|
|
414
|
+
"insertText": "std::any ${1:name}",
|
|
415
|
+
"insertTextRules": 4,
|
|
416
|
+
"sortText": "05_any"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"label": "std::function",
|
|
420
|
+
"kind": 6,
|
|
421
|
+
"detail": "General-purpose function wrapper",
|
|
422
|
+
"documentation": { "value": "Polymorphic function wrapper. Stores any callable target.\n\n```cpp\nstd::function<int(int, int)> add = [](int a, int b) { return a + b; };\nstd::function<void()> callback = &myFunc;\nstd::cout << add(2, 3); // 5\n```" },
|
|
423
|
+
"insertText": "std::function<${1:ReturnType}(${2:Args})> ${3:name}",
|
|
424
|
+
"insertTextRules": 4,
|
|
425
|
+
"sortText": "05_function"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"label": "std::bind",
|
|
429
|
+
"kind": 1,
|
|
430
|
+
"detail": "Bind arguments to callable",
|
|
431
|
+
"documentation": { "value": "Creates a function object with some arguments bound.\n\n```cpp\nusing namespace std::placeholders;\nauto bound = std::bind(&MyClass::method, &obj, _1, 42);\nbound(10); // calls obj.method(10, 42)\n```\n\n**Note:** Prefer lambdas over `std::bind` in modern C++." },
|
|
432
|
+
"insertText": "std::bind(${1:callable}, ${2:args})",
|
|
433
|
+
"insertTextRules": 4,
|
|
434
|
+
"sortText": "05_bind"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"label": "std::format",
|
|
438
|
+
"kind": 1,
|
|
439
|
+
"detail": "Format string (C++20)",
|
|
440
|
+
"documentation": { "value": "Type-safe string formatting (Python-style).\n\n```cpp\n#include <format>\nstd::string s = std::format(\"Hello, {}! x = {:.2f}\", name, 3.14159);\nstd::cout << std::format(\"{:>10}\", \"right\");\n```" },
|
|
441
|
+
"insertText": "std::format(\"${1:format_string}\", ${2:args})",
|
|
442
|
+
"insertTextRules": 4,
|
|
443
|
+
"sortText": "05_format"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"label": "std::span",
|
|
447
|
+
"kind": 6,
|
|
448
|
+
"detail": "Non-owning view over contiguous sequence (C++20)",
|
|
449
|
+
"documentation": { "value": "A lightweight non-owning view over a contiguous sequence of objects.\n\n```cpp\nvoid process(std::span<int> data) {\n for (auto x : data) std::cout << x;\n}\nstd::vector<int> v = {1, 2, 3};\nprocess(v);\nint arr[] = {4, 5, 6};\nprocess(arr);\n```" },
|
|
450
|
+
"insertText": "std::span<${1:Type}> ${2:name}",
|
|
451
|
+
"insertTextRules": 4,
|
|
452
|
+
"sortText": "05_span"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"label": "auto",
|
|
456
|
+
"kind": 14,
|
|
457
|
+
"detail": "Automatic type deduction",
|
|
458
|
+
"documentation": { "value": "Deduces the type of a variable from its initializer.\n\n```cpp\nauto x = 42; // int\nauto s = \"hello\"s; // std::string\nauto it = v.begin(); // iterator\nauto [key, val] = pair; // structured bindings\n```" },
|
|
459
|
+
"insertText": "auto ${1:name} = ${2:value}",
|
|
460
|
+
"insertTextRules": 4,
|
|
461
|
+
"sortText": "06_auto"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"label": "constexpr",
|
|
465
|
+
"kind": 14,
|
|
466
|
+
"detail": "Compile-time constant expression",
|
|
467
|
+
"documentation": { "value": "Specifies that a value or function can be evaluated at compile time.\n\n```cpp\nconstexpr int square(int x) { return x * x; }\nconstexpr auto val = square(5); // evaluated at compile time\nstatic_assert(square(3) == 9);\n```" },
|
|
468
|
+
"insertText": "constexpr ${1:type} ${2:name} = ${3:value}",
|
|
469
|
+
"insertTextRules": 4,
|
|
470
|
+
"sortText": "06_constexpr"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"label": "if constexpr",
|
|
474
|
+
"kind": 14,
|
|
475
|
+
"detail": "Compile-time conditional (C++17)",
|
|
476
|
+
"documentation": { "value": "Compile-time conditional statement. Discards the false branch at compile time.\n\n```cpp\ntemplate<typename T>\nvoid process(T val) {\n if constexpr (std::is_integral_v<T>) {\n std::cout << \"integer: \" << val;\n } else {\n std::cout << \"other: \" << val;\n }\n}\n```" },
|
|
477
|
+
"insertText": "if constexpr (${1:condition}) {\n\t$0\n}",
|
|
478
|
+
"insertTextRules": 4,
|
|
479
|
+
"sortText": "06_if_constexpr"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"label": "class",
|
|
483
|
+
"kind": 14,
|
|
484
|
+
"detail": "Class declaration keyword",
|
|
485
|
+
"documentation": { "value": "Declares a class type (members default to private).\n\n```cpp\nclass MyClass {\npublic:\n MyClass() = default;\n void method();\nprivate:\n int data_;\n};\n```" },
|
|
486
|
+
"insertText": "class",
|
|
487
|
+
"insertTextRules": 0,
|
|
488
|
+
"sortText": "06_class"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"label": "struct",
|
|
492
|
+
"kind": 14,
|
|
493
|
+
"detail": "Struct declaration keyword",
|
|
494
|
+
"documentation": { "value": "Declares a struct type (members default to public).\n\n```cpp\nstruct Point {\n double x;\n double y;\n};\n```" },
|
|
495
|
+
"insertText": "struct",
|
|
496
|
+
"insertTextRules": 0,
|
|
497
|
+
"sortText": "06_struct"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"label": "template",
|
|
501
|
+
"kind": 14,
|
|
502
|
+
"detail": "Template declaration keyword",
|
|
503
|
+
"documentation": { "value": "Declares a generic template.\n\n```cpp\ntemplate<typename T>\nT max(T a, T b) { return (a > b) ? a : b; }\n\ntemplate<typename T, int N>\nclass FixedArray { T data[N]; };\n```" },
|
|
504
|
+
"insertText": "template<typename ${1:T}>",
|
|
505
|
+
"insertTextRules": 4,
|
|
506
|
+
"sortText": "06_template"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"label": "typename",
|
|
510
|
+
"kind": 14,
|
|
511
|
+
"detail": "Template type parameter keyword",
|
|
512
|
+
"documentation": { "value": "Specifies a type template parameter or disambiguates dependent types.\n\n```cpp\ntemplate<typename T>\nvoid foo(T val);\n\ntypename Container::iterator it; // dependent name\n```" },
|
|
513
|
+
"insertText": "typename",
|
|
514
|
+
"insertTextRules": 0,
|
|
515
|
+
"sortText": "06_typename"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"label": "namespace",
|
|
519
|
+
"kind": 14,
|
|
520
|
+
"detail": "Namespace declaration keyword",
|
|
521
|
+
"documentation": { "value": "Declares a namespace scope.\n\n```cpp\nnamespace mylib {\n void func();\n class Widget {};\n}\nnamespace mylib::detail { /* nested C++17 */ }\n```" },
|
|
522
|
+
"insertText": "namespace ${1:name} {\n\t$0\n}",
|
|
523
|
+
"insertTextRules": 4,
|
|
524
|
+
"sortText": "06_namespace"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"label": "virtual",
|
|
528
|
+
"kind": 14,
|
|
529
|
+
"detail": "Virtual function keyword",
|
|
530
|
+
"documentation": { "value": "Declares a virtual (polymorphic) member function.\n\n```cpp\nclass Base {\npublic:\n virtual void draw() { /* default */ }\n virtual ~Base() = default;\n};\n```" },
|
|
531
|
+
"insertText": "virtual",
|
|
532
|
+
"insertTextRules": 0,
|
|
533
|
+
"sortText": "06_virtual"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"label": "override",
|
|
537
|
+
"kind": 14,
|
|
538
|
+
"detail": "Override specifier",
|
|
539
|
+
"documentation": { "value": "Ensures a function overrides a virtual function in a base class.\n\n```cpp\nclass Derived : public Base {\npublic:\n void draw() override { /* ... */ }\n};\n```" },
|
|
540
|
+
"insertText": "override",
|
|
541
|
+
"insertTextRules": 0,
|
|
542
|
+
"sortText": "06_override"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"label": "final",
|
|
546
|
+
"kind": 14,
|
|
547
|
+
"detail": "Final specifier",
|
|
548
|
+
"documentation": { "value": "Prevents further overriding of a virtual function or derivation from a class.\n\n```cpp\nclass Base final { }; // no derived classes\nvoid method() final; // no further override\n```" },
|
|
549
|
+
"insertText": "final",
|
|
550
|
+
"insertTextRules": 0,
|
|
551
|
+
"sortText": "06_final"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"label": "const",
|
|
555
|
+
"kind": 14,
|
|
556
|
+
"detail": "Const qualifier keyword",
|
|
557
|
+
"documentation": { "value": "Specifies that an object/variable cannot be modified.\n\n```cpp\nconst int x = 42;\nconst std::string& ref = str;\nvoid method() const; // does not modify *this\n```" },
|
|
558
|
+
"insertText": "const",
|
|
559
|
+
"insertTextRules": 0,
|
|
560
|
+
"sortText": "06_const"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"label": "static",
|
|
564
|
+
"kind": 14,
|
|
565
|
+
"detail": "Static specifier keyword",
|
|
566
|
+
"documentation": { "value": "Specifies static storage duration or class-level member.\n\n```cpp\nstatic int count = 0; // file/function scope\nclass C { static int val; }; // shared across instances\n```" },
|
|
567
|
+
"insertText": "static",
|
|
568
|
+
"insertTextRules": 0,
|
|
569
|
+
"sortText": "06_static"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"label": "inline",
|
|
573
|
+
"kind": 14,
|
|
574
|
+
"detail": "Inline specifier keyword",
|
|
575
|
+
"documentation": { "value": "Suggests inline expansion and allows multiple definitions across translation units.\n\n```cpp\ninline int square(int x) { return x * x; }\ninline constexpr int val = 42; // inline variable (C++17)\n```" },
|
|
576
|
+
"insertText": "inline",
|
|
577
|
+
"insertTextRules": 0,
|
|
578
|
+
"sortText": "06_inline"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"label": "noexcept",
|
|
582
|
+
"kind": 14,
|
|
583
|
+
"detail": "No-exception specifier",
|
|
584
|
+
"documentation": { "value": "Specifies that a function does not throw exceptions.\n\n```cpp\nvoid func() noexcept;\nvoid cond_func() noexcept(sizeof(int) >= 4);\nbool is_ne = noexcept(func()); // operator form\n```" },
|
|
585
|
+
"insertText": "noexcept",
|
|
586
|
+
"insertTextRules": 0,
|
|
587
|
+
"sortText": "06_noexcept"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"label": "explicit",
|
|
591
|
+
"kind": 14,
|
|
592
|
+
"detail": "Explicit specifier keyword",
|
|
593
|
+
"documentation": { "value": "Prevents implicit conversions or copy-initialization for constructors.\n\n```cpp\nclass Foo {\npublic:\n explicit Foo(int x);\n explicit operator bool() const;\n};\n```" },
|
|
594
|
+
"insertText": "explicit",
|
|
595
|
+
"insertTextRules": 0,
|
|
596
|
+
"sortText": "06_explicit"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"label": "mutable",
|
|
600
|
+
"kind": 14,
|
|
601
|
+
"detail": "Mutable specifier keyword",
|
|
602
|
+
"documentation": { "value": "Allows modification of a member even in a const context.\n\n```cpp\nclass Cache {\n mutable std::map<int, int> cache_;\npublic:\n int get(int key) const { cache_[key]++; return cache_[key]; }\n};\n```" },
|
|
603
|
+
"insertText": "mutable",
|
|
604
|
+
"insertTextRules": 0,
|
|
605
|
+
"sortText": "06_mutable"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"label": "friend",
|
|
609
|
+
"kind": 14,
|
|
610
|
+
"detail": "Friend declaration keyword",
|
|
611
|
+
"documentation": { "value": "Grants a function or class access to private/protected members.\n\n```cpp\nclass MyClass {\n friend class OtherClass;\n friend std::ostream& operator<<(std::ostream&, const MyClass&);\n};\n```" },
|
|
612
|
+
"insertText": "friend",
|
|
613
|
+
"insertTextRules": 0,
|
|
614
|
+
"sortText": "06_friend"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"label": "using",
|
|
618
|
+
"kind": 14,
|
|
619
|
+
"detail": "Using declaration/directive",
|
|
620
|
+
"documentation": { "value": "Introduces names from namespaces or creates type aliases.\n\n```cpp\nusing std::cout;\nusing namespace std;\nusing StringVec = std::vector<std::string>;\ntemplate<typename T> using Vec = std::vector<T>;\n```" },
|
|
621
|
+
"insertText": "using",
|
|
622
|
+
"insertTextRules": 0,
|
|
623
|
+
"sortText": "06_using"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"label": "decltype",
|
|
627
|
+
"kind": 14,
|
|
628
|
+
"detail": "Decltype specifier",
|
|
629
|
+
"documentation": { "value": "Yields the type of an expression at compile time.\n\n```cpp\nint x = 42;\ndecltype(x) y = 10; // int\ndecltype(auto) z = x; // int\n```" },
|
|
630
|
+
"insertText": "decltype(${1:expr})",
|
|
631
|
+
"insertTextRules": 4,
|
|
632
|
+
"sortText": "06_decltype"
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
"label": "nullptr",
|
|
636
|
+
"kind": 14,
|
|
637
|
+
"detail": "Null pointer literal",
|
|
638
|
+
"documentation": { "value": "The null pointer literal (type `std::nullptr_t`).\n\n```cpp\nint* p = nullptr;\nif (p == nullptr) { /* ... */ }\nvoid func(int*); func(nullptr);\n```" },
|
|
639
|
+
"insertText": "nullptr",
|
|
640
|
+
"insertTextRules": 0,
|
|
641
|
+
"sortText": "06_nullptr"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"label": "static_cast",
|
|
645
|
+
"kind": 14,
|
|
646
|
+
"detail": "Static cast operator",
|
|
647
|
+
"documentation": { "value": "Performs compile-time checked type conversion.\n\n```cpp\ndouble d = 3.14;\nint i = static_cast<int>(d);\nBase* b = static_cast<Base*>(derived_ptr);\n```" },
|
|
648
|
+
"insertText": "static_cast<${1:Type}>(${2:expr})",
|
|
649
|
+
"insertTextRules": 4,
|
|
650
|
+
"sortText": "06_static_cast"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"label": "dynamic_cast",
|
|
654
|
+
"kind": 14,
|
|
655
|
+
"detail": "Dynamic cast operator",
|
|
656
|
+
"documentation": { "value": "Performs runtime-checked polymorphic type conversion.\n\n```cpp\nBase* b = getBase();\nDerived* d = dynamic_cast<Derived*>(b);\nif (d) { /* safe to use d */ }\n```" },
|
|
657
|
+
"insertText": "dynamic_cast<${1:Type}>(${2:expr})",
|
|
658
|
+
"insertTextRules": 4,
|
|
659
|
+
"sortText": "06_dynamic_cast"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"label": "reinterpret_cast",
|
|
663
|
+
"kind": 14,
|
|
664
|
+
"detail": "Reinterpret cast operator",
|
|
665
|
+
"documentation": { "value": "Performs low-level reinterpretation of bit patterns.\n\n```cpp\nint i = 42;\nvoid* p = reinterpret_cast<void*>(&i);\nauto fp = reinterpret_cast<void(*)(int)>(addr);\n```\n\n**Warning:** Potentially unsafe. Use only when necessary." },
|
|
666
|
+
"insertText": "reinterpret_cast<${1:Type}>(${2:expr})",
|
|
667
|
+
"insertTextRules": 4,
|
|
668
|
+
"sortText": "06_reinterpret_cast"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"label": "class definition",
|
|
672
|
+
"kind": 27,
|
|
673
|
+
"detail": "Snippet: class with constructor/destructor",
|
|
674
|
+
"documentation": { "value": "Generates a full class definition skeleton.\n\n```cpp\nclass MyClass {\npublic:\n MyClass();\n ~MyClass();\nprivate:\n int member_;\n};\n```" },
|
|
675
|
+
"insertText": "class ${1:ClassName} {\npublic:\n\t${1:ClassName}(${2:}) {\n\t\t$3\n\t}\n\n\t~${1:ClassName}() = default;\n\nprivate:\n\t${4:int member_};\n};",
|
|
676
|
+
"insertTextRules": 4,
|
|
677
|
+
"sortText": "07_class_def"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"label": "template class",
|
|
681
|
+
"kind": 27,
|
|
682
|
+
"detail": "Snippet: template class definition",
|
|
683
|
+
"documentation": { "value": "Generates a template class skeleton.\n\n```cpp\ntemplate<typename T>\nclass Container {\npublic:\n void add(const T& item);\nprivate:\n std::vector<T> items_;\n};\n```" },
|
|
684
|
+
"insertText": "template<typename ${1:T}>\nclass ${2:ClassName} {\npublic:\n\t${2:ClassName}(${3:}) {\n\t\t$4\n\t}\n\nprivate:\n\t${5:T data_};\n};",
|
|
685
|
+
"insertTextRules": 4,
|
|
686
|
+
"sortText": "07_template_class"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"label": "range-based for",
|
|
690
|
+
"kind": 15,
|
|
691
|
+
"detail": "Snippet: range-based for loop",
|
|
692
|
+
"documentation": { "value": "Generates a range-based for loop.\n\n```cpp\nfor (const auto& item : container) {\n // process item\n}\n```" },
|
|
693
|
+
"insertText": "for (const auto& ${1:item} : ${2:container}) {\n\t$0\n}",
|
|
694
|
+
"insertTextRules": 4,
|
|
695
|
+
"sortText": "07_range_for"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"label": "lambda",
|
|
699
|
+
"kind": 15,
|
|
700
|
+
"detail": "Snippet: lambda expression",
|
|
701
|
+
"documentation": { "value": "Generates a lambda expression.\n\n```cpp\nauto fn = [](int x) { return x * 2; };\nauto fn2 = [&](auto x) { return x + offset; };\n```" },
|
|
702
|
+
"insertText": "[${1:&}](${2:auto} ${3:param}) {\n\t${4:return $3;}\n}",
|
|
703
|
+
"insertTextRules": 4,
|
|
704
|
+
"sortText": "07_lambda"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"label": "try-catch",
|
|
708
|
+
"kind": 15,
|
|
709
|
+
"detail": "Snippet: try-catch block",
|
|
710
|
+
"documentation": { "value": "Generates a try-catch exception handling block.\n\n```cpp\ntry {\n // risky code\n} catch (const std::exception& e) {\n std::cerr << e.what();\n}\n```" },
|
|
711
|
+
"insertText": "try {\n\t${1:// code}\n} catch (const ${2:std::exception}& ${3:e}) {\n\t${4:std::cerr << $3.what() << std::endl;}\n}",
|
|
712
|
+
"insertTextRules": 4,
|
|
713
|
+
"sortText": "07_try_catch"
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"label": "smart pointer creation",
|
|
717
|
+
"kind": 15,
|
|
718
|
+
"detail": "Snippet: create smart pointer",
|
|
719
|
+
"documentation": { "value": "Creates a smart pointer using make_unique or make_shared.\n\n```cpp\nauto ptr = std::make_unique<MyClass>(args...);\nauto sptr = std::make_shared<MyClass>(args...);\n```" },
|
|
720
|
+
"insertText": "auto ${1:ptr} = std::make_${2|unique,shared|}<${3:Type}>(${4:args})",
|
|
721
|
+
"insertTextRules": 4,
|
|
722
|
+
"sortText": "07_smart_ptr"
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"label": "main function",
|
|
726
|
+
"kind": 15,
|
|
727
|
+
"detail": "Snippet: int main()",
|
|
728
|
+
"documentation": { "value": "Generates the main function entry point.\n\n```cpp\nint main(int argc, char* argv[]) {\n return 0;\n}\n```" },
|
|
729
|
+
"insertText": "int main(${1:int argc, char* argv[]}) {\n\t$0\n\treturn 0;\n}",
|
|
730
|
+
"insertTextRules": 4,
|
|
731
|
+
"sortText": "07_main"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"label": "co_await",
|
|
735
|
+
"kind": 14,
|
|
736
|
+
"detail": "Coroutine await expression (C++20)",
|
|
737
|
+
"documentation": { "value": "Suspends a coroutine and waits for a result.\n\n```cpp\ntask<int> fetch_data() {\n auto result = co_await async_read();\n co_return result;\n}\n```" },
|
|
738
|
+
"insertText": "co_await ${1:expr}",
|
|
739
|
+
"insertTextRules": 4,
|
|
740
|
+
"sortText": "06_co_await"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"label": "concept",
|
|
744
|
+
"kind": 14,
|
|
745
|
+
"detail": "Concept declaration (C++20)",
|
|
746
|
+
"documentation": { "value": "Defines a named set of constraints for template arguments.\n\n```cpp\ntemplate<typename T>\nconcept Addable = requires(T a, T b) {\n { a + b } -> std::convertible_to<T>;\n};\n\ntemplate<Addable T>\nT add(T a, T b) { return a + b; }\n```" },
|
|
747
|
+
"insertText": "template<typename ${1:T}>\nconcept ${2:ConceptName} = requires(${1:T} ${3:a}) {\n\t${4:{ $3.method() \\} -> std::same_as<void>};\n};",
|
|
748
|
+
"insertTextRules": 4,
|
|
749
|
+
"sortText": "06_concept"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
"label": "ranges::views",
|
|
753
|
+
"kind": 5,
|
|
754
|
+
"detail": "Ranges views (C++20)",
|
|
755
|
+
"documentation": { "value": "Composable lazy range adaptors.\n\n```cpp\n#include <ranges>\nnamespace rv = std::ranges::views;\nauto evens = v | rv::filter([](int x) { return x % 2 == 0; });\nauto squares = v | rv::transform([](int x) { return x * x; });\nauto first5 = v | rv::take(5);\n```" },
|
|
756
|
+
"insertText": "${1:container} | std::ranges::views::${2|filter,transform,take,drop,reverse|}(${3:predicate})",
|
|
757
|
+
"insertTextRules": 4,
|
|
758
|
+
"sortText": "05_ranges"
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"label": "structured bindings",
|
|
762
|
+
"kind": 15,
|
|
763
|
+
"detail": "Snippet: structured bindings (C++17)",
|
|
764
|
+
"documentation": { "value": "Decompose an object into named variables.\n\n```cpp\nauto [x, y] = std::make_pair(1, 2);\nfor (auto& [key, value] : myMap) {\n std::cout << key << \": \" << value;\n}\n```" },
|
|
765
|
+
"insertText": "auto [${1:a}, ${2:b}] = ${3:expr}",
|
|
766
|
+
"insertTextRules": 4,
|
|
767
|
+
"sortText": "07_structured_bindings"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"label": "#include",
|
|
771
|
+
"kind": 15,
|
|
772
|
+
"detail": "Snippet: include header",
|
|
773
|
+
"documentation": { "value": "Include a header file.\n\n```cpp\n#include <iostream>\n#include <vector>\n#include \"myheader.h\"\n```" },
|
|
774
|
+
"insertText": "#include <${1:iostream}>",
|
|
775
|
+
"insertTextRules": 4,
|
|
776
|
+
"sortText": "07_include"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"label": "enum class",
|
|
780
|
+
"kind": 15,
|
|
781
|
+
"detail": "Snippet: scoped enumeration",
|
|
782
|
+
"documentation": { "value": "Declares a scoped (strongly-typed) enumeration.\n\n```cpp\nenum class Color : uint8_t {\n Red,\n Green,\n Blue\n};\nColor c = Color::Red;\n```" },
|
|
783
|
+
"insertText": "enum class ${1:Name} {\n\t${2:Value1},\n\t${3:Value2},\n\t${4:Value3}\n};",
|
|
784
|
+
"insertTextRules": 4,
|
|
785
|
+
"sortText": "07_enum_class"
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"label": "static_assert",
|
|
789
|
+
"kind": 14,
|
|
790
|
+
"detail": "Compile-time assertion",
|
|
791
|
+
"documentation": { "value": "Asserts a condition at compile time.\n\n```cpp\nstatic_assert(sizeof(int) >= 4, \"int must be at least 4 bytes\");\nstatic_assert(std::is_integral_v<int>);\n```" },
|
|
792
|
+
"insertText": "static_assert(${1:condition}, \"${2:message}\")",
|
|
793
|
+
"insertTextRules": 4,
|
|
794
|
+
"sortText": "06_static_assert"
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"label": "std::thread",
|
|
798
|
+
"kind": 6,
|
|
799
|
+
"detail": "Thread of execution",
|
|
800
|
+
"documentation": { "value": "Manages a separate thread of execution.\n\n```cpp\n#include <thread>\nstd::thread t([]{ std::cout << \"Hello from thread\"; });\nt.join();\n// or t.detach();\n```" },
|
|
801
|
+
"insertText": "std::thread ${1:t}(${2:callable})",
|
|
802
|
+
"insertTextRules": 4,
|
|
803
|
+
"sortText": "05_thread"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"label": "std::mutex",
|
|
807
|
+
"kind": 6,
|
|
808
|
+
"detail": "Mutual exclusion",
|
|
809
|
+
"documentation": { "value": "Provides mutual exclusion for protecting shared data.\n\n```cpp\n#include <mutex>\nstd::mutex mtx;\n{\n std::lock_guard<std::mutex> lock(mtx);\n // critical section\n}\n```" },
|
|
810
|
+
"insertText": "std::mutex ${1:mtx}",
|
|
811
|
+
"insertTextRules": 4,
|
|
812
|
+
"sortText": "05_mutex"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"label": "std::lock_guard",
|
|
816
|
+
"kind": 6,
|
|
817
|
+
"detail": "RAII mutex lock",
|
|
818
|
+
"documentation": { "value": "RAII wrapper that locks a mutex on construction and unlocks on destruction.\n\n```cpp\nstd::mutex mtx;\n{\n std::lock_guard<std::mutex> lock(mtx);\n // safe access to shared data\n}\n```" },
|
|
819
|
+
"insertText": "std::lock_guard<std::mutex> ${1:lock}(${2:mtx})",
|
|
820
|
+
"insertTextRules": 4,
|
|
821
|
+
"sortText": "05_lock_guard"
|
|
822
|
+
}
|
|
823
|
+
]
|
|
824
|
+
}
|