mirror of
https://github.com/Microsoft/vscode
synced 2024-10-04 02:14:06 +00:00
Fix #71465 - "find in files shortcut broken"
This commit is contained in:
parent
2b518c120d
commit
ff47259fd8
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue