diff --git a/src/vs/workbench/browser/actions/listCommands.ts b/src/vs/workbench/browser/actions/listCommands.ts index d8425c6129a93de7fbd1ff8ffd984e88afef098c..09fefa6c3b97ad6852778a28d487a4a22ccd0ffc 100644 --- a/src/vs/workbench/browser/actions/listCommands.ts +++ b/src/vs/workbench/browser/actions/listCommands.ts @@ -302,6 +302,24 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ } }); +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: 'list.collapseAll', + weight: KeybindingWeight.WorkbenchContrib, + when: WorkbenchListFocusContextKey, + primary: KeyMod.CtrlCmd | KeyCode.LeftArrow, + mac: { + primary: KeyMod.CtrlCmd | KeyCode.LeftArrow, + secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.UpArrow] + }, + handler: (accessor) => { + const focusedTree = accessor.get(IListService).lastFocusedList; + + if (focusedTree && !(focusedTree instanceof List || focusedTree instanceof PagedList)) { + focusedTree.collapseAll(); + } + } +}); + KeybindingsRegistry.registerCommandAndKeybindingRule({ id: 'list.expand', weight: KeybindingWeight.WorkbenchContrib,