Skip to content

Commit

Permalink
Also remove extHostWebview side of the api proposal for webview edito…
Browse files Browse the repository at this point in the history
…r state/save
  • Loading branch information
mjbvz committed Oct 1, 2019
1 parent f75285a commit 313ede6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
10 changes: 0 additions & 10 deletions src/vs/workbench/api/common/extHostTypeConverters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1163,13 +1163,3 @@ export namespace LogLevel {
return types.LogLevel.Info;
}
}
export namespace WebviewContentState {
export function from(state: vscode.WebviewContentState): modes.WebviewContentState {
switch (state) {
case types.WebviewContentState.Readonly: return modes.WebviewContentState.Readonly;
case types.WebviewContentState.Unchanged: return modes.WebviewContentState.Unchanged;
case types.WebviewContentState.Dirty: return modes.WebviewContentState.Dirty;
default: throw new Error('Unknown vscode.WebviewContentState');
}
}
}
14 changes: 1 addition & 13 deletions src/vs/workbench/api/common/extHostWebview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { EditorViewColumn } from 'vs/workbench/api/common/shared/editor';
import { asWebviewUri, WebviewInitData } from 'vs/workbench/api/common/shared/webview';
import * as vscode from 'vscode';
import { ExtHostWebviewsShape, IMainContext, MainContext, MainThreadWebviewsShape, WebviewPanelHandle, WebviewPanelViewStateData } from './extHost.protocol';
import { Disposable, WebviewContentState } from './extHostTypes';
import { Disposable } from './extHostTypes';

type IconPath = URI | { light: URI, dark: URI };

Expand Down Expand Up @@ -102,9 +102,6 @@ export class ExtHostWebviewEditor implements vscode.WebviewEditor {
private _viewColumn: vscode.ViewColumn | undefined;
private _visible: boolean = true;
private _active: boolean = true;
private _state: vscode.WebviewEditorState = {
contentState: WebviewContentState.Readonly,
};

_isDisposed: boolean = false;

Expand Down Expand Up @@ -224,15 +221,6 @@ export class ExtHostWebviewEditor implements vscode.WebviewEditor {
this._visible = value;
}

public get editorState(): vscode.WebviewEditorState {
return this._state;
}

public set editorState(newState: vscode.WebviewEditorState) {
this._state = newState;
this._proxy.$setState(this._handle, typeConverters.WebviewContentState.from(newState.contentState));
}

private readonly _onWillSave = new Emitter<{ waitUntil: (thenable: Thenable<boolean>) => void }>();
public readonly onWillSave = this._onWillSave.event;

Expand Down

0 comments on commit 313ede6

Please sign in to comment.