mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 00:59:03 +01:00
Adding concept of a state for webview editors
#77131 This information will be used to show the dirty indicator and also enable/disable save
This commit is contained in:
@@ -22,6 +22,7 @@ import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editor
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { extHostNamedCustomer } from '../common/extHostCustomers';
|
||||
import { CustomFileEditorInput } from 'vs/workbench/contrib/customEditor/browser/customEditorInput';
|
||||
|
||||
/**
|
||||
* Bi-directional map between webview handles and inputs.
|
||||
@@ -149,6 +150,13 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
|
||||
webview.setName(value);
|
||||
}
|
||||
|
||||
public $setState(handle: WebviewPanelHandle, state: modes.WebviewEditorState): void {
|
||||
const webview = this.getWebviewEditorInput(handle);
|
||||
if (webview instanceof CustomFileEditorInput) {
|
||||
webview.setState(state);
|
||||
}
|
||||
}
|
||||
|
||||
public $setIconPath(handle: WebviewPanelHandle, value: { light: UriComponents, dark: UriComponents } | undefined): void {
|
||||
const webview = this.getWebviewEditorInput(handle);
|
||||
webview.iconPath = reviveWebviewIcon(value);
|
||||
|
||||
Reference in New Issue
Block a user