提交 6fee0490 编写于 作者: M Matt Bierner

Use more explicit names for webview funcs

上级 e6b0f455
......@@ -14,7 +14,7 @@ import { EditorDescriptor, Extensions as EditorExtensions, IEditorRegistry } fro
import { Extensions as EditorInputExtensions, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor';
import { Webview, WebviewOverlay } from 'vs/workbench/contrib/webview/browser/webview';
import { WebviewEditorInputFactory } from 'vs/workbench/contrib/webview/browser/webviewEditorInputFactory';
import { getActiveWebview, HideWebViewEditorFindCommand, ReloadWebviewAction, ShowWebViewEditorFindWidgetAction, WebViewEditorFindNextCommand, WebViewEditorFindPreviousCommand } from '../browser/webviewCommands';
import { getActiveWebviewEditor, HideWebViewEditorFindCommand, ReloadWebviewAction, ShowWebViewEditorFindWidgetAction, WebViewEditorFindNextCommand, WebViewEditorFindPreviousCommand } from '../browser/webviewCommands';
import { WebviewEditor } from './webviewEditor';
import { WebviewInput } from './webviewEditorInput';
import { IWebviewWorkbenchService, WebviewEditorService } from './webviewWorkbenchService';
......@@ -38,8 +38,8 @@ registerAction2(WebViewEditorFindPreviousCommand);
registerAction2(ReloadWebviewAction);
function getActiveElectronBasedWebview(accessor: ServicesAccessor): Webview | undefined {
const webview = getActiveWebview(accessor);
function getInnerActiveWebview(accessor: ServicesAccessor): Webview | undefined {
const webview = getActiveWebviewEditor(accessor);
if (!webview) {
return undefined;
}
......@@ -62,7 +62,7 @@ const PRIORITY = 100;
function overrideCommandForWebview(command: MultiCommand | undefined, f: (webview: Webview) => void) {
command?.addImplementation(PRIORITY, accessor => {
const webview = getActiveElectronBasedWebview(accessor);
const webview = getInnerActiveWebview(accessor);
if (webview && webview.isFocused) {
f(webview);
return true;
......
......@@ -33,7 +33,7 @@ export class ShowWebViewEditorFindWidgetAction extends Action2 {
}
public run(accessor: ServicesAccessor): void {
getActiveWebview(accessor)?.showFind();
getActiveWebviewEditor(accessor)?.showFind();
}
}
......@@ -54,7 +54,7 @@ export class HideWebViewEditorFindCommand extends Action2 {
}
public run(accessor: ServicesAccessor): void {
getActiveWebview(accessor)?.hideFind();
getActiveWebviewEditor(accessor)?.hideFind();
}
}
......@@ -75,7 +75,7 @@ export class WebViewEditorFindNextCommand extends Action2 {
}
public run(accessor: ServicesAccessor): void {
getActiveWebview(accessor)?.runFindAction(false);
getActiveWebviewEditor(accessor)?.runFindAction(false);
}
}
......@@ -96,7 +96,7 @@ export class WebViewEditorFindPreviousCommand extends Action2 {
}
public run(accessor: ServicesAccessor): void {
getActiveWebview(accessor)?.runFindAction(true);
getActiveWebviewEditor(accessor)?.runFindAction(true);
}
}
......@@ -125,7 +125,7 @@ export class ReloadWebviewAction extends Action2 {
}
}
export function getActiveWebview(accessor: ServicesAccessor): Webview | undefined {
export function getActiveWebviewEditor(accessor: ServicesAccessor): Webview | undefined {
const editorService = accessor.get(IEditorService);
const activeEditor = editorService.activeEditor;
return activeEditor instanceof WebviewInput ? activeEditor.webview : undefined;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册