Fix #71465 - "find in files shortcut broken"

This commit is contained in:
Rob Lourens
2019-03-31 00:05:49 +00:00
committed by Karl Burtram
parent 9bd7e30d18
commit 61f7f19d12
2 changed files with 3 additions and 3 deletions

View File

@@ -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 // 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 // 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)) { if (URI.isUri(resource)) {
return resource; return resource;
} }
@@ -44,7 +44,7 @@ export function getResourceForCommand(resource: URI | object, listService: IList
return editorService.activeEditor ? toResource(editorService.activeEditor, { supportSideBySide: true }) : null; 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; const list = listService.lastFocusedList;
if (list && list.getHTMLElement() === document.activeElement) { if (list && list.getHTMLElement() === document.activeElement) {
// Explorer // Explorer

View File

@@ -361,7 +361,7 @@ const searchInFolderCommand: ICommandHandler = (accessor, resource?: URI) => {
const panelService = accessor.get(IPanelService); const panelService = accessor.get(IPanelService);
const fileService = accessor.get(IFileService); const fileService = accessor.get(IFileService);
const configurationService = accessor.get(IConfigurationService); 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 => { return openSearchView(viewletService, panelService, configurationService, true).then(searchView => {
if (resources && resources.length && searchView) { if (resources && resources.length && searchView) {