@theia/plugin 1.53.0-next.4 → 1.53.0-next.55
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/README.md +766 -766
- package/package.json +3 -3
- package/src/package.spec.ts +28 -28
- package/src/theia-extra.d.ts +410 -410
- package/src/theia.d.ts +18078 -17684
- package/src/theia.proposed.canonicalUriProvider.d.ts +64 -64
- package/src/theia.proposed.customEditorMove.d.ts +41 -41
- package/src/theia.proposed.debugVisualization.d.ts +189 -189
- package/src/theia.proposed.diffCommand.d.ts +55 -55
- package/src/theia.proposed.documentPaste.d.ts +316 -316
- package/src/theia.proposed.editSessionIdentityProvider.d.ts +89 -89
- package/src/theia.proposed.extensionsAny.d.ts +57 -57
- package/src/theia.proposed.externalUriOpener.d.ts +158 -158
- package/src/theia.proposed.findTextInFiles.d.ts +178 -178
- package/src/theia.proposed.fsChunks.d.ts +32 -32
- package/src/theia.proposed.mappedEditsProvider.d.ts +59 -59
- package/src/theia.proposed.multiDocumentHighlightProvider.ts +82 -82
- package/src/theia.proposed.notebookCellExecutionState.d.ts +68 -68
- package/src/theia.proposed.notebookKernelSource.d.ts +62 -62
- package/src/theia.proposed.notebookMessaging.d.ts +84 -84
- package/src/theia.proposed.portsAttributes.d.ts +115 -115
- package/src/theia.proposed.profileContentHandlers.d.ts +35 -35
- package/src/theia.proposed.resolvers.d.ts +44 -44
- package/src/theia.proposed.scmValidation.d.ts +70 -70
- package/src/theia.proposed.shareProvider.d.ts +92 -92
- package/src/theia.proposed.terminalQuickFixProvider.d.ts +103 -103
- package/src/theia.proposed.textSearchProvider.d.ts +145 -145
- package/src/theia.proposed.timeline.d.ts +177 -177
package/src/theia-extra.d.ts
CHANGED
|
@@ -1,410 +1,410 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2022 Ericsson and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* This is the place for extra APIs Theia supports compared to VS Code.
|
|
21
|
-
*/
|
|
22
|
-
export module '@theia/plugin' {
|
|
23
|
-
|
|
24
|
-
export interface WebviewPanel {
|
|
25
|
-
/**
|
|
26
|
-
* Show the webview panel according to a given options.
|
|
27
|
-
*
|
|
28
|
-
* A webview panel may only show in a single column at a time. If it is already showing, this
|
|
29
|
-
* method moves it to a new column.
|
|
30
|
-
*
|
|
31
|
-
* @param area target area where webview panel will be resided. Shows in the 'WebviewPanelTargetArea.Main' area if undefined.
|
|
32
|
-
* @param viewColumn View column to show the panel in. Shows in the current `viewColumn` if undefined.
|
|
33
|
-
* @param preserveFocus When `true`, the webview will not take focus.
|
|
34
|
-
*/
|
|
35
|
-
reveal(area?: WebviewPanelTargetArea, viewColumn?: ViewColumn, preserveFocus?: boolean): void;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export type PluginType = 'frontend' | 'backend';
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Namespace for dealing with installed plug-ins. Plug-ins are represented
|
|
42
|
-
* by an [plug-in](#Plugin)-interface which enables reflection on them.
|
|
43
|
-
*
|
|
44
|
-
* Plug-in writers can provide APIs to other plug-ins by returning their API public
|
|
45
|
-
* surface from the `start`-call.
|
|
46
|
-
*
|
|
47
|
-
* ```javascript
|
|
48
|
-
* export function start() {
|
|
49
|
-
* let api = {
|
|
50
|
-
* sum(a, b) {
|
|
51
|
-
* return a + b;
|
|
52
|
-
* },
|
|
53
|
-
* mul(a, b) {
|
|
54
|
-
* return a * b;
|
|
55
|
-
* }
|
|
56
|
-
* };
|
|
57
|
-
* // 'export' public api-surface
|
|
58
|
-
* return api;
|
|
59
|
-
* }
|
|
60
|
-
* ```
|
|
61
|
-
* ```javascript
|
|
62
|
-
* let mathExt = plugins.getPlugin('genius.math');
|
|
63
|
-
* let importedApi = mathExt.exports;
|
|
64
|
-
*
|
|
65
|
-
* console.log(importedApi.mul(42, 1));
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
export namespace plugins {
|
|
69
|
-
/**
|
|
70
|
-
* Get an plug-in by its full identifier in the form of: `publisher.name`.
|
|
71
|
-
*
|
|
72
|
-
* @param pluginId An plug-in identifier.
|
|
73
|
-
* @return An plug-in or `undefined`.
|
|
74
|
-
*/
|
|
75
|
-
export function getPlugin(pluginId: string): Plugin<any> | undefined;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Get an plug-in its full identifier in the form of: `publisher.name`.
|
|
79
|
-
*
|
|
80
|
-
* @param pluginId An plug-in identifier.
|
|
81
|
-
* @return An plug-in or `undefined`.
|
|
82
|
-
*/
|
|
83
|
-
export function getPlugin<T>(pluginId: string): Plugin<T> | undefined;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* All plug-ins currently known to the system.
|
|
87
|
-
*/
|
|
88
|
-
export let all: Plugin<any>[];
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* An event which fires when `plugins.all` changes. This can happen when extensions are
|
|
92
|
-
* installed, uninstalled, enabled or disabled.
|
|
93
|
-
*/
|
|
94
|
-
export let onDidChange: Event<void>;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Represents an plugin.
|
|
99
|
-
*
|
|
100
|
-
* To get an instance of an `Plugin` use {@link plugins.getPlugin getPlugin}.
|
|
101
|
-
*/
|
|
102
|
-
export interface Plugin<T> {
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* The canonical plug-in identifier in the form of: `publisher.name`.
|
|
106
|
-
*/
|
|
107
|
-
readonly id: string;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* The absolute file path of the directory containing this plug-in.
|
|
111
|
-
*/
|
|
112
|
-
readonly pluginPath: string;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* The uri of the directory containing this plug-in.
|
|
116
|
-
*/
|
|
117
|
-
readonly pluginUri: Uri;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* `true` if the plug-in has been activated.
|
|
121
|
-
*/
|
|
122
|
-
readonly isActive: boolean;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* The parsed contents of the plug-in's package.json.
|
|
126
|
-
*/
|
|
127
|
-
readonly packageJSON: any;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
*
|
|
131
|
-
*/
|
|
132
|
-
readonly pluginType: PluginType;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* The public API exported by this plug-in. It is an invalid action
|
|
136
|
-
* to access this field before this plug-in has been activated.
|
|
137
|
-
*/
|
|
138
|
-
readonly exports: T;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Activates this plug-in and returns its public API.
|
|
142
|
-
*
|
|
143
|
-
* @return A promise that will resolve when this plug-in has been activated.
|
|
144
|
-
*/
|
|
145
|
-
activate(): Thenable<T>;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* A plug-in context is a collection of utilities private to a
|
|
150
|
-
* plug-in.
|
|
151
|
-
*
|
|
152
|
-
* An instance of a `PluginContext` is provided as the first
|
|
153
|
-
* parameter to the `start` of a plug-in.
|
|
154
|
-
*/
|
|
155
|
-
export interface PluginContext {
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* An array to which disposables can be added. When this
|
|
159
|
-
* extension is deactivated the disposables will be disposed.
|
|
160
|
-
*/
|
|
161
|
-
subscriptions: { dispose(): any }[];
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* A memento object that stores state in the context
|
|
165
|
-
* of the currently opened {@link workspace.workspaceFolders workspace}.
|
|
166
|
-
*/
|
|
167
|
-
workspaceState: Memento;
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* A memento object that stores state independent
|
|
171
|
-
* of the current opened {@link workspace.workspaceFolders workspace}.
|
|
172
|
-
*/
|
|
173
|
-
globalState: Memento & {
|
|
174
|
-
/**
|
|
175
|
-
* Set the keys whose values should be synchronized across devices when synchronizing user-data
|
|
176
|
-
* like configuration, extensions, and mementos.
|
|
177
|
-
*
|
|
178
|
-
* Note that this function defines the whole set of keys whose values are synchronized:
|
|
179
|
-
* - calling it with an empty array stops synchronization for this memento
|
|
180
|
-
* - calling it with a non-empty array replaces all keys whose values are synchronized
|
|
181
|
-
*
|
|
182
|
-
* For any given set of keys this function needs to be called only once but there is no harm in
|
|
183
|
-
* repeatedly calling it.
|
|
184
|
-
*
|
|
185
|
-
* @param keys The set of keys whose values are synced.
|
|
186
|
-
*/
|
|
187
|
-
setKeysForSync(keys: readonly string[]): void;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* A storage utility for secrets.
|
|
192
|
-
*/
|
|
193
|
-
readonly secrets: SecretStorage;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* The absolute file path of the directory containing the extension.
|
|
197
|
-
*/
|
|
198
|
-
extensionPath: string;
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* The uri of the directory containing the extension.
|
|
202
|
-
*/
|
|
203
|
-
readonly extensionUri: Uri;
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Gets the extension's environment variable collection for this workspace, enabling changes
|
|
207
|
-
* to be applied to terminal environment variables.
|
|
208
|
-
*/
|
|
209
|
-
readonly environmentVariableCollection: EnvironmentVariableCollection;
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Get the absolute path of a resource contained in the extension.
|
|
213
|
-
*
|
|
214
|
-
* @param relativePath A relative path to a resource contained in the extension.
|
|
215
|
-
* @return The absolute path of the resource.
|
|
216
|
-
*/
|
|
217
|
-
asAbsolutePath(relativePath: string): string;
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* An absolute file path of a workspace specific directory in which the extension
|
|
221
|
-
* can store private state. The directory might not exist on disk and creation is
|
|
222
|
-
* up to the extension. However, the parent directory is guaranteed to be existent.
|
|
223
|
-
*
|
|
224
|
-
* Use [`workspaceState`](#PluginContext.workspaceState) or
|
|
225
|
-
* [`globalState`](#PluginContext.globalState) to store key value data.
|
|
226
|
-
*
|
|
227
|
-
* @deprecated Use {@link PluginContext.storageUri storageUri} instead.
|
|
228
|
-
*/
|
|
229
|
-
storagePath: string | undefined;
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* The uri of a workspace specific directory in which the extension
|
|
233
|
-
* can store private state. The directory might not exist and creation is
|
|
234
|
-
* up to the extension. However, the parent directory is guaranteed to be existent.
|
|
235
|
-
* The value is `undefined` when no workspace nor folder has been opened.
|
|
236
|
-
*
|
|
237
|
-
* Use [`workspaceState`](#PluginContext.workspaceState) or
|
|
238
|
-
* [`globalState`](#PluginContext.globalState) to store key value data.
|
|
239
|
-
*
|
|
240
|
-
* @see [`workspace.fs`](#FileSystem) for how to read and write files and folders from
|
|
241
|
-
* an uri.
|
|
242
|
-
*/
|
|
243
|
-
readonly storageUri: Uri | undefined;
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* An absolute file path in which the extension can store global state.
|
|
247
|
-
* The directory might not exist on disk and creation is
|
|
248
|
-
* up to the extension. However, the parent directory is guaranteed to be existent.
|
|
249
|
-
*
|
|
250
|
-
* Use [`globalState`](#PluginContext.globalState) to store key value data.
|
|
251
|
-
*
|
|
252
|
-
* @deprecated Use {@link PluginContext.globalStorageUri globalStorageUri} instead.
|
|
253
|
-
*/
|
|
254
|
-
readonly globalStoragePath: string;
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* The uri of a directory in which the extension can store global state.
|
|
258
|
-
* The directory might not exist on disk and creation is
|
|
259
|
-
* up to the extension. However, the parent directory is guaranteed to be existent.
|
|
260
|
-
*
|
|
261
|
-
* Use [`globalState`](#PluginContext.globalState) to store key value data.
|
|
262
|
-
*
|
|
263
|
-
* @see [`workspace.fs`](#FileSystem) for how to read and write files and folders from
|
|
264
|
-
* an uri.
|
|
265
|
-
*/
|
|
266
|
-
readonly globalStorageUri: Uri;
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* An absolute file path of a directory in which the extension can create log files.
|
|
270
|
-
* The directory might not exist on disk and creation is up to the extension. However,
|
|
271
|
-
* the parent directory is guaranteed to be existent.
|
|
272
|
-
*/
|
|
273
|
-
readonly logPath: string;
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* The mode the extension is running in. This is specific to the current
|
|
277
|
-
* extension. One extension may be in `ExtensionMode.Development` while
|
|
278
|
-
* other extensions in the host run in `ExtensionMode.Release`.
|
|
279
|
-
*/
|
|
280
|
-
readonly extensionMode: ExtensionMode;
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* The current extension instance.
|
|
284
|
-
*/
|
|
285
|
-
readonly extension: Plugin<any> | undefined;
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* The uri of a directory in which the extension can create log files. The directory might
|
|
289
|
-
* not exist on disk and creation is up to the extension. However, the parent directory is
|
|
290
|
-
* guaranteed to be existent.
|
|
291
|
-
* see - workspace.fs for how to read and write files and folders from an uri.
|
|
292
|
-
*/
|
|
293
|
-
readonly logUri: Uri;
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* An object that keeps information about how this extension can use language models.
|
|
297
|
-
*
|
|
298
|
-
* @see {@link LanguageModelChat.sendRequest}
|
|
299
|
-
*/
|
|
300
|
-
readonly languageModelAccessInformation: LanguageModelAccessInformation;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
export namespace commands {
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Get the keybindings associated to commandId.
|
|
307
|
-
* @param commandId The ID of the command for which we are looking for keybindings.
|
|
308
|
-
*/
|
|
309
|
-
export function getKeyBinding(commandId: string): Thenable<CommandKeyBinding[] | undefined>;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Key Binding of a command
|
|
314
|
-
*/
|
|
315
|
-
export interface CommandKeyBinding {
|
|
316
|
-
/**
|
|
317
|
-
* Identifier of the command.
|
|
318
|
-
*/
|
|
319
|
-
id: string;
|
|
320
|
-
/**
|
|
321
|
-
* Value of the keyBinding
|
|
322
|
-
*/
|
|
323
|
-
value: string;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* Enumeration of the supported operating systems.
|
|
328
|
-
*/
|
|
329
|
-
export enum OperatingSystem {
|
|
330
|
-
Windows = 'Windows',
|
|
331
|
-
Linux = 'Linux',
|
|
332
|
-
OSX = 'OSX'
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
export namespace env {
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Returns the type of the operating system on the client side (like browser'OS if using browser mode). If it is neither [Windows](isWindows) nor [OS X](isOSX), then
|
|
339
|
-
* it always return with the `Linux` OS type.
|
|
340
|
-
*/
|
|
341
|
-
export function getClientOperatingSystem(): Thenable<OperatingSystem>;
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
export interface DecorationData {
|
|
346
|
-
letter?: string;
|
|
347
|
-
title?: string;
|
|
348
|
-
color?: ThemeColor;
|
|
349
|
-
priority?: number;
|
|
350
|
-
bubble?: boolean;
|
|
351
|
-
source?: string;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
export interface SourceControl {
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Whether the source control is selected.
|
|
358
|
-
*/
|
|
359
|
-
readonly selected: boolean;
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* An event signaling when the selection state changes.
|
|
363
|
-
*/
|
|
364
|
-
readonly onDidChangeSelection: Event<boolean>;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
export interface SourceControlResourceDecorations {
|
|
368
|
-
source?: string;
|
|
369
|
-
letter?: string;
|
|
370
|
-
color?: ThemeColor;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
export interface TerminalObserver {
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* A regex to match against the latest terminal output.
|
|
377
|
-
*/
|
|
378
|
-
readonly outputMatcherRegex: string;
|
|
379
|
-
/**
|
|
380
|
-
* The maximum number of lines to match the regex against. Maximum is 40 lines.
|
|
381
|
-
*/
|
|
382
|
-
readonly nrOfLinesToMatch: number;
|
|
383
|
-
/**
|
|
384
|
-
* Invoked when the regex matched against the terminal contents.
|
|
385
|
-
* @param groups The matched groups
|
|
386
|
-
*/
|
|
387
|
-
matchOccurred(groups: string[]): void;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
export namespace window {
|
|
391
|
-
export function registerTerminalObserver(observer: TerminalObserver): Disposable;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise,
|
|
397
|
-
* and others. This API makes no assumption about what promise library is being used which
|
|
398
|
-
* enables reusing existing code without migrating to a specific promise implementation. Still,
|
|
399
|
-
* we recommend the use of native promises which are available in this editor.
|
|
400
|
-
*/
|
|
401
|
-
interface Thenable<T> {
|
|
402
|
-
/**
|
|
403
|
-
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
|
404
|
-
* @param onfulfilled The callback to execute when the Promise is resolved.
|
|
405
|
-
* @param onrejected The callback to execute when the Promise is rejected.
|
|
406
|
-
* @returns A Promise for the completion of which ever callback is executed.
|
|
407
|
-
*/
|
|
408
|
-
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
|
|
409
|
-
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
|
|
410
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2022 Ericsson and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* This is the place for extra APIs Theia supports compared to VS Code.
|
|
21
|
+
*/
|
|
22
|
+
export module '@theia/plugin' {
|
|
23
|
+
|
|
24
|
+
export interface WebviewPanel {
|
|
25
|
+
/**
|
|
26
|
+
* Show the webview panel according to a given options.
|
|
27
|
+
*
|
|
28
|
+
* A webview panel may only show in a single column at a time. If it is already showing, this
|
|
29
|
+
* method moves it to a new column.
|
|
30
|
+
*
|
|
31
|
+
* @param area target area where webview panel will be resided. Shows in the 'WebviewPanelTargetArea.Main' area if undefined.
|
|
32
|
+
* @param viewColumn View column to show the panel in. Shows in the current `viewColumn` if undefined.
|
|
33
|
+
* @param preserveFocus When `true`, the webview will not take focus.
|
|
34
|
+
*/
|
|
35
|
+
reveal(area?: WebviewPanelTargetArea, viewColumn?: ViewColumn, preserveFocus?: boolean): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type PluginType = 'frontend' | 'backend';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Namespace for dealing with installed plug-ins. Plug-ins are represented
|
|
42
|
+
* by an [plug-in](#Plugin)-interface which enables reflection on them.
|
|
43
|
+
*
|
|
44
|
+
* Plug-in writers can provide APIs to other plug-ins by returning their API public
|
|
45
|
+
* surface from the `start`-call.
|
|
46
|
+
*
|
|
47
|
+
* ```javascript
|
|
48
|
+
* export function start() {
|
|
49
|
+
* let api = {
|
|
50
|
+
* sum(a, b) {
|
|
51
|
+
* return a + b;
|
|
52
|
+
* },
|
|
53
|
+
* mul(a, b) {
|
|
54
|
+
* return a * b;
|
|
55
|
+
* }
|
|
56
|
+
* };
|
|
57
|
+
* // 'export' public api-surface
|
|
58
|
+
* return api;
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
* ```javascript
|
|
62
|
+
* let mathExt = plugins.getPlugin('genius.math');
|
|
63
|
+
* let importedApi = mathExt.exports;
|
|
64
|
+
*
|
|
65
|
+
* console.log(importedApi.mul(42, 1));
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export namespace plugins {
|
|
69
|
+
/**
|
|
70
|
+
* Get an plug-in by its full identifier in the form of: `publisher.name`.
|
|
71
|
+
*
|
|
72
|
+
* @param pluginId An plug-in identifier.
|
|
73
|
+
* @return An plug-in or `undefined`.
|
|
74
|
+
*/
|
|
75
|
+
export function getPlugin(pluginId: string): Plugin<any> | undefined;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Get an plug-in its full identifier in the form of: `publisher.name`.
|
|
79
|
+
*
|
|
80
|
+
* @param pluginId An plug-in identifier.
|
|
81
|
+
* @return An plug-in or `undefined`.
|
|
82
|
+
*/
|
|
83
|
+
export function getPlugin<T>(pluginId: string): Plugin<T> | undefined;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* All plug-ins currently known to the system.
|
|
87
|
+
*/
|
|
88
|
+
export let all: Plugin<any>[];
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* An event which fires when `plugins.all` changes. This can happen when extensions are
|
|
92
|
+
* installed, uninstalled, enabled or disabled.
|
|
93
|
+
*/
|
|
94
|
+
export let onDidChange: Event<void>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Represents an plugin.
|
|
99
|
+
*
|
|
100
|
+
* To get an instance of an `Plugin` use {@link plugins.getPlugin getPlugin}.
|
|
101
|
+
*/
|
|
102
|
+
export interface Plugin<T> {
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The canonical plug-in identifier in the form of: `publisher.name`.
|
|
106
|
+
*/
|
|
107
|
+
readonly id: string;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The absolute file path of the directory containing this plug-in.
|
|
111
|
+
*/
|
|
112
|
+
readonly pluginPath: string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The uri of the directory containing this plug-in.
|
|
116
|
+
*/
|
|
117
|
+
readonly pluginUri: Uri;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* `true` if the plug-in has been activated.
|
|
121
|
+
*/
|
|
122
|
+
readonly isActive: boolean;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The parsed contents of the plug-in's package.json.
|
|
126
|
+
*/
|
|
127
|
+
readonly packageJSON: any;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
*
|
|
131
|
+
*/
|
|
132
|
+
readonly pluginType: PluginType;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The public API exported by this plug-in. It is an invalid action
|
|
136
|
+
* to access this field before this plug-in has been activated.
|
|
137
|
+
*/
|
|
138
|
+
readonly exports: T;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Activates this plug-in and returns its public API.
|
|
142
|
+
*
|
|
143
|
+
* @return A promise that will resolve when this plug-in has been activated.
|
|
144
|
+
*/
|
|
145
|
+
activate(): Thenable<T>;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* A plug-in context is a collection of utilities private to a
|
|
150
|
+
* plug-in.
|
|
151
|
+
*
|
|
152
|
+
* An instance of a `PluginContext` is provided as the first
|
|
153
|
+
* parameter to the `start` of a plug-in.
|
|
154
|
+
*/
|
|
155
|
+
export interface PluginContext {
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* An array to which disposables can be added. When this
|
|
159
|
+
* extension is deactivated the disposables will be disposed.
|
|
160
|
+
*/
|
|
161
|
+
subscriptions: { dispose(): any }[];
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* A memento object that stores state in the context
|
|
165
|
+
* of the currently opened {@link workspace.workspaceFolders workspace}.
|
|
166
|
+
*/
|
|
167
|
+
workspaceState: Memento;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* A memento object that stores state independent
|
|
171
|
+
* of the current opened {@link workspace.workspaceFolders workspace}.
|
|
172
|
+
*/
|
|
173
|
+
globalState: Memento & {
|
|
174
|
+
/**
|
|
175
|
+
* Set the keys whose values should be synchronized across devices when synchronizing user-data
|
|
176
|
+
* like configuration, extensions, and mementos.
|
|
177
|
+
*
|
|
178
|
+
* Note that this function defines the whole set of keys whose values are synchronized:
|
|
179
|
+
* - calling it with an empty array stops synchronization for this memento
|
|
180
|
+
* - calling it with a non-empty array replaces all keys whose values are synchronized
|
|
181
|
+
*
|
|
182
|
+
* For any given set of keys this function needs to be called only once but there is no harm in
|
|
183
|
+
* repeatedly calling it.
|
|
184
|
+
*
|
|
185
|
+
* @param keys The set of keys whose values are synced.
|
|
186
|
+
*/
|
|
187
|
+
setKeysForSync(keys: readonly string[]): void;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* A storage utility for secrets.
|
|
192
|
+
*/
|
|
193
|
+
readonly secrets: SecretStorage;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* The absolute file path of the directory containing the extension.
|
|
197
|
+
*/
|
|
198
|
+
extensionPath: string;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* The uri of the directory containing the extension.
|
|
202
|
+
*/
|
|
203
|
+
readonly extensionUri: Uri;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Gets the extension's environment variable collection for this workspace, enabling changes
|
|
207
|
+
* to be applied to terminal environment variables.
|
|
208
|
+
*/
|
|
209
|
+
readonly environmentVariableCollection: EnvironmentVariableCollection;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Get the absolute path of a resource contained in the extension.
|
|
213
|
+
*
|
|
214
|
+
* @param relativePath A relative path to a resource contained in the extension.
|
|
215
|
+
* @return The absolute path of the resource.
|
|
216
|
+
*/
|
|
217
|
+
asAbsolutePath(relativePath: string): string;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* An absolute file path of a workspace specific directory in which the extension
|
|
221
|
+
* can store private state. The directory might not exist on disk and creation is
|
|
222
|
+
* up to the extension. However, the parent directory is guaranteed to be existent.
|
|
223
|
+
*
|
|
224
|
+
* Use [`workspaceState`](#PluginContext.workspaceState) or
|
|
225
|
+
* [`globalState`](#PluginContext.globalState) to store key value data.
|
|
226
|
+
*
|
|
227
|
+
* @deprecated Use {@link PluginContext.storageUri storageUri} instead.
|
|
228
|
+
*/
|
|
229
|
+
storagePath: string | undefined;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* The uri of a workspace specific directory in which the extension
|
|
233
|
+
* can store private state. The directory might not exist and creation is
|
|
234
|
+
* up to the extension. However, the parent directory is guaranteed to be existent.
|
|
235
|
+
* The value is `undefined` when no workspace nor folder has been opened.
|
|
236
|
+
*
|
|
237
|
+
* Use [`workspaceState`](#PluginContext.workspaceState) or
|
|
238
|
+
* [`globalState`](#PluginContext.globalState) to store key value data.
|
|
239
|
+
*
|
|
240
|
+
* @see [`workspace.fs`](#FileSystem) for how to read and write files and folders from
|
|
241
|
+
* an uri.
|
|
242
|
+
*/
|
|
243
|
+
readonly storageUri: Uri | undefined;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* An absolute file path in which the extension can store global state.
|
|
247
|
+
* The directory might not exist on disk and creation is
|
|
248
|
+
* up to the extension. However, the parent directory is guaranteed to be existent.
|
|
249
|
+
*
|
|
250
|
+
* Use [`globalState`](#PluginContext.globalState) to store key value data.
|
|
251
|
+
*
|
|
252
|
+
* @deprecated Use {@link PluginContext.globalStorageUri globalStorageUri} instead.
|
|
253
|
+
*/
|
|
254
|
+
readonly globalStoragePath: string;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The uri of a directory in which the extension can store global state.
|
|
258
|
+
* The directory might not exist on disk and creation is
|
|
259
|
+
* up to the extension. However, the parent directory is guaranteed to be existent.
|
|
260
|
+
*
|
|
261
|
+
* Use [`globalState`](#PluginContext.globalState) to store key value data.
|
|
262
|
+
*
|
|
263
|
+
* @see [`workspace.fs`](#FileSystem) for how to read and write files and folders from
|
|
264
|
+
* an uri.
|
|
265
|
+
*/
|
|
266
|
+
readonly globalStorageUri: Uri;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* An absolute file path of a directory in which the extension can create log files.
|
|
270
|
+
* The directory might not exist on disk and creation is up to the extension. However,
|
|
271
|
+
* the parent directory is guaranteed to be existent.
|
|
272
|
+
*/
|
|
273
|
+
readonly logPath: string;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* The mode the extension is running in. This is specific to the current
|
|
277
|
+
* extension. One extension may be in `ExtensionMode.Development` while
|
|
278
|
+
* other extensions in the host run in `ExtensionMode.Release`.
|
|
279
|
+
*/
|
|
280
|
+
readonly extensionMode: ExtensionMode;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* The current extension instance.
|
|
284
|
+
*/
|
|
285
|
+
readonly extension: Plugin<any> | undefined;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* The uri of a directory in which the extension can create log files. The directory might
|
|
289
|
+
* not exist on disk and creation is up to the extension. However, the parent directory is
|
|
290
|
+
* guaranteed to be existent.
|
|
291
|
+
* see - workspace.fs for how to read and write files and folders from an uri.
|
|
292
|
+
*/
|
|
293
|
+
readonly logUri: Uri;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* An object that keeps information about how this extension can use language models.
|
|
297
|
+
*
|
|
298
|
+
* @see {@link LanguageModelChat.sendRequest}
|
|
299
|
+
*/
|
|
300
|
+
readonly languageModelAccessInformation: LanguageModelAccessInformation;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export namespace commands {
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Get the keybindings associated to commandId.
|
|
307
|
+
* @param commandId The ID of the command for which we are looking for keybindings.
|
|
308
|
+
*/
|
|
309
|
+
export function getKeyBinding(commandId: string): Thenable<CommandKeyBinding[] | undefined>;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Key Binding of a command
|
|
314
|
+
*/
|
|
315
|
+
export interface CommandKeyBinding {
|
|
316
|
+
/**
|
|
317
|
+
* Identifier of the command.
|
|
318
|
+
*/
|
|
319
|
+
id: string;
|
|
320
|
+
/**
|
|
321
|
+
* Value of the keyBinding
|
|
322
|
+
*/
|
|
323
|
+
value: string;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Enumeration of the supported operating systems.
|
|
328
|
+
*/
|
|
329
|
+
export enum OperatingSystem {
|
|
330
|
+
Windows = 'Windows',
|
|
331
|
+
Linux = 'Linux',
|
|
332
|
+
OSX = 'OSX'
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export namespace env {
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Returns the type of the operating system on the client side (like browser'OS if using browser mode). If it is neither [Windows](isWindows) nor [OS X](isOSX), then
|
|
339
|
+
* it always return with the `Linux` OS type.
|
|
340
|
+
*/
|
|
341
|
+
export function getClientOperatingSystem(): Thenable<OperatingSystem>;
|
|
342
|
+
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export interface DecorationData {
|
|
346
|
+
letter?: string;
|
|
347
|
+
title?: string;
|
|
348
|
+
color?: ThemeColor;
|
|
349
|
+
priority?: number;
|
|
350
|
+
bubble?: boolean;
|
|
351
|
+
source?: string;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export interface SourceControl {
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Whether the source control is selected.
|
|
358
|
+
*/
|
|
359
|
+
readonly selected: boolean;
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* An event signaling when the selection state changes.
|
|
363
|
+
*/
|
|
364
|
+
readonly onDidChangeSelection: Event<boolean>;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export interface SourceControlResourceDecorations {
|
|
368
|
+
source?: string;
|
|
369
|
+
letter?: string;
|
|
370
|
+
color?: ThemeColor;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export interface TerminalObserver {
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* A regex to match against the latest terminal output.
|
|
377
|
+
*/
|
|
378
|
+
readonly outputMatcherRegex: string;
|
|
379
|
+
/**
|
|
380
|
+
* The maximum number of lines to match the regex against. Maximum is 40 lines.
|
|
381
|
+
*/
|
|
382
|
+
readonly nrOfLinesToMatch: number;
|
|
383
|
+
/**
|
|
384
|
+
* Invoked when the regex matched against the terminal contents.
|
|
385
|
+
* @param groups The matched groups
|
|
386
|
+
*/
|
|
387
|
+
matchOccurred(groups: string[]): void;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export namespace window {
|
|
391
|
+
export function registerTerminalObserver(observer: TerminalObserver): Disposable;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise,
|
|
397
|
+
* and others. This API makes no assumption about what promise library is being used which
|
|
398
|
+
* enables reusing existing code without migrating to a specific promise implementation. Still,
|
|
399
|
+
* we recommend the use of native promises which are available in this editor.
|
|
400
|
+
*/
|
|
401
|
+
interface Thenable<T> {
|
|
402
|
+
/**
|
|
403
|
+
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
|
404
|
+
* @param onfulfilled The callback to execute when the Promise is resolved.
|
|
405
|
+
* @param onrejected The callback to execute when the Promise is rejected.
|
|
406
|
+
* @returns A Promise for the completion of which ever callback is executed.
|
|
407
|
+
*/
|
|
408
|
+
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
|
|
409
|
+
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
|
|
410
|
+
}
|