explorer: properly pass actions context

fixes #42163
This commit is contained in:
isidor 2018-01-26 11:14:09 +01:00
parent 6969cdff9d
commit 824c7f0c24

View file

@ -466,7 +466,7 @@ export class FileController extends DefaultController implements IDisposable {
getAnchor: () => anchor,
getActions: () => {
const actions = [];
fillInActions(this.contributedContextMenu, { arg: stat instanceof FileStat ? stat.resource : undefined, shouldForwardArgs: true }, actions, this.contextMenuService);
fillInActions(this.contributedContextMenu, { arg: stat instanceof FileStat ? stat.resource : {}, shouldForwardArgs: true }, actions, this.contextMenuService);
return TPromise.as(actions);
},
onHide: (wasCancelled?: boolean) => {
@ -474,7 +474,9 @@ export class FileController extends DefaultController implements IDisposable {
tree.DOMFocus();
}
},
getActionsContext: () => selection && selection.indexOf(stat) >= 0 ? selection.map((fs: FileStat) => fs.resource) : [stat]
getActionsContext: () => selection && selection.indexOf(stat) >= 0
? selection.map((fs: FileStat) => fs.resource)
: stat instanceof FileStat ? [stat.resource] : []
});
return true;