@theia/plugin 1.69.0-next.69 → 1.69.0
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/package.json +3 -3
- package/src/theia.d.ts +79 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/plugin",
|
|
3
|
-
"version": "1.69.0
|
|
3
|
+
"version": "1.69.0",
|
|
4
4
|
"description": "Theia - Plugin API",
|
|
5
5
|
"types": "./src/theia.d.ts",
|
|
6
6
|
"publishConfig": {
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"watch": "theiaext watch"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@theia/ext-scripts": "1.
|
|
30
|
+
"@theia/ext-scripts": "1.69.0"
|
|
31
31
|
},
|
|
32
32
|
"nyc": {
|
|
33
33
|
"extends": "../../configs/nyc.json"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "3b413470b0f990dc0d6e4287da02a6b6e21d3239"
|
|
36
36
|
}
|
package/src/theia.d.ts
CHANGED
|
@@ -4827,7 +4827,7 @@ export module '@theia/plugin' {
|
|
|
4827
4827
|
}
|
|
4828
4828
|
|
|
4829
4829
|
/**
|
|
4830
|
-
* A panel that contains a
|
|
4830
|
+
* A panel that contains a {@linkcode Webview}.
|
|
4831
4831
|
*/
|
|
4832
4832
|
export interface WebviewPanel {
|
|
4833
4833
|
/**
|
|
@@ -4879,7 +4879,7 @@ export module '@theia/plugin' {
|
|
|
4879
4879
|
/**
|
|
4880
4880
|
* Fired when the panel is disposed.
|
|
4881
4881
|
*
|
|
4882
|
-
* This may be because the user closed the panel or because
|
|
4882
|
+
* This may be because the user closed the panel or because {@linkcode WebviewPanel.dispose dispose} was
|
|
4883
4883
|
* called on it.
|
|
4884
4884
|
*
|
|
4885
4885
|
* Trying to use the panel after it has been disposed throws an exception.
|
|
@@ -4892,7 +4892,7 @@ export module '@theia/plugin' {
|
|
|
4892
4892
|
* A webview panel may only show in a single column at a time. If it is already showing, this
|
|
4893
4893
|
* method moves it to a new column.
|
|
4894
4894
|
*
|
|
4895
|
-
* @param viewColumn View column to show the panel in. Shows in the current
|
|
4895
|
+
* @param viewColumn View column to show the panel in. Shows in the current {@linkcode WebviewPanel.viewColumn} if undefined.
|
|
4896
4896
|
* @param preserveFocus When `true`, the webview will not take focus.
|
|
4897
4897
|
*/
|
|
4898
4898
|
reveal(viewColumn?: ViewColumn, preserveFocus?: boolean): void;
|
|
@@ -4902,17 +4902,17 @@ export module '@theia/plugin' {
|
|
|
4902
4902
|
*
|
|
4903
4903
|
* This closes the panel if it showing and disposes of the resources owned by the webview.
|
|
4904
4904
|
* Webview panels are also disposed when the user closes the webview panel. Both cases
|
|
4905
|
-
* fire the
|
|
4905
|
+
* fire the {@linkcode onDidDispose} event.
|
|
4906
4906
|
*/
|
|
4907
4907
|
dispose(): void;
|
|
4908
4908
|
}
|
|
4909
4909
|
|
|
4910
4910
|
/**
|
|
4911
|
-
* Event fired when a webview panel's view state changes.
|
|
4911
|
+
* Event fired when a {@linkcode WebviewPanel webview panel's} view state changes.
|
|
4912
4912
|
*/
|
|
4913
4913
|
export interface WebviewPanelOnDidChangeViewStateEvent {
|
|
4914
4914
|
/**
|
|
4915
|
-
*
|
|
4915
|
+
* {@linkcode WebviewPanel} whose view state changed.
|
|
4916
4916
|
*/
|
|
4917
4917
|
readonly webviewPanel: WebviewPanel;
|
|
4918
4918
|
}
|
|
@@ -5017,7 +5017,7 @@ export module '@theia/plugin' {
|
|
|
5017
5017
|
*
|
|
5018
5018
|
* Text based custom editors use a [`TextDocument`](#TextDocument) as their data model. This considerably simplifies
|
|
5019
5019
|
* implementing a custom editor as it allows Theia to handle many common operations such as
|
|
5020
|
-
* undo and backup. The provider is responsible for synchronizing text changes between the webview and the
|
|
5020
|
+
* undo and backup. The provider is responsible for synchronizing text changes between the webview and the {@linkcode TextDocument}.
|
|
5021
5021
|
*/
|
|
5022
5022
|
export interface CustomTextEditorProvider {
|
|
5023
5023
|
|
|
@@ -5027,14 +5027,13 @@ export module '@theia/plugin' {
|
|
|
5027
5027
|
* This is called when a user first opens a resource for a `CustomTextEditorProvider`, or if they reopen an
|
|
5028
5028
|
* existing editor using this `CustomTextEditorProvider`.
|
|
5029
5029
|
*
|
|
5030
|
-
*
|
|
5031
5030
|
* @param document Document for the resource to resolve.
|
|
5032
5031
|
*
|
|
5033
5032
|
* @param webviewPanel The webview panel used to display the editor UI for this resource.
|
|
5034
5033
|
*
|
|
5035
5034
|
* During resolve, the provider must fill in the initial html for the content webview panel and hook up all
|
|
5036
|
-
* the event listeners on it that it is interested in. The provider can also hold onto the
|
|
5037
|
-
* use later for example in a command. See
|
|
5035
|
+
* the event listeners on it that it is interested in. The provider can also hold onto the {@linkcode WebviewPanel} to
|
|
5036
|
+
* use later for example in a command. See {@linkcode WebviewPanel} for additional details.
|
|
5038
5037
|
*
|
|
5039
5038
|
* @param token A cancellation token that indicates the result is no longer needed.
|
|
5040
5039
|
*
|
|
@@ -5081,7 +5080,7 @@ export module '@theia/plugin' {
|
|
|
5081
5080
|
*
|
|
5082
5081
|
* This is invoked by Theia when the user undoes this edit. To implement `undo`, your
|
|
5083
5082
|
* extension should restore the document and editor to the state they were in just before this
|
|
5084
|
-
* edit was added to Theia's internal edit stack by
|
|
5083
|
+
* edit was added to Theia's internal edit stack by {@linkcode CustomEditorProvider.onDidChangeCustomDocument}.
|
|
5085
5084
|
*/
|
|
5086
5085
|
undo(): Thenable<void> | void;
|
|
5087
5086
|
|
|
@@ -5090,7 +5089,7 @@ export module '@theia/plugin' {
|
|
|
5090
5089
|
*
|
|
5091
5090
|
* This is invoked by Theia when the user redoes this edit. To implement `redo`, your
|
|
5092
5091
|
* extension should restore the document and editor to the state they were in just after this
|
|
5093
|
-
* edit was added to Theia's internal edit stack by
|
|
5092
|
+
* edit was added to Theia's internal edit stack by {@linkcode CustomEditorProvider.onDidChangeCustomDocument}.
|
|
5094
5093
|
*/
|
|
5095
5094
|
redo(): Thenable<void> | void;
|
|
5096
5095
|
|
|
@@ -5150,10 +5149,10 @@ export module '@theia/plugin' {
|
|
|
5150
5149
|
* Create a new document for a given resource.
|
|
5151
5150
|
*
|
|
5152
5151
|
* `openCustomDocument` is called when the first time an editor for a given resource is opened. The opened
|
|
5153
|
-
* document is then passed to
|
|
5152
|
+
* document is then passed to {@link resolveCustomEditor} so that the editor can be shown to the user.
|
|
5154
5153
|
*
|
|
5155
|
-
* Already opened
|
|
5156
|
-
* given resource are closed, the
|
|
5154
|
+
* Already opened {@linkcode CustomDocument CustomDocuments} are re-used if the user opened additional editors. When all editors for a
|
|
5155
|
+
* given resource are closed, the {@linkcode CustomDocument CustomDocuments} is disposed of. Opening an editor at this point will
|
|
5157
5156
|
* trigger another call to `openCustomDocument`.
|
|
5158
5157
|
*
|
|
5159
5158
|
* @param uri Uri of the document to open.
|
|
@@ -5174,8 +5173,8 @@ export module '@theia/plugin' {
|
|
|
5174
5173
|
* @param webviewPanel The webview panel used to display the editor UI for this resource.
|
|
5175
5174
|
*
|
|
5176
5175
|
* During resolve, the provider must fill in the initial html for the content webview panel and hook up all
|
|
5177
|
-
* the event listeners on it that it is interested in. The provider can also hold onto the
|
|
5178
|
-
* use later for example in a command. See
|
|
5176
|
+
* the event listeners on it that it is interested in. The provider can also hold onto the {@linkcode WebviewPanel} to
|
|
5177
|
+
* use later for example in a command. See {@linkcode WebviewPanel} for additional details.
|
|
5179
5178
|
*
|
|
5180
5179
|
* @param token A cancellation token that indicates the result is no longer needed.
|
|
5181
5180
|
*
|
|
@@ -5191,7 +5190,7 @@ export module '@theia/plugin' {
|
|
|
5191
5190
|
/**
|
|
5192
5191
|
* Unique identifier for the backup.
|
|
5193
5192
|
*
|
|
5194
|
-
* This id is passed back to your extension in
|
|
5193
|
+
* This id is passed back to your extension in {@linkcode CustomReadonlyEditorProvider.openCustomDocument openCustomDocument} when opening a custom editor from a backup.
|
|
5195
5194
|
*/
|
|
5196
5195
|
readonly id: string;
|
|
5197
5196
|
|
|
@@ -5239,18 +5238,18 @@ export module '@theia/plugin' {
|
|
|
5239
5238
|
* anything from changing some text, to cropping an image, to reordering a list. Your extension is free to
|
|
5240
5239
|
* define what an edit is and what data is stored on each edit.
|
|
5241
5240
|
*
|
|
5242
|
-
* Firing
|
|
5243
|
-
* saves or reverts the file.
|
|
5241
|
+
* Firing {@linkcode CustomEditorProvider.onDidChangeCustomDocument onDidChangeCustomDocument} causes
|
|
5242
|
+
* Theia to mark the editors as being dirty. This is cleared when the user either saves or reverts the file.
|
|
5244
5243
|
*
|
|
5245
|
-
* Editors that support undo/redo must fire a
|
|
5244
|
+
* Editors that support undo/redo must fire a {@linkcode CustomDocumentEditEvent} whenever an edit happens. This allows
|
|
5246
5245
|
* users to undo and redo the edit using Theia's standard Theia keyboard shortcuts. Theia will also mark
|
|
5247
5246
|
* the editor as no longer being dirty if the user undoes all edits to the last saved state.
|
|
5248
5247
|
*
|
|
5249
|
-
* Editors that support editing but cannot use Theia's standard undo/redo mechanism must fire a
|
|
5248
|
+
* Editors that support editing but cannot use Theia's standard undo/redo mechanism must fire a {@linkcode CustomDocumentContentChangeEvent}.
|
|
5250
5249
|
* The only way for a user to clear the dirty state of an editor that does not support undo/redo is to either
|
|
5251
5250
|
* `save` or `revert` the file.
|
|
5252
5251
|
*
|
|
5253
|
-
* An editor should only ever fire
|
|
5252
|
+
* An editor should only ever fire {@linkcode CustomDocumentEditEvent} events, or only ever fire {@linkcode CustomDocumentContentChangeEvent} events.
|
|
5254
5253
|
*/
|
|
5255
5254
|
readonly onDidChangeCustomDocument: Event<CustomDocumentEditEvent<T>> | Event<CustomDocumentContentChangeEvent<T>>;
|
|
5256
5255
|
|
|
@@ -5260,14 +5259,14 @@ export module '@theia/plugin' {
|
|
|
5260
5259
|
* This method is invoked by Theia when the user saves a custom editor. This can happen when the user
|
|
5261
5260
|
* triggers save while the custom editor is active, by commands such as `save all`, or by auto save if enabled.
|
|
5262
5261
|
*
|
|
5263
|
-
*
|
|
5264
|
-
* file data for the custom document to disk. After
|
|
5265
|
-
* no longer be marked as dirty.
|
|
5262
|
+
* The implementer must persist the custom editor. This usually means writing the
|
|
5263
|
+
* file data for the custom document to disk. After {@linkcode saveCustomDocument} completes, any associated
|
|
5264
|
+
* editor instances will no longer be marked as dirty.
|
|
5266
5265
|
*
|
|
5267
5266
|
* @param document Document to save.
|
|
5268
5267
|
* @param cancellation Token that signals the save is no longer required (for example, if another save was triggered).
|
|
5269
5268
|
*
|
|
5270
|
-
* @
|
|
5269
|
+
* @returns A {@linkcode Thenable} that saving has completed.
|
|
5271
5270
|
*/
|
|
5272
5271
|
saveCustomDocument(document: T, cancellation: CancellationToken): Thenable<void>;
|
|
5273
5272
|
|
|
@@ -5275,7 +5274,7 @@ export module '@theia/plugin' {
|
|
|
5275
5274
|
* Save a custom document to a different location.
|
|
5276
5275
|
*
|
|
5277
5276
|
* This method is invoked by Theia when the user triggers 'save as' on a custom editor. The implementer must
|
|
5278
|
-
* persist the custom editor to
|
|
5277
|
+
* persist the custom editor to {@linkcode destination}.
|
|
5279
5278
|
*
|
|
5280
5279
|
* When the user accepts save as, the current editor is be replaced by an non-dirty editor for the newly saved file.
|
|
5281
5280
|
*
|
|
@@ -5283,7 +5282,7 @@ export module '@theia/plugin' {
|
|
|
5283
5282
|
* @param destination Location to save to.
|
|
5284
5283
|
* @param cancellation Token that signals the save is no longer required.
|
|
5285
5284
|
*
|
|
5286
|
-
* @
|
|
5285
|
+
* @returns A {@linkcode Thenable} signaling that saving has completed.
|
|
5287
5286
|
*/
|
|
5288
5287
|
saveCustomDocumentAs(document: T, destination: Uri, cancellation: CancellationToken): Thenable<void>;
|
|
5289
5288
|
|
|
@@ -5293,37 +5292,39 @@ export module '@theia/plugin' {
|
|
|
5293
5292
|
* This method is invoked by Theia when the user triggers `File: Revert File` in a custom editor. (Note that
|
|
5294
5293
|
* this is only used using Theia's `File: Revert File` command and not on a `git revert` of the file).
|
|
5295
5294
|
*
|
|
5296
|
-
*
|
|
5295
|
+
* The implementer must make sure all editor instances (webviews) for {@linkcode document}
|
|
5297
5296
|
* are displaying the document in the same state is saved in. This usually means reloading the file from the
|
|
5298
5297
|
* workspace.
|
|
5299
5298
|
*
|
|
5300
5299
|
* @param document Document to revert.
|
|
5301
5300
|
* @param cancellation Token that signals the revert is no longer required.
|
|
5302
5301
|
*
|
|
5303
|
-
* @
|
|
5302
|
+
* @returns A {@linkcode Thenable} signaling that the revert has completed.
|
|
5304
5303
|
*/
|
|
5305
5304
|
revertCustomDocument(document: T, cancellation: CancellationToken): Thenable<void>;
|
|
5306
5305
|
|
|
5307
5306
|
/**
|
|
5308
5307
|
* Back up a dirty custom document.
|
|
5309
5308
|
*
|
|
5310
|
-
* Backups are used for hot exit and to prevent data loss. Your
|
|
5309
|
+
* Backups are used for hot exit and to prevent data loss. Your {@linkcode backupCustomDocument} method should persist the resource in
|
|
5311
5310
|
* its current state, i.e. with the edits applied. Most commonly this means saving the resource to disk in
|
|
5312
|
-
* the `ExtensionContext.storagePath`. When
|
|
5311
|
+
* the `ExtensionContext.storagePath`. When the editor reloads and your custom editor is opened for a resource,
|
|
5313
5312
|
* your extension should first check to see if any backups exist for the resource. If there is a backup, your
|
|
5314
5313
|
* extension should load the file contents from there instead of from the resource in the workspace.
|
|
5315
5314
|
*
|
|
5316
|
-
*
|
|
5317
|
-
* rapidly edits the document,
|
|
5315
|
+
* {@linkcode backupCustomDocument} is triggered approximately one second after the user stops editing the document. If the user
|
|
5316
|
+
* rapidly edits the document, {@linkcode backupCustomDocument} will not be invoked until the editing stops.
|
|
5318
5317
|
*
|
|
5319
|
-
*
|
|
5318
|
+
* {@linkcode backupCustomDocument} is not invoked when `auto save` is enabled (since auto save already persists the resource).
|
|
5320
5319
|
*
|
|
5321
5320
|
* @param document Document to backup.
|
|
5322
5321
|
* @param context Information that can be used to backup the document.
|
|
5323
5322
|
* @param cancellation Token that signals the current backup since a new backup is coming in. It is up to your
|
|
5324
5323
|
* extension to decided how to respond to cancellation. If for example your extension is backing up a large file
|
|
5325
5324
|
* in an operation that takes time to complete, your extension may decide to finish the ongoing backup rather
|
|
5326
|
-
* than cancelling it to ensure that
|
|
5325
|
+
* than cancelling it to ensure that the editor has some valid backup.
|
|
5326
|
+
*
|
|
5327
|
+
* @returns A {@linkcode Thenable} signaling that the backup has completed.
|
|
5327
5328
|
*/
|
|
5328
5329
|
backupCustomDocument(document: T, context: CustomDocumentBackupContext, cancellation: CancellationToken): Thenable<CustomDocumentBackup>;
|
|
5329
5330
|
|
|
@@ -5397,7 +5398,7 @@ export module '@theia/plugin' {
|
|
|
5397
5398
|
show(preserveFocus?: boolean): void;
|
|
5398
5399
|
}
|
|
5399
5400
|
/**
|
|
5400
|
-
* Provider for creating
|
|
5401
|
+
* Provider for creating {@linkcode WebviewView} elements.
|
|
5401
5402
|
*/
|
|
5402
5403
|
export interface WebviewViewProvider {
|
|
5403
5404
|
/**
|
|
@@ -6391,6 +6392,26 @@ export module '@theia/plugin' {
|
|
|
6391
6392
|
dispose(): void;
|
|
6392
6393
|
}
|
|
6393
6394
|
|
|
6395
|
+
/**
|
|
6396
|
+
* Specifies the location where a {@link QuickInputButton} should be rendered.
|
|
6397
|
+
*/
|
|
6398
|
+
export enum QuickInputButtonLocation {
|
|
6399
|
+
/**
|
|
6400
|
+
* The button is rendered in the title bar.
|
|
6401
|
+
*/
|
|
6402
|
+
Title = 1,
|
|
6403
|
+
|
|
6404
|
+
/**
|
|
6405
|
+
* The button is rendered inline to the right of the input box.
|
|
6406
|
+
*/
|
|
6407
|
+
Inline = 2,
|
|
6408
|
+
|
|
6409
|
+
/**
|
|
6410
|
+
* The button is rendered at the far end inside the input box.
|
|
6411
|
+
*/
|
|
6412
|
+
Input = 3
|
|
6413
|
+
}
|
|
6414
|
+
|
|
6394
6415
|
/**
|
|
6395
6416
|
* A button for an action in a {@link QuickPick} or {@link InputBox}.
|
|
6396
6417
|
*/
|
|
@@ -6404,6 +6425,26 @@ export module '@theia/plugin' {
|
|
|
6404
6425
|
* An optional tooltip displayed when hovering over the button.
|
|
6405
6426
|
*/
|
|
6406
6427
|
readonly tooltip?: string | undefined;
|
|
6428
|
+
|
|
6429
|
+
/**
|
|
6430
|
+
* The location where the button should be rendered.
|
|
6431
|
+
*
|
|
6432
|
+
* Defaults to {@link QuickInputButtonLocation.Title}.
|
|
6433
|
+
*
|
|
6434
|
+
* **Note:** This property is ignored if the button was added to a {@link QuickPickItem}.
|
|
6435
|
+
*/
|
|
6436
|
+
location?: QuickInputButtonLocation;
|
|
6437
|
+
|
|
6438
|
+
/**
|
|
6439
|
+
* When present, indicates that the button is a toggle button that can be checked or unchecked.
|
|
6440
|
+
*/
|
|
6441
|
+
readonly toggle?: {
|
|
6442
|
+
/**
|
|
6443
|
+
* Indicates whether the toggle button is currently checked.
|
|
6444
|
+
* This property will be updated when the button is toggled.
|
|
6445
|
+
*/
|
|
6446
|
+
checked: boolean;
|
|
6447
|
+
};
|
|
6407
6448
|
}
|
|
6408
6449
|
/**
|
|
6409
6450
|
* Value-object describing where and how progress should show.
|