@theia/plugin 1.32.0-next.3 → 1.32.0-next.31
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 +5 -2
- package/package.json +2 -2
- package/src/theia-extra.d.ts +261 -0
- package/src/theia.d.ts +190 -158
package/README.md
CHANGED
|
@@ -490,19 +490,22 @@ In case if a few providers are registered the chain will be executed until one o
|
|
|
490
490
|
To contribute a hover it is only needed to provide a function that can be called with a `TextDocument` and a `Position` returning hover info. Registration is done using a document selector which either a language id ('typescript', 'javascript' etc.) or a more complex filter like `{scheme: 'file', language: 'typescript'}`.
|
|
491
491
|
|
|
492
492
|
For example,
|
|
493
|
+
|
|
493
494
|
```typescript
|
|
494
495
|
theia.languages.registerHoverProvider('typescript', {
|
|
495
|
-
provideHover(doc: theia.TextDocument, position: theia.Position) {
|
|
496
|
+
provideHover(doc: theia.TextDocument, position: theia.Position, token: theia.CancellationToken) {
|
|
496
497
|
return new theia.Hover('Hover for all **typescript** files.');
|
|
497
498
|
}
|
|
498
499
|
});
|
|
499
500
|
```
|
|
501
|
+
|
|
500
502
|
will show the hover message for all `typescript` files.
|
|
501
503
|
|
|
502
504
|
The code below puts word under cursor into hover message:
|
|
505
|
+
|
|
503
506
|
```typescript
|
|
504
507
|
theia.languages.registerHoverProvider({scheme: 'file'}, {
|
|
505
|
-
provideHover(doc: theia.TextDocument, position: theia.Position) {
|
|
508
|
+
provideHover(doc: theia.TextDocument, position: theia.Position, token: theia.CancellationToken) {
|
|
506
509
|
const range = doc.getWordRangeAtPosition(position);
|
|
507
510
|
const text = doc.getText(range);
|
|
508
511
|
return new theia.Hover(text);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/plugin",
|
|
3
|
-
"version": "1.32.0-next.
|
|
3
|
+
"version": "1.32.0-next.31+9574a95bc",
|
|
4
4
|
"description": "Theia - Plugin API",
|
|
5
5
|
"types": "./src/theia.d.ts",
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"nyc": {
|
|
33
33
|
"extends": "../../configs/nyc.json"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "9574a95bc615da35936c63090a87726b71259cbe"
|
|
36
36
|
}
|
package/src/theia-extra.d.ts
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
18
|
+
|
|
17
19
|
/**
|
|
18
20
|
* This is the place for extra APIs Theia supports compared to VS Code.
|
|
19
21
|
*/
|
|
@@ -33,4 +35,263 @@ export module '@theia/plugin' {
|
|
|
33
35
|
reveal(area?: WebviewPanelTargetArea, viewColumn?: ViewColumn, preserveFocus?: boolean): void;
|
|
34
36
|
}
|
|
35
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
|
+
|
|
36
296
|
}
|
|
297
|
+
|
package/src/theia.d.ts
CHANGED
|
@@ -63,116 +63,6 @@ export module '@theia/plugin' {
|
|
|
63
63
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export type PluginType = 'frontend' | 'backend';
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Represents an plugin.
|
|
70
|
-
*
|
|
71
|
-
* To get an instance of an `Plugin` use {@link plugins.getPlugin getPlugin}.
|
|
72
|
-
*/
|
|
73
|
-
export interface Plugin<T> {
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* The canonical plug-in identifier in the form of: `publisher.name`.
|
|
77
|
-
*/
|
|
78
|
-
readonly id: string;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* The absolute file path of the directory containing this plug-in.
|
|
82
|
-
*/
|
|
83
|
-
readonly pluginPath: string;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* The uri of the directory containing this plug-in.
|
|
87
|
-
*/
|
|
88
|
-
readonly pluginUri: Uri;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* `true` if the plug-in has been activated.
|
|
92
|
-
*/
|
|
93
|
-
readonly isActive: boolean;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* The parsed contents of the plug-in's package.json.
|
|
97
|
-
*/
|
|
98
|
-
readonly packageJSON: any;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
*
|
|
102
|
-
*/
|
|
103
|
-
readonly pluginType: PluginType;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* The public API exported by this plug-in. It is an invalid action
|
|
107
|
-
* to access this field before this plug-in has been activated.
|
|
108
|
-
*/
|
|
109
|
-
readonly exports: T;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Activates this plug-in and returns its public API.
|
|
113
|
-
*
|
|
114
|
-
* @return A promise that will resolve when this plug-in has been activated.
|
|
115
|
-
*/
|
|
116
|
-
activate(): Thenable<T>;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Namespace for dealing with installed plug-ins. Plug-ins are represented
|
|
121
|
-
* by an [plug-in](#Plugin)-interface which enables reflection on them.
|
|
122
|
-
*
|
|
123
|
-
* Plug-in writers can provide APIs to other plug-ins by returning their API public
|
|
124
|
-
* surface from the `start`-call.
|
|
125
|
-
*
|
|
126
|
-
* ```javascript
|
|
127
|
-
* export function start() {
|
|
128
|
-
* let api = {
|
|
129
|
-
* sum(a, b) {
|
|
130
|
-
* return a + b;
|
|
131
|
-
* },
|
|
132
|
-
* mul(a, b) {
|
|
133
|
-
* return a * b;
|
|
134
|
-
* }
|
|
135
|
-
* };
|
|
136
|
-
* // 'export' public api-surface
|
|
137
|
-
* return api;
|
|
138
|
-
* }
|
|
139
|
-
* ```
|
|
140
|
-
* ```javascript
|
|
141
|
-
* let mathExt = plugins.getPlugin('genius.math');
|
|
142
|
-
* let importedApi = mathExt.exports;
|
|
143
|
-
*
|
|
144
|
-
* console.log(importedApi.mul(42, 1));
|
|
145
|
-
* ```
|
|
146
|
-
*/
|
|
147
|
-
export namespace plugins {
|
|
148
|
-
/**
|
|
149
|
-
* Get an plug-in by its full identifier in the form of: `publisher.name`.
|
|
150
|
-
*
|
|
151
|
-
* @param pluginId An plug-in identifier.
|
|
152
|
-
* @return An plug-in or `undefined`.
|
|
153
|
-
*/
|
|
154
|
-
export function getPlugin(pluginId: string): Plugin<any> | undefined;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Get an plug-in its full identifier in the form of: `publisher.name`.
|
|
158
|
-
*
|
|
159
|
-
* @param pluginId An plug-in identifier.
|
|
160
|
-
* @return An plug-in or `undefined`.
|
|
161
|
-
*/
|
|
162
|
-
export function getPlugin<T>(pluginId: string): Plugin<T> | undefined;
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* All plug-ins currently known to the system.
|
|
166
|
-
*/
|
|
167
|
-
export let all: Plugin<any>[];
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* An event which fires when `plugins.all` changes. This can happen when extensions are
|
|
171
|
-
* installed, uninstalled, enabled or disabled.
|
|
172
|
-
*/
|
|
173
|
-
export let onDidChange: Event<void>;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
66
|
/**
|
|
177
67
|
* A command is a unique identifier of a function
|
|
178
68
|
* which can be executed by a user via a keyboard shortcut,
|
|
@@ -2530,7 +2420,7 @@ export module '@theia/plugin' {
|
|
|
2530
2420
|
* Registration can be split in two step: first register command without handler,
|
|
2531
2421
|
* second register handler by command id.
|
|
2532
2422
|
*
|
|
2533
|
-
* Any contributed command are available to any
|
|
2423
|
+
* Any contributed command are available to any extension, command can be invoked
|
|
2534
2424
|
* by {@link commands.executeCommand executeCommand} function.
|
|
2535
2425
|
*
|
|
2536
2426
|
* Simple example that register command:
|
|
@@ -3514,31 +3404,130 @@ export module '@theia/plugin' {
|
|
|
3514
3404
|
}
|
|
3515
3405
|
|
|
3516
3406
|
/**
|
|
3517
|
-
*
|
|
3518
|
-
*
|
|
3407
|
+
* In a remote window the extension kind describes if an extension
|
|
3408
|
+
* runs where the UI (window) runs or if an extension runs remotely.
|
|
3409
|
+
*/
|
|
3410
|
+
export enum ExtensionKind {
|
|
3411
|
+
|
|
3412
|
+
/**
|
|
3413
|
+
* Extension runs where the UI runs.
|
|
3414
|
+
*/
|
|
3415
|
+
UI = 1,
|
|
3416
|
+
|
|
3417
|
+
/**
|
|
3418
|
+
* Extension runs where the remote extension host runs.
|
|
3419
|
+
*/
|
|
3420
|
+
Workspace = 2
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
/**
|
|
3424
|
+
* Represents an extension.
|
|
3519
3425
|
*
|
|
3520
|
-
*
|
|
3521
|
-
* parameter to the `start` of a plug-in.
|
|
3426
|
+
* To get an instance of an `Extension` use {@link extensions.getExtension getExtension}.
|
|
3522
3427
|
*/
|
|
3523
|
-
export interface
|
|
3428
|
+
export interface Extension<T> {
|
|
3429
|
+
|
|
3430
|
+
/**
|
|
3431
|
+
* The canonical extension identifier in the form of: `publisher.name`.
|
|
3432
|
+
*/
|
|
3433
|
+
readonly id: string;
|
|
3434
|
+
|
|
3435
|
+
/**
|
|
3436
|
+
* The uri of the directory containing the extension.
|
|
3437
|
+
*/
|
|
3438
|
+
readonly extensionUri: Uri;
|
|
3439
|
+
|
|
3440
|
+
/**
|
|
3441
|
+
* The absolute file path of the directory containing this extension. Shorthand
|
|
3442
|
+
* notation for {@link Extension.extensionUri Extension.extensionUri.fsPath} (independent of the uri scheme).
|
|
3443
|
+
*/
|
|
3444
|
+
readonly extensionPath: string;
|
|
3445
|
+
|
|
3446
|
+
/**
|
|
3447
|
+
* `true` if the extension has been activated.
|
|
3448
|
+
*/
|
|
3449
|
+
readonly isActive: boolean;
|
|
3450
|
+
|
|
3451
|
+
/**
|
|
3452
|
+
* The parsed contents of the extension's package.json.
|
|
3453
|
+
*/
|
|
3454
|
+
readonly packageJSON: any;
|
|
3455
|
+
|
|
3456
|
+
/**
|
|
3457
|
+
* The extension kind describes if an extension runs where the UI runs
|
|
3458
|
+
* or if an extension runs where the remote extension host runs. The extension kind
|
|
3459
|
+
* is defined in the `package.json`-file of extensions but can also be refined
|
|
3460
|
+
* via the `remote.extensionKind`-setting. When no remote extension host exists,
|
|
3461
|
+
* the value is {@linkcode ExtensionKind.UI}.
|
|
3462
|
+
*/
|
|
3463
|
+
extensionKind: ExtensionKind;
|
|
3464
|
+
|
|
3465
|
+
/**
|
|
3466
|
+
* The public API exported by this extension (return value of `activate`).
|
|
3467
|
+
* It is an invalid action to access this field before this extension has been activated.
|
|
3468
|
+
*/
|
|
3469
|
+
readonly exports: T;
|
|
3470
|
+
|
|
3471
|
+
/**
|
|
3472
|
+
* Activates this extension and returns its public API.
|
|
3473
|
+
*
|
|
3474
|
+
* @return A promise that will resolve when this extension has been activated.
|
|
3475
|
+
*/
|
|
3476
|
+
activate(): Thenable<T>;
|
|
3477
|
+
}
|
|
3478
|
+
|
|
3479
|
+
/**
|
|
3480
|
+
* The ExtensionMode is provided on the `ExtensionContext` and indicates the
|
|
3481
|
+
* mode the specific extension is running in.
|
|
3482
|
+
*/
|
|
3483
|
+
export enum ExtensionMode {
|
|
3484
|
+
/**
|
|
3485
|
+
* The extension is installed normally (for example, from the marketplace
|
|
3486
|
+
* or VSIX) in the editor.
|
|
3487
|
+
*/
|
|
3488
|
+
Production = 1,
|
|
3489
|
+
|
|
3490
|
+
/**
|
|
3491
|
+
* The extension is running from an `--extensionDevelopmentPath` provided
|
|
3492
|
+
* when launching the editor.
|
|
3493
|
+
*/
|
|
3494
|
+
Development = 2,
|
|
3495
|
+
|
|
3496
|
+
/**
|
|
3497
|
+
* The extension is running from an `--extensionTestsPath` and
|
|
3498
|
+
* the extension host is running unit tests.
|
|
3499
|
+
*/
|
|
3500
|
+
Test = 3,
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3503
|
+
/**
|
|
3504
|
+
* An extension context is a collection of utilities private to an
|
|
3505
|
+
* extension.
|
|
3506
|
+
*
|
|
3507
|
+
* An instance of an `ExtensionContext` is provided as the first
|
|
3508
|
+
* parameter to the `activate`-call of an extension.
|
|
3509
|
+
*/
|
|
3510
|
+
export interface ExtensionContext {
|
|
3524
3511
|
|
|
3525
3512
|
/**
|
|
3526
3513
|
* An array to which disposables can be added. When this
|
|
3527
3514
|
* extension is deactivated the disposables will be disposed.
|
|
3515
|
+
*
|
|
3516
|
+
* *Note* that asynchronous dispose-functions aren't awaited.
|
|
3528
3517
|
*/
|
|
3529
|
-
subscriptions: { dispose(): any }[];
|
|
3518
|
+
readonly subscriptions: { dispose(): any }[];
|
|
3530
3519
|
|
|
3531
3520
|
/**
|
|
3532
3521
|
* A memento object that stores state in the context
|
|
3533
3522
|
* of the currently opened {@link workspace.workspaceFolders workspace}.
|
|
3534
3523
|
*/
|
|
3535
|
-
workspaceState: Memento;
|
|
3524
|
+
readonly workspaceState: Memento;
|
|
3536
3525
|
|
|
3537
3526
|
/**
|
|
3538
3527
|
* A memento object that stores state independent
|
|
3539
3528
|
* of the current opened {@link workspace.workspaceFolders workspace}.
|
|
3540
3529
|
*/
|
|
3541
|
-
globalState: Memento & {
|
|
3530
|
+
readonly globalState: Memento & {
|
|
3542
3531
|
/**
|
|
3543
3532
|
* Set the keys whose values should be synchronized across devices when synchronizing user-data
|
|
3544
3533
|
* like configuration, extensions, and mementos.
|
|
@@ -3556,19 +3545,21 @@ export module '@theia/plugin' {
|
|
|
3556
3545
|
};
|
|
3557
3546
|
|
|
3558
3547
|
/**
|
|
3559
|
-
* A storage utility for secrets.
|
|
3548
|
+
* A storage utility for secrets. Secrets are persisted across reloads and are independent of the
|
|
3549
|
+
* current opened {@link workspace.workspaceFolders workspace}.
|
|
3560
3550
|
*/
|
|
3561
3551
|
readonly secrets: SecretStorage;
|
|
3562
3552
|
|
|
3563
3553
|
/**
|
|
3564
|
-
* The
|
|
3554
|
+
* The uri of the directory containing the extension.
|
|
3565
3555
|
*/
|
|
3566
|
-
|
|
3556
|
+
readonly extensionUri: Uri;
|
|
3567
3557
|
|
|
3568
3558
|
/**
|
|
3569
|
-
* The
|
|
3559
|
+
* The absolute file path of the directory containing the extension. Shorthand
|
|
3560
|
+
* notation for {@link TextDocument.uri ExtensionContext.extensionUri.fsPath} (independent of the uri scheme).
|
|
3570
3561
|
*/
|
|
3571
|
-
readonly
|
|
3562
|
+
readonly extensionPath: string;
|
|
3572
3563
|
|
|
3573
3564
|
/**
|
|
3574
3565
|
* Gets the extension's environment variable collection for this workspace, enabling changes
|
|
@@ -3579,64 +3570,79 @@ export module '@theia/plugin' {
|
|
|
3579
3570
|
/**
|
|
3580
3571
|
* Get the absolute path of a resource contained in the extension.
|
|
3581
3572
|
*
|
|
3573
|
+
* *Note* that an absolute uri can be constructed via {@linkcode Uri.joinPath} and
|
|
3574
|
+
* {@linkcode ExtensionContext.extensionUri extensionUri}, e.g. `vscode.Uri.joinPath(context.extensionUri, relativePath);`
|
|
3575
|
+
*
|
|
3582
3576
|
* @param relativePath A relative path to a resource contained in the extension.
|
|
3583
3577
|
* @return The absolute path of the resource.
|
|
3584
3578
|
*/
|
|
3585
3579
|
asAbsolutePath(relativePath: string): string;
|
|
3586
3580
|
|
|
3581
|
+
/**
|
|
3582
|
+
* The uri of a workspace specific directory in which the extension
|
|
3583
|
+
* can store private state. The directory might not exist and creation is
|
|
3584
|
+
* up to the extension. However, the parent directory is guaranteed to be existent.
|
|
3585
|
+
* The value is `undefined` when no workspace nor folder has been opened.
|
|
3586
|
+
*
|
|
3587
|
+
* Use {@linkcode ExtensionContext.workspaceState workspaceState} or
|
|
3588
|
+
* {@linkcode ExtensionContext.globalState globalState} to store key value data.
|
|
3589
|
+
*
|
|
3590
|
+
* @see {@linkcode FileSystem workspace.fs} for how to read and write files and folders from
|
|
3591
|
+
* an uri.
|
|
3592
|
+
*/
|
|
3593
|
+
readonly storageUri: Uri | undefined;
|
|
3594
|
+
|
|
3587
3595
|
/**
|
|
3588
3596
|
* An absolute file path of a workspace specific directory in which the extension
|
|
3589
3597
|
* can store private state. The directory might not exist on disk and creation is
|
|
3590
3598
|
* up to the extension. However, the parent directory is guaranteed to be existent.
|
|
3591
3599
|
*
|
|
3592
|
-
* Use
|
|
3593
|
-
*
|
|
3600
|
+
* Use {@linkcode ExtensionContext.workspaceState workspaceState} or
|
|
3601
|
+
* {@linkcode ExtensionContext.globalState globalState} to store key value data.
|
|
3594
3602
|
*
|
|
3595
|
-
* @deprecated Use {@link
|
|
3603
|
+
* @deprecated Use {@link ExtensionContext.storageUri storageUri} instead.
|
|
3596
3604
|
*/
|
|
3597
|
-
storagePath: string | undefined;
|
|
3605
|
+
readonly storagePath: string | undefined;
|
|
3598
3606
|
|
|
3599
3607
|
/**
|
|
3600
|
-
* The uri of a
|
|
3601
|
-
*
|
|
3608
|
+
* The uri of a directory in which the extension can store global state.
|
|
3609
|
+
* The directory might not exist on disk and creation is
|
|
3602
3610
|
* up to the extension. However, the parent directory is guaranteed to be existent.
|
|
3603
|
-
* The value is `undefined` when no workspace nor folder has been opened.
|
|
3604
3611
|
*
|
|
3605
|
-
* Use
|
|
3606
|
-
* [`globalState`](#PluginContext.globalState) to store key value data.
|
|
3612
|
+
* Use {@linkcode ExtensionContext.globalState globalState} to store key value data.
|
|
3607
3613
|
*
|
|
3608
|
-
* @see
|
|
3614
|
+
* @see {@linkcode FileSystem workspace.fs} for how to read and write files and folders from
|
|
3609
3615
|
* an uri.
|
|
3610
3616
|
*/
|
|
3611
|
-
readonly
|
|
3617
|
+
readonly globalStorageUri: Uri;
|
|
3612
3618
|
|
|
3613
3619
|
/**
|
|
3614
3620
|
* An absolute file path in which the extension can store global state.
|
|
3615
3621
|
* The directory might not exist on disk and creation is
|
|
3616
3622
|
* up to the extension. However, the parent directory is guaranteed to be existent.
|
|
3617
3623
|
*
|
|
3618
|
-
* Use
|
|
3624
|
+
* Use {@linkcode ExtensionContext.globalState globalState} to store key value data.
|
|
3619
3625
|
*
|
|
3620
|
-
* @deprecated Use {@link
|
|
3626
|
+
* @deprecated Use {@link ExtensionContext.globalStorageUri globalStorageUri} instead.
|
|
3621
3627
|
*/
|
|
3622
3628
|
readonly globalStoragePath: string;
|
|
3623
3629
|
|
|
3624
3630
|
/**
|
|
3625
|
-
* The uri of a directory in which the extension can
|
|
3626
|
-
* The directory might not exist on disk and creation is
|
|
3627
|
-
*
|
|
3628
|
-
*
|
|
3629
|
-
* Use [`globalState`](#PluginContext.globalState) to store key value data.
|
|
3631
|
+
* The uri of a directory in which the extension can create log files.
|
|
3632
|
+
* The directory might not exist on disk and creation is up to the extension. However,
|
|
3633
|
+
* the parent directory is guaranteed to be existent.
|
|
3630
3634
|
*
|
|
3631
|
-
* @see
|
|
3635
|
+
* @see {@linkcode FileSystem workspace.fs} for how to read and write files and folders from
|
|
3632
3636
|
* an uri.
|
|
3633
3637
|
*/
|
|
3634
|
-
readonly
|
|
3638
|
+
readonly logUri: Uri;
|
|
3635
3639
|
|
|
3636
3640
|
/**
|
|
3637
3641
|
* An absolute file path of a directory in which the extension can create log files.
|
|
3638
3642
|
* The directory might not exist on disk and creation is up to the extension. However,
|
|
3639
3643
|
* the parent directory is guaranteed to be existent.
|
|
3644
|
+
*
|
|
3645
|
+
* @deprecated Use {@link ExtensionContext.logUri logUri} instead.
|
|
3640
3646
|
*/
|
|
3641
3647
|
readonly logPath: string;
|
|
3642
3648
|
|
|
@@ -3648,17 +3654,9 @@ export module '@theia/plugin' {
|
|
|
3648
3654
|
readonly extensionMode: ExtensionMode;
|
|
3649
3655
|
|
|
3650
3656
|
/**
|
|
3651
|
-
* The current
|
|
3652
|
-
*/
|
|
3653
|
-
readonly extension: Plugin<any> | undefined;
|
|
3654
|
-
|
|
3655
|
-
/**
|
|
3656
|
-
* The uri of a directory in which the extension can create log files. The directory might
|
|
3657
|
-
* not exist on disk and creation is up to the extension. However, the parent directory is
|
|
3658
|
-
* guaranteed to be existent.
|
|
3659
|
-
* see - workspace.fs for how to read and write files and folders from an uri.
|
|
3657
|
+
* The current `Extension` instance.
|
|
3660
3658
|
*/
|
|
3661
|
-
readonly
|
|
3659
|
+
readonly extension: Extension<any>;
|
|
3662
3660
|
}
|
|
3663
3661
|
|
|
3664
3662
|
/**
|
|
@@ -4874,7 +4872,7 @@ export module '@theia/plugin' {
|
|
|
4874
4872
|
/**
|
|
4875
4873
|
* Registers a webview panel serializer.
|
|
4876
4874
|
*
|
|
4877
|
-
*
|
|
4875
|
+
* Extensions that support reviving should have an `"onWebviewPanel:viewType"` activation event and
|
|
4878
4876
|
* make sure that {@link registerWebviewPanelSerializer registerWebviewPanelSerializer} is called during activation.
|
|
4879
4877
|
*
|
|
4880
4878
|
* Only a single serializer may be registered at a time for a given `viewType`.
|
|
@@ -5108,6 +5106,18 @@ export module '@theia/plugin' {
|
|
|
5108
5106
|
*/
|
|
5109
5107
|
export function registerUriHandler(handler: UriHandler): Disposable;
|
|
5110
5108
|
|
|
5109
|
+
/**
|
|
5110
|
+
* Show progress in the Source Control viewlet while running the given callback and while
|
|
5111
|
+
* its returned promise isn't resolve or rejected.
|
|
5112
|
+
*
|
|
5113
|
+
* @deprecated Use `withProgress` instead.
|
|
5114
|
+
*
|
|
5115
|
+
* @param task A callback returning a promise. Progress increments can be reported with
|
|
5116
|
+
* the provided {@link Progress}-object.
|
|
5117
|
+
* @return The thenable the task did return.
|
|
5118
|
+
*/
|
|
5119
|
+
export function withScmProgress<R>(task: (progress: Progress<number>) => Thenable<R>): Thenable<R>;
|
|
5120
|
+
|
|
5111
5121
|
/**
|
|
5112
5122
|
* Show progress in the editor. Progress is shown while running the given callback
|
|
5113
5123
|
* and while the promise it returned isn't resolved nor rejected. The location at which
|
|
@@ -8238,7 +8248,7 @@ export module '@theia/plugin' {
|
|
|
8238
8248
|
}
|
|
8239
8249
|
|
|
8240
8250
|
/**
|
|
8241
|
-
* The completion item provider interface defines the contract between
|
|
8251
|
+
* The completion item provider interface defines the contract between extensions and IntelliSense
|
|
8242
8252
|
*
|
|
8243
8253
|
* Providers can delay the computation of the [`detail`](#CompletionItem.detail)
|
|
8244
8254
|
* and [`documentation`](#CompletionItem.documentation) properties by implementing the
|
|
@@ -10067,7 +10077,7 @@ export module '@theia/plugin' {
|
|
|
10067
10077
|
* @return A hover or a thenable that resolves to such. The lack of a result can be
|
|
10068
10078
|
* signaled by returning `undefined` or `null`.
|
|
10069
10079
|
*/
|
|
10070
|
-
provideHover(document: TextDocument, position: Position, token: CancellationToken
|
|
10080
|
+
provideHover(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<Hover>;
|
|
10071
10081
|
}
|
|
10072
10082
|
|
|
10073
10083
|
/**
|
|
@@ -10688,6 +10698,13 @@ export module '@theia/plugin' {
|
|
|
10688
10698
|
*/
|
|
10689
10699
|
parentSession?: DebugSession;
|
|
10690
10700
|
|
|
10701
|
+
/**
|
|
10702
|
+
* Controls whether lifecycle requests like 'restart' are sent to the newly created session or its parent session.
|
|
10703
|
+
* By default (if the property is false or missing), lifecycle requests are sent to the new session.
|
|
10704
|
+
* This property is ignored if the session has no parent session.
|
|
10705
|
+
*/
|
|
10706
|
+
lifecycleManagedByParent?: boolean;
|
|
10707
|
+
|
|
10691
10708
|
/**
|
|
10692
10709
|
* Controls whether this session should have a separate debug console or share it
|
|
10693
10710
|
* with the parent session. Has no effect for sessions which do not have a parent session.
|
|
@@ -11532,6 +11549,16 @@ export module '@theia/plugin' {
|
|
|
11532
11549
|
clear?: boolean;
|
|
11533
11550
|
}
|
|
11534
11551
|
|
|
11552
|
+
/**
|
|
11553
|
+
* Run options for a task.
|
|
11554
|
+
*/
|
|
11555
|
+
export interface RunOptions {
|
|
11556
|
+
/**
|
|
11557
|
+
* Controls whether task variables are re-evaluated on rerun.
|
|
11558
|
+
*/
|
|
11559
|
+
reevaluateOnRerun?: boolean;
|
|
11560
|
+
}
|
|
11561
|
+
|
|
11535
11562
|
export class Task {
|
|
11536
11563
|
|
|
11537
11564
|
/**
|
|
@@ -11618,6 +11645,11 @@ export module '@theia/plugin' {
|
|
|
11618
11645
|
* array.
|
|
11619
11646
|
*/
|
|
11620
11647
|
problemMatchers?: string[];
|
|
11648
|
+
|
|
11649
|
+
/**
|
|
11650
|
+
* Run options for the task
|
|
11651
|
+
*/
|
|
11652
|
+
runOptions: RunOptions;
|
|
11621
11653
|
}
|
|
11622
11654
|
|
|
11623
11655
|
/**
|
|
@@ -11748,7 +11780,7 @@ export module '@theia/plugin' {
|
|
|
11748
11780
|
/**
|
|
11749
11781
|
* Fetches all tasks available in the systems. This includes tasks
|
|
11750
11782
|
* from `tasks.json` files as well as tasks from task providers
|
|
11751
|
-
* contributed through extensions
|
|
11783
|
+
* contributed through extensions.
|
|
11752
11784
|
*
|
|
11753
11785
|
* @param filter a filter to filter the return tasks.
|
|
11754
11786
|
*/
|