提交 ff47259f 编写于 作者: R Rob Lourens

Fix #71465 - "find in files shortcut broken"

上级 2b518c12
......@@ -14,7 +14,7 @@ import { coalesce } from 'vs/base/common/arrays';
// Commands can get exeucted from a command pallete, from a context menu or from some list using a keybinding
// To cover all these cases we need to properly compute the resource on which the command is being executed
export function getResourceForCommand(resource: URI | object, listService: IListService, editorService: IEditorService): URI | null {
export function getResourceForCommand(resource: URI | object | undefined, listService: IListService, editorService: IEditorService): URI | null {
if (URI.isUri(resource)) {
return resource;
}
......@@ -44,7 +44,7 @@ export function getResourceForCommand(resource: URI | object, listService: IList
return editorService.activeEditor ? toResource(editorService.activeEditor, { supportSideBySide: true }) : null;
}
export function getMultiSelectedResources(resource: URI | object, listService: IListService, editorService: IEditorService): Array<URI> {
export function getMultiSelectedResources(resource: URI | object | undefined, listService: IListService, editorService: IEditorService): Array<URI> {
const list = listService.lastFocusedList;
if (list && list.getHTMLElement() === document.activeElement) {
// Explorer
......
......@@ -363,7 +363,7 @@ const searchInFolderCommand: ICommandHandler = (accessor, resource?: URI) => {
const panelService = accessor.get(IPanelService);
const fileService = accessor.get(IFileService);
const configurationService = accessor.get(IConfigurationService);
const resources = resource && getMultiSelectedResources(resource, listService, accessor.get(IEditorService));
const resources = getMultiSelectedResources(resource, listService, accessor.get(IEditorService));
return openSearchView(viewletService, panelService, configurationService, true).then(searchView => {
if (resources && resources.length && searchView) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册