@theia/plugin 1.27.0-next.2 → 1.27.0-next.22
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 +2 -2
- package/src/theia.d.ts +43 -39
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/plugin",
|
|
3
|
-
"version": "1.27.0-next.
|
|
3
|
+
"version": "1.27.0-next.22+b2e44a9367b",
|
|
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": "b2e44a9367b1d9c9b1a0977edf57deab3cc50759"
|
|
36
36
|
}
|
package/src/theia.d.ts
CHANGED
|
@@ -4268,6 +4268,44 @@ export module '@theia/plugin' {
|
|
|
4268
4268
|
resolveWebviewView(webviewView: WebviewView, context: WebviewViewResolveContext, token: CancellationToken): Thenable<void> | void;
|
|
4269
4269
|
}
|
|
4270
4270
|
|
|
4271
|
+
/**
|
|
4272
|
+
* Additional information the webview view being resolved.
|
|
4273
|
+
*
|
|
4274
|
+
* @param T Type of the webview's state.
|
|
4275
|
+
*/
|
|
4276
|
+
interface WebviewViewResolveContext<T = unknown> {
|
|
4277
|
+
/**
|
|
4278
|
+
* Persisted state from the webview content.
|
|
4279
|
+
*
|
|
4280
|
+
* To save resources, VS Code normally deallocates webview documents (the iframe content) that are not visible.
|
|
4281
|
+
* For example, when the user collapse a view or switches to another top level activity in the sidebar, the
|
|
4282
|
+
* `WebviewView` itself is kept alive but the webview's underlying document is deallocated. It is recreated when
|
|
4283
|
+
* the view becomes visible again.
|
|
4284
|
+
*
|
|
4285
|
+
* You can prevent this behavior by setting `retainContextWhenHidden` in the `WebviewOptions`. However this
|
|
4286
|
+
* increases resource usage and should be avoided wherever possible. Instead, you can use persisted state to
|
|
4287
|
+
* save off a webview's state so that it can be quickly recreated as needed.
|
|
4288
|
+
*
|
|
4289
|
+
* To save off a persisted state, inside the webview call `acquireVsCodeApi().setState()` with
|
|
4290
|
+
* any json serializable object. To restore the state again, call `getState()`. For example:
|
|
4291
|
+
*
|
|
4292
|
+
* ```js
|
|
4293
|
+
* // Within the webview
|
|
4294
|
+
* const vscode = acquireVsCodeApi();
|
|
4295
|
+
*
|
|
4296
|
+
* // Get existing state
|
|
4297
|
+
* const oldState = vscode.getState() || { value: 0 };
|
|
4298
|
+
*
|
|
4299
|
+
* // Update state
|
|
4300
|
+
* setState({ value: oldState.value + 1 })
|
|
4301
|
+
* ```
|
|
4302
|
+
*
|
|
4303
|
+
* VS Code ensures that the persisted state is saved correctly when a webview is hidden and across
|
|
4304
|
+
* editor restarts.
|
|
4305
|
+
*/
|
|
4306
|
+
readonly state: T | undefined;
|
|
4307
|
+
}
|
|
4308
|
+
|
|
4271
4309
|
/**
|
|
4272
4310
|
* Common namespace for dealing with window and editor, showing messages and user input.
|
|
4273
4311
|
*/
|
|
@@ -4609,44 +4647,6 @@ export module '@theia/plugin' {
|
|
|
4609
4647
|
* @param serializer Webview serializer.
|
|
4610
4648
|
*/
|
|
4611
4649
|
|
|
4612
|
-
/**
|
|
4613
|
-
* Additional information the webview view being resolved.
|
|
4614
|
-
*
|
|
4615
|
-
* @param T Type of the webview's state.
|
|
4616
|
-
*/
|
|
4617
|
-
interface WebviewViewResolveContext<T = unknown> {
|
|
4618
|
-
/**
|
|
4619
|
-
* Persisted state from the webview content.
|
|
4620
|
-
*
|
|
4621
|
-
* To save resources, VS Code normally deallocates webview documents (the iframe content) that are not visible.
|
|
4622
|
-
* For example, when the user collapse a view or switches to another top level activity in the sidebar, the
|
|
4623
|
-
* `WebviewView` itself is kept alive but the webview's underlying document is deallocated. It is recreated when
|
|
4624
|
-
* the view becomes visible again.
|
|
4625
|
-
*
|
|
4626
|
-
* You can prevent this behavior by setting `retainContextWhenHidden` in the `WebviewOptions`. However this
|
|
4627
|
-
* increases resource usage and should be avoided wherever possible. Instead, you can use persisted state to
|
|
4628
|
-
* save off a webview's state so that it can be quickly recreated as needed.
|
|
4629
|
-
*
|
|
4630
|
-
* To save off a persisted state, inside the webview call `acquireVsCodeApi().setState()` with
|
|
4631
|
-
* any json serializable object. To restore the state again, call `getState()`. For example:
|
|
4632
|
-
*
|
|
4633
|
-
* ```js
|
|
4634
|
-
* // Within the webview
|
|
4635
|
-
* const vscode = acquireVsCodeApi();
|
|
4636
|
-
*
|
|
4637
|
-
* // Get existing state
|
|
4638
|
-
* const oldState = vscode.getState() || { value: 0 };
|
|
4639
|
-
*
|
|
4640
|
-
* // Update state
|
|
4641
|
-
* setState({ value: oldState.value + 1 })
|
|
4642
|
-
* ```
|
|
4643
|
-
*
|
|
4644
|
-
* VS Code ensures that the persisted state is saved correctly when a webview is hidden and across
|
|
4645
|
-
* editor restarts.
|
|
4646
|
-
*/
|
|
4647
|
-
readonly state: T | undefined;
|
|
4648
|
-
}
|
|
4649
|
-
|
|
4650
4650
|
export function registerWebviewViewProvider(viewId: string, provider: WebviewViewProvider, options?: {
|
|
4651
4651
|
/**
|
|
4652
4652
|
* Content settings for the webview created for this view.
|
|
@@ -6535,7 +6535,7 @@ export module '@theia/plugin' {
|
|
|
6535
6535
|
* the port forwarding tunnel is managed by VS Code and the tunnel can be closed by the user.
|
|
6536
6536
|
*
|
|
6537
6537
|
* Extensions should not cache the result of `asExternalUri` as the resolved uri may become invalid due to
|
|
6538
|
-
* a system or user action —
|
|
6538
|
+
* a system or user action — for example, in remote cases, a user may close a port forwarding tunnel
|
|
6539
6539
|
* that was opened by `asExternalUri`.
|
|
6540
6540
|
*
|
|
6541
6541
|
* *Note* that uris passed through `openExternal` are automatically resolved and you should not call `asExternalUri`
|
|
@@ -6709,6 +6709,10 @@ export module '@theia/plugin' {
|
|
|
6709
6709
|
* This rule will only execute if the text after the cursor matches this regular expression.
|
|
6710
6710
|
*/
|
|
6711
6711
|
afterText?: RegExp;
|
|
6712
|
+
/**
|
|
6713
|
+
* This rule will only execute if the text above the current line matches this regular expression.
|
|
6714
|
+
*/
|
|
6715
|
+
previousLineText?: RegExp;
|
|
6712
6716
|
/**
|
|
6713
6717
|
* The action to execute.
|
|
6714
6718
|
*/
|