Use onDid* type event names in webview

This commit is contained in:
Matt Bierner 2018-02-26 15:40:15 -08:00
parent 978beebd0a
commit 4d95590a81
3 changed files with 7 additions and 7 deletions

View file

@ -302,11 +302,11 @@ class MarkdownPreview {
localResourceRoots: this.getLocalResourceRoots(resource)
});
this.webview.onDispose(() => {
this.webview.onDidDispose(() => {
this._onDisposeEmitter.fire();
}, null, this.disposables);
this.webview.onMessage(e => {
this.webview.onDidReceiveMessage(e => {
vscode.commands.executeCommand(e.command, ...e.args);
}, null, this.disposables);

View file

@ -494,7 +494,7 @@ declare module 'vscode' {
* in the exact same state it was in originally.
*
* `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;
@ -547,12 +547,12 @@ declare module 'vscode' {
/**
* Fired when the webview content posts a message.
*/
readonly onMessage: Event<any>;
readonly onDidReceiveMessage: Event<any>;
/**
* Fired when the webview is disposed.
*/
readonly onDispose: Event<void>;
readonly onDidDispose: Event<void>;
/**
* Fired when the webview's view column changes.

View file

@ -19,10 +19,10 @@ export class ExtHostWebview implements vscode.Webview {
private _viewColumn: vscode.ViewColumn;
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 onDispose: Event<void> = this.onDisposeEmitter.event;
public readonly onDidDispose: Event<void> = this.onDisposeEmitter.event;
public readonly onDidChangeViewColumnEmitter = new Emitter<vscode.ViewColumn>();
public readonly onDidChangeViewColumn: Event<vscode.ViewColumn> = this.onDidChangeViewColumnEmitter.event;