From 379e39ff0ed32a31def1068feeda01c9fc41aba8 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 28 Jan 2019 16:56:57 +0100 Subject: [PATCH] fixes #67250 --- .../workbench/browser/actions/listCommands.ts | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/actions/listCommands.ts b/src/vs/workbench/browser/actions/listCommands.ts index 1ee1e0e8491..e5ee5abd4e3 100644 --- a/src/vs/workbench/browser/actions/listCommands.ts +++ b/src/vs/workbench/browser/actions/listCommands.ts @@ -309,7 +309,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ // Tree only if (focused && !(focused instanceof List || focused instanceof PagedList)) { - if (focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) { + if (focused instanceof ObjectTree || focused instanceof DataTree) { const tree = focused; const focusedElements = tree.getFocus(); @@ -328,6 +328,26 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ tree.reveal(child); } } + } else if (focused instanceof AsyncDataTree) { + const tree = focused; + const focusedElements = tree.getFocus(); + + if (focusedElements.length === 0) { + return; + } + + const focus = focusedElements[0]; + tree.expand(focus).then(didExpand => { + if (focus && !didExpand) { + const child = tree.getFirstElementChild(focus); + + if (child) { + const fakeKeyboardEvent = new KeyboardEvent('keydown'); + tree.setFocus([child], fakeKeyboardEvent); + tree.reveal(child); + } + } + }); } else { const tree = focused; const focus = tree.getFocus(); -- GitLab