Change custom view multiselect array to have all selected

Fixes #79982
This commit is contained in:
Alex Ross 2019-08-29 09:52:55 +02:00
parent 3b439a8c49
commit f175024b4d
2 changed files with 2 additions and 7 deletions

2
src/vs/vscode.d.ts vendored
View file

@ -6886,7 +6886,7 @@ declare module 'vscode' {
/**
* Whether the tree supports multi-select. When the tree supports multi-select and a command is executed from the tree,
* the first argument to the command is the tree item that the command was executed on and the second argument is an
* array containing the other selected tree items.
* array containing all selected tree items.
*/
canSelectMany?: boolean;
}

View file

@ -856,12 +856,7 @@ class MultipleSelectionActionRunner extends ActionRunner {
const selection = this.getSelectedResources();
let selectionHandleArgs: TreeViewItemHandleArg[] | undefined = undefined;
if (selection.length > 1) {
selectionHandleArgs = [];
selection.forEach(selected => {
if (selected.handle !== context.$treeItemHandle) {
selectionHandleArgs!.push({ $treeViewId: context.$treeViewId, $treeItemHandle: selected.handle });
}
});
selectionHandleArgs = selection.map(selected => { return { $treeViewId: context.$treeViewId, $treeItemHandle: selected.handle }; });
}
return action.run(...[context, selectionHandleArgs]);