From ff47259fd8ba2236439725017cd2af4a11b15d1a Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Sun, 31 Mar 2019 00:05:49 +0000 Subject: [PATCH] Fix #71465 - "find in files shortcut broken" --- src/vs/workbench/contrib/files/browser/files.ts | 4 ++-- .../workbench/contrib/search/browser/search.contribution.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/files/browser/files.ts b/src/vs/workbench/contrib/files/browser/files.ts index 6645b5ab3ab..bfe3a311da3 100644 --- a/src/vs/workbench/contrib/files/browser/files.ts +++ b/src/vs/workbench/contrib/files/browser/files.ts @@ -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 { +export function getMultiSelectedResources(resource: URI | object | undefined, listService: IListService, editorService: IEditorService): Array { const list = listService.lastFocusedList; if (list && list.getHTMLElement() === document.activeElement) { // Explorer diff --git a/src/vs/workbench/contrib/search/browser/search.contribution.ts b/src/vs/workbench/contrib/search/browser/search.contribution.ts index 387a79e1050..cb5785072a0 100644 --- a/src/vs/workbench/contrib/search/browser/search.contribution.ts +++ b/src/vs/workbench/contrib/search/browser/search.contribution.ts @@ -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) { -- GitLab