Remove old-style webview state migration code

This commit is contained in:
Matt Bierner
2019-09-11 20:44:20 -07:00
parent 22db92f71b
commit 8532eb3206

View File

@@ -23,11 +23,6 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { extHostNamedCustomer } from '../common/extHostCustomers';
interface OldMainThreadWebviewState {
readonly viewType: string;
state: any;
}
/**
* Bi-directional map between webview handles and inputs.
*/
@@ -210,16 +205,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
let state = undefined;
if (webviewEditorInput.webview.state) {
try {
// Check for old-style webview state first which stored state inside another state object
// TODO: remove this after 1.37 ships.
if (
typeof (webviewEditorInput.webview.state as unknown as OldMainThreadWebviewState).viewType === 'string' &&
'state' in (webviewEditorInput.webview.state as unknown as OldMainThreadWebviewState)
) {
state = JSON.parse((webviewEditorInput.webview.state as any).state);
} else {
state = JSON.parse(webviewEditorInput.webview.state);
}
state = JSON.parse(webviewEditorInput.webview.state);
} catch {
// noop
}