mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Use onDid*
type event names in webview
This commit is contained in:
parent
978beebd0a
commit
4d95590a81
|
@ -302,11 +302,11 @@ class MarkdownPreview {
|
||||||
localResourceRoots: this.getLocalResourceRoots(resource)
|
localResourceRoots: this.getLocalResourceRoots(resource)
|
||||||
});
|
});
|
||||||
|
|
||||||
this.webview.onDispose(() => {
|
this.webview.onDidDispose(() => {
|
||||||
this._onDisposeEmitter.fire();
|
this._onDisposeEmitter.fire();
|
||||||
}, null, this.disposables);
|
}, null, this.disposables);
|
||||||
|
|
||||||
this.webview.onMessage(e => {
|
this.webview.onDidReceiveMessage(e => {
|
||||||
vscode.commands.executeCommand(e.command, ...e.args);
|
vscode.commands.executeCommand(e.command, ...e.args);
|
||||||
}, null, this.disposables);
|
}, null, this.disposables);
|
||||||
|
|
||||||
|
|
6
src/vs/vscode.proposed.d.ts
vendored
6
src/vs/vscode.proposed.d.ts
vendored
|
@ -494,7 +494,7 @@ declare module 'vscode' {
|
||||||
* in the exact same state it was in originally.
|
* in the exact same state it was in originally.
|
||||||
*
|
*
|
||||||
* `retainContextWhenHidden` has a high memory overhead and should only be used if
|
* `retainContextWhenHidden` has a high memory overhead and should only be used if
|
||||||
* your webview content cannot be quickly saved and restored.
|
* your webview's context cannot be quickly saved and restored.
|
||||||
*/
|
*/
|
||||||
readonly retainContextWhenHidden?: boolean;
|
readonly retainContextWhenHidden?: boolean;
|
||||||
|
|
||||||
|
@ -547,12 +547,12 @@ declare module 'vscode' {
|
||||||
/**
|
/**
|
||||||
* Fired when the webview content posts a message.
|
* Fired when the webview content posts a message.
|
||||||
*/
|
*/
|
||||||
readonly onMessage: Event<any>;
|
readonly onDidReceiveMessage: Event<any>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fired when the webview is disposed.
|
* Fired when the webview is disposed.
|
||||||
*/
|
*/
|
||||||
readonly onDispose: Event<void>;
|
readonly onDidDispose: Event<void>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fired when the webview's view column changes.
|
* Fired when the webview's view column changes.
|
||||||
|
|
|
@ -19,10 +19,10 @@ export class ExtHostWebview implements vscode.Webview {
|
||||||
private _viewColumn: vscode.ViewColumn;
|
private _viewColumn: vscode.ViewColumn;
|
||||||
|
|
||||||
public readonly onMessageEmitter = new Emitter<any>();
|
public readonly onMessageEmitter = new Emitter<any>();
|
||||||
public readonly onMessage: Event<any> = this.onMessageEmitter.event;
|
public readonly onDidReceiveMessage: Event<any> = this.onMessageEmitter.event;
|
||||||
|
|
||||||
public readonly onDisposeEmitter = new Emitter<void>();
|
public readonly onDisposeEmitter = new Emitter<void>();
|
||||||
public readonly onDispose: Event<void> = this.onDisposeEmitter.event;
|
public readonly onDidDispose: Event<void> = this.onDisposeEmitter.event;
|
||||||
|
|
||||||
public readonly onDidChangeViewColumnEmitter = new Emitter<vscode.ViewColumn>();
|
public readonly onDidChangeViewColumnEmitter = new Emitter<vscode.ViewColumn>();
|
||||||
public readonly onDidChangeViewColumn: Event<vscode.ViewColumn> = this.onDidChangeViewColumnEmitter.event;
|
public readonly onDidChangeViewColumn: Event<vscode.ViewColumn> = this.onDidChangeViewColumnEmitter.event;
|
||||||
|
|
Loading…
Reference in a new issue