forked from withfig/autocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
code.ts
254 lines (251 loc) ยท 6.54 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
const commonOptions: Fig.Option[] = [
{
name: ["-d", "--diff"],
description: "Compare two files with each other.",
args: [
{
name: "file",
template: "filepaths",
},
{
name: "file",
template: "filepaths",
},
],
},
{
name: ["-a", "--add"],
description: "Add folder(s) to the last active window",
args: {
name: "folder",
template: "folders",
variadic: 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: ["-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: "--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: "--show-versions",
description:
"Show versions of installed extensions, when using --list-extensions.",
},
{
name: "--install-extension",
description:
"Installs or updates the extension. The identifier of an extension is always `${publisher}.${name}\n\nUse `--force` argument to update to latest version. To install a specific version provide `@${version}`. For example: '[email protected]'.",
args: {
// TODO: Create extension ID generator
name: "extension-id[@version] | path-to-vsix",
},
},
{
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",
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: "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.",
},
];
export const completionSpec: Fig.Spec = {
name: "code",
description: "Visual Studio Code",
args: {
template: ["filepaths", "folders"],
},
options: [
...commonOptions,
...extensionManagementOptions,
...troubleshootingOptions,
],
};