提交 32db47ae 编写于 作者: M Matt Bierner

Remove duplicate impl of getActiveWebviewEditor

上级 afe63597
......@@ -67,7 +67,7 @@ export class ReloadWebviewAction extends Action {
}
}
function getActiveWebviewEditor(accessor: ServicesAccessor): WebviewEditor | undefined {
export function getActiveWebviewEditor(accessor: ServicesAccessor): WebviewEditor | undefined {
const editorService = accessor.get(IEditorService);
const activeControl = editorService.activeControl as WebviewEditor | undefined;
return activeControl?.isWebviewEditor ? activeControl : undefined;
......
......@@ -6,11 +6,10 @@
import { Action } from 'vs/base/common/actions';
import * as nls from 'vs/nls';
import { Command, ServicesAccessor } from 'vs/editor/browser/editorExtensions';
import { WebviewEditor } from 'vs/workbench/contrib/webview/browser/webviewEditor';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { ElectronWebviewBasedWebview } from 'vs/workbench/contrib/webview/electron-browser/webviewElement';
import { WebviewEditorOverlay } from 'vs/workbench/contrib/webview/browser/webview';
import { WebviewTag } from 'electron';
import { getActiveWebviewEditor } from 'vs/workbench/contrib/webview/browser/webviewCommands';
export class OpenWebviewDeveloperToolsAction extends Action {
static readonly ID = 'workbench.action.webview.openDeveloperTools';
......@@ -82,12 +81,6 @@ export class RedoWebviewEditorCommand extends Command {
}
}
function getActiveWebviewEditor(accessor: ServicesAccessor): WebviewEditor | undefined {
const editorService = accessor.get(IEditorService);
const activeControl = editorService.activeControl as WebviewEditor;
return activeControl.isWebviewEditor ? activeControl : undefined;
}
function withActiveWebviewBasedWebview(accessor: ServicesAccessor, f: (webview: ElectronWebviewBasedWebview) => void): void {
const webViewEditor = getActiveWebviewEditor(accessor);
if (webViewEditor) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册