Fix #71465 - "find in files shortcut broken"

This commit is contained in:
Rob Lourens 2019-03-31 00:05:49 +00:00
parent 2b518c120d
commit ff47259fd8
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
// 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

View file

@ -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) {