-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathcode.ts
299 lines (295 loc) · 7.75 KB
/
code.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
const commonOptions: Fig.Option[] = [
{
name: "-",
description: "Read from stdin (e.g. 'ps aux | grep code | code -')",
},
{
name: ["-d", "--diff"],
description: "Compare two files with each other",
args: [
{
name: "file",
template: "filepaths",
},
{
name: "file",
template: "filepaths",
},
],
},
{
name: ["-m", "--merge"],
description:
"Perform a three-way merge by providing paths for two modified versions of a file, the common origin of both modified versions and the output file to save merge results",
args: [
{
name: "path1",
template: "filepaths",
},
{
name: "path2",
template: "filepaths",
},
{
name: "base",
template: "filepaths",
},
{
name: "result",
template: "filepaths",
},
],
},
{
name: ["-a", "--add"],
description: "Add folder(s) to the last active window",
args: {
name: "folder",
template: "folders",
isVariadic: true,
},
},
{
name: ["-g", "--goto"],
description:
"Open a file at the path on the specified line and character position",
args: {
name: "file:line[:character]",
// TODO: Support :line[:character] completion?
template: "filepaths",
},
},
{
name: ["-n", "--new-window"],
description: "Force to open a new window",
},
{
name: ["-r", "--reuse-window"],
description: "Force to open a file or folder in an already opened window",
},
{
name: ["-w", "--wait"],
description: "Wait for the files to be closed before returning",
},
{
name: "--locale",
description: "The locale to use (e.g. en-US or zh-TW)",
args: {
name: "locale",
suggestions: [
// Supported locales: https://code.visualstudio.com/docs/getstarted/locales#_available-locales
{ name: "en", icon: "🇺🇸", description: "English (US)" },
{ name: "zh-CN", icon: "🇨🇳", description: "Simplified Chinese" },
{ name: "zh-TW", icon: "🇹🇼", description: "Traditional Chinese" },
{ name: "fr", icon: "🇫🇷", description: "French" },
{ name: "de", icon: "🇩🇪", description: "German" },
{ name: "it", icon: "🇮🇹", description: "Italian" },
{ name: "es", icon: "🇪🇸", description: "Spanish" },
{ name: "ja", icon: "🇯🇵", description: "Japanese" },
{ name: "ko", icon: "🇰🇷", description: "Korean" },
{ name: "ru", icon: "🇷🇺", description: "Russian" },
{ name: "bg", icon: "🇧🇬", description: "Bulgarian" },
{ name: "hu", icon: "🇭🇺", description: "Hungarian" },
{ name: "pt-br", icon: "🇧🇷", description: "Portuguese (Brazil)" },
{ name: "tr", icon: "🇹🇷", description: "Turkish" },
],
},
},
{
name: "--user-data-dir",
description:
"Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code",
args: {
name: "dir",
template: "folders",
},
},
{
name: "--profile",
description:
"Opens the provided folder or workspace with the given profile and associates the profile with the workspace. If the profile does not exist, a new empty one is created. A folder or workspace must be provided for the profile to take effect",
args: {
name: "settingsProfileName",
},
},
{
name: ["-h", "--help"],
description: "Print usage",
},
];
const extensionManagementOptions: Fig.Option[] = [
{
name: "--extensions-dir",
description: "Set the root path for extensions",
args: {
name: "dir",
template: "folders",
},
},
{
name: "--list-extensions",
description: "List the installed extensions",
},
{
name: "--show-versions",
description:
"Show versions of installed extensions, when using --list-extensions",
},
{
name: "--category",
description:
"Filters installed extensions by provided category, when using --list-extensions",
args: {
name: "category",
suggestions: [
"azure",
"data science",
"debuggers",
"extension packs",
"education",
"formatters",
"keymaps",
"language packs",
"linters",
"machine learning",
"notebooks",
"programming languages",
"scm providers",
"snippets",
"testing",
"themes",
"visualization",
"other",
],
},
},
{
name: "--install-extension",
description:
"Installs or updates an extension. The argument is either an extension id or a path to a VSIX. The identifier of an extension is '${publisher}.${name}'. Use '--force' argument to update to latest version. To install a specific version provide '@${version}'. For example: 'vscode.csharp@1.2.3'",
args: {
// TODO: Create extension ID generator
name: "extension-id[@version] | path-to-vsix",
},
},
{
name: "--pre-release",
description:
"Installs the pre-release version of the extension, when using --install-extension",
},
{
name: "--uninstall-extension",
description: "Uninstalls an extension",
args: {
// TODO: Create extension ID generator
name: "extension-id",
},
},
{
name: "--enable-proposed-api",
description:
"Enables proposed API features for extensions. Can receive one or more extension IDs to enable individually",
},
];
const troubleshootingOptions: Fig.Option[] = [
{
name: ["-v", "--version"],
description: "Print version",
},
{
name: "--verbose",
description: "Print verbose output (implies --wait)",
},
{
name: "--log",
description: "Log level to use. Default is 'info' when unspecified",
args: {
name: "level",
default: "info",
suggestions: [
"critical",
"error",
"warn",
"info",
"debug",
"trace",
"off",
],
},
},
{
name: ["-s", "--status"],
description: "Print process usage and diagnostics information",
},
{
name: "--prof-startup",
description: "Run CPU profiler during startup",
},
{
name: "--disable-extensions",
description: "Disable all installed extensions",
},
{
name: "--disable-extension",
description: "Disable an extension",
args: {
// TODO: Create extension ID generator
name: "extension-id",
},
},
{
name: "--sync",
description: "Turn sync on or off",
args: {
name: "sync",
description: "Whether to enable sync",
suggestions: ["on", "off"],
},
},
{
name: "--inspect-extensions",
description:
"Allow debugging and profiling of extensions. Check the developer tools for the connection URI",
args: {
name: "port",
},
},
{
name: "--inspect-brk-extensions",
description:
"Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection URI",
args: {
name: "port",
},
},
{
name: "--disable-gpu",
description: "Disable GPU hardware acceleration",
},
{
name: "--max-memory",
description: "Max memory size for a window (in Mbytes)",
args: {
name: "memory",
description: "Memory in megabytes",
},
},
{
name: "--telemetry",
description: "Shows all telemetry events which VS code collects",
},
];
const completionSpec: Fig.Spec = {
name: "code",
description: "Visual Studio Code",
args: {
template: ["filepaths", "folders"],
isVariadic: true,
},
options: [
...commonOptions,
...extensionManagementOptions,
...troubleshootingOptions,
],
};
export default completionSpec;