From f2215909663be14f2cd0499a6ef266da69c11051 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 18 Dec 2017 18:16:20 -0500 Subject: [PATCH] Removes unused delay --- src/quickPicks/common.ts | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/src/quickPicks/common.ts b/src/quickPicks/common.ts index 56ae375..aa66efb 100644 --- a/src/quickPicks/common.ts +++ b/src/quickPicks/common.ts @@ -1,39 +1,24 @@ 'use strict'; import { Strings } from '../system'; -import { CancellationTokenSource, commands, Disposable, QuickPickItem, QuickPickOptions, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode'; +import { CancellationTokenSource, commands, QuickPickItem, QuickPickOptions, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode'; import { Commands, openEditor } from '../commands'; import { configuration } from '../configuration'; import { GlyphChars } from '../constants'; import { GitLog, GitLogCommit, GitStashCommit } from '../gitService'; import { Keyboard, KeyboardScope, KeyMapping, Keys } from '../keyboard'; import { ResultsExplorer } from '../views/resultsExplorer'; -// import { Logger } from '../logger'; export function getQuickPickIgnoreFocusOut() { return configuration.get(configuration.name('advanced')('quickPick')('closeOnFocusOut').value); } -export function showQuickPickProgress(message: string, mapping?: KeyMapping, delay: boolean = false): CancellationTokenSource { +export function showQuickPickProgress(message: string, mapping?: KeyMapping): CancellationTokenSource { const cancellation = new CancellationTokenSource(); - - if (delay) { - let disposable: Disposable; - const timer = setTimeout(() => { - disposable && disposable.dispose(); - _showQuickPickProgress(message, cancellation, mapping); - }, 250); - disposable = cancellation.token.onCancellationRequested(() => clearTimeout(timer)); - } - else { - _showQuickPickProgress(message, cancellation, mapping); - } - + _showQuickPickProgress(message, cancellation, mapping); return cancellation; } async function _showQuickPickProgress(message: string, cancellation: CancellationTokenSource, mapping?: KeyMapping) { - // Logger.log(`showQuickPickProgress`, `show`, message); - const scope: KeyboardScope | undefined = mapping && await Keyboard.instance.beginScope(mapping); try { @@ -46,8 +31,6 @@ async function _showQuickPickProgress(message: string, cancellation: Cancellatio // Not sure why this throws } finally { - // Logger.log(`showQuickPickProgress`, `cancel`, message); - cancellation.cancel(); scope && scope.dispose(); }