Revert unnecessary changes

This commit is contained in:
rebornix
2024-02-28 15:44:15 -08:00
parent dea8581abf
commit 2016fe770b
5 changed files with 8 additions and 14 deletions
@@ -48,7 +48,7 @@ export class CustomEditorInput extends LazilyResolvedWebviewEditorInput {
title: undefined,
options: { customClasses: options?.customClasses },
contentOptions: {},
extension: undefined
extension: undefined,
});
const input = instantiationService.createInstance(CustomEditorInput, { resource, viewType }, webview, { untitledDocumentData: untitledDocumentData, oldResource: options?.oldResource });
if (typeof group !== 'undefined') {
@@ -135,7 +135,6 @@ export class CustomEditorInput extends LazilyResolvedWebviewEditorInput {
let capabilities = EditorInputCapabilities.None;
capabilities |= EditorInputCapabilities.CanDropIntoEditor;
// capabilities |= EditorInputCapabilities.AuxWindowUnsupported;
if (!this.customEditorService.getCustomEditorCapabilities(this.viewType)?.supportsMultipleEditorsPerDocument) {
capabilities |= EditorInputCapabilities.Singleton;
@@ -111,7 +111,7 @@ function reviveWebview(webviewService: IWebviewService, data: { origin: string |
retainContextWhenHidden: data.webviewOptions.retainContextWhenHidden,
},
contentOptions: data.contentOptions,
extension: data.extension
extension: data.extension,
});
webview.state = data.state;
return webview;
@@ -184,7 +184,7 @@ export class ComplexCustomWorkingCopyEditorHandler extends Disposable implements
webviewOptions: restoreWebviewOptions(backupData.webview.options),
contentOptions: restoreWebviewContentOptions(backupData.webview.options),
state: backupData.webview.state,
extension
extension,
});
const editor = this._instantiationService.createInstance(CustomEditorInput, { resource: URI.revive(backupData.editorResource), viewType: backupData.viewType }, webview, { backupId: backupData.backupId });
@@ -661,8 +661,6 @@ export class ExtensionEditor extends EditorPane {
return Promise.resolve(null);
}
const codeWindow = getWindowById(this.group?.windowId, true).window;
const webview = this.contentDisposables.add(this.webviewService.createWebviewOverlay({
title,
options: {
@@ -671,11 +669,12 @@ export class ExtensionEditor extends EditorPane {
disableServiceWorker: true,
},
contentOptions: {},
extension: undefined
extension: undefined,
}));
webview.initialScrollProgress = this.initialScrollProgress.get(webviewIndex) || 0;
const codeWindow = getWindowById(this.group?.windowId, true).window;
webview.claim(this, codeWindow, this.scopedContextKeyService);
setParentFlowTo(webview.container, container);
webview.layoutWebviewOverElement(container);
@@ -31,7 +31,6 @@ export class WebviewInput extends EditorInput {
public override get capabilities(): EditorInputCapabilities {
return EditorInputCapabilities.Readonly | EditorInputCapabilities.Singleton | EditorInputCapabilities.CanDropIntoEditor;
// | EditorInputCapabilities.AuxWindowUnsupported;
}
private readonly _resourceId = generateUuid();
@@ -11,7 +11,6 @@ import { WebviewContentOptions, WebviewExtensionDescription, WebviewOptions } fr
import { WebviewIcons } from 'vs/workbench/contrib/webviewPanel/browser/webviewIconManager';
import { WebviewInput } from './webviewEditorInput';
import { IWebviewWorkbenchService } from './webviewWorkbenchService';
import { getWindow } from 'vs/base/browser/dom';
export type SerializedWebviewOptions = WebviewOptions & WebviewContentOptions;
@@ -31,7 +30,6 @@ export interface SerializedWebview {
readonly state: any;
readonly iconPath: SerializedIconPath | undefined;
readonly group?: number;
readonly windowId: number;
}
export interface DeserializedWebview {
@@ -84,7 +82,7 @@ export class WebviewEditorInputSerializer implements IEditorSerializer {
title: data.title,
options: data.webviewOptions,
contentOptions: data.contentOptions,
extension: data.extension
extension: data.extension,
},
viewType: data.viewType,
title: data.title,
@@ -101,7 +99,7 @@ export class WebviewEditorInputSerializer implements IEditorSerializer {
iconPath: reviveIconPath(data.iconPath),
state: reviveState(data.state),
webviewOptions: restoreWebviewOptions(data.options),
contentOptions: restoreWebviewContentOptions(data.options)
contentOptions: restoreWebviewContentOptions(data.options),
};
}
@@ -116,8 +114,7 @@ export class WebviewEditorInputSerializer implements IEditorSerializer {
extensionId: input.extension?.id.value,
state: input.webview.state,
iconPath: input.iconPath ? { light: input.iconPath.light, dark: input.iconPath.dark, } : undefined,
group: input.group,
windowId: getWindow(input.webview.container).vscodeWindowId
group: input.group
};
}
}