Adds keyboard support to page in repo/file quick picks

This commit is contained in:
Eric Amodio
2017-03-13 00:15:14 -04:00
parent 3e815f6bf8
commit 3656d4e8a4
6 changed files with 113 additions and 28 deletions

View File

@@ -15,19 +15,25 @@ export function showQuickPickProgress(message: string, mapping?: KeyMapping): Ca
}
async function _showQuickPickProgress(message: string, cancellation: CancellationTokenSource, mapping?: KeyMapping) {
// Logger.log(`showQuickPickProgress`, `show`, message);
// Logger.log(`showQuickPickProgress`, `show`, message);
const scope: KeyboardScope = mapping && await Keyboard.instance.beginScope(mapping);
const scope: KeyboardScope = mapping && await Keyboard.instance.beginScope(mapping);
await window.showQuickPick(_getInfiniteCancellablePromise(cancellation), {
placeHolder: message,
ignoreFocusOut: getQuickPickIgnoreFocusOut()
} as QuickPickOptions, cancellation.token);
try {
await window.showQuickPick(_getInfiniteCancellablePromise(cancellation), {
placeHolder: message,
ignoreFocusOut: getQuickPickIgnoreFocusOut()
} as QuickPickOptions, cancellation.token);
}
catch (ex) {
// Not sure why this throws
}
finally {
// Logger.log(`showQuickPickProgress`, `cancel`, message);
// Logger.log(`showQuickPickProgress`, `cancel`, message);
scope && scope.dispose();
cancellation.cancel();
cancellation.cancel();
scope && scope.dispose();
}
}
function _getInfiniteCancellablePromise(cancellation: CancellationTokenSource) {