Skip to content

Commit f221590

Browse files
committed
Removes unused delay
1 parent 89a79ee commit f221590

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

src/quickPicks/common.ts

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,24 @@
11
'use strict';
22
import { Strings } from '../system';
3-
import { CancellationTokenSource, commands, Disposable, QuickPickItem, QuickPickOptions, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
3+
import { CancellationTokenSource, commands, QuickPickItem, QuickPickOptions, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
44
import { Commands, openEditor } from '../commands';
55
import { configuration } from '../configuration';
66
import { GlyphChars } from '../constants';
77
import { GitLog, GitLogCommit, GitStashCommit } from '../gitService';
88
import { Keyboard, KeyboardScope, KeyMapping, Keys } from '../keyboard';
99
import { ResultsExplorer } from '../views/resultsExplorer';
10-
// import { Logger } from '../logger';
1110

1211
export function getQuickPickIgnoreFocusOut() {
1312
return configuration.get<boolean>(configuration.name('advanced')('quickPick')('closeOnFocusOut').value);
1413
}
1514

16-
export function showQuickPickProgress(message: string, mapping?: KeyMapping, delay: boolean = false): CancellationTokenSource {
15+
export function showQuickPickProgress(message: string, mapping?: KeyMapping): CancellationTokenSource {
1716
const cancellation = new CancellationTokenSource();
18-
19-
if (delay) {
20-
let disposable: Disposable;
21-
const timer = setTimeout(() => {
22-
disposable && disposable.dispose();
23-
_showQuickPickProgress(message, cancellation, mapping);
24-
}, 250);
25-
disposable = cancellation.token.onCancellationRequested(() => clearTimeout(timer));
26-
}
27-
else {
28-
_showQuickPickProgress(message, cancellation, mapping);
29-
}
30-
17+
_showQuickPickProgress(message, cancellation, mapping);
3118
return cancellation;
3219
}
3320

3421
async function _showQuickPickProgress(message: string, cancellation: CancellationTokenSource, mapping?: KeyMapping) {
35-
// Logger.log(`showQuickPickProgress`, `show`, message);
36-
3722
const scope: KeyboardScope | undefined = mapping && await Keyboard.instance.beginScope(mapping);
3823

3924
try {
@@ -46,8 +31,6 @@ async function _showQuickPickProgress(message: string, cancellation: Cancellatio
4631
// Not sure why this throws
4732
}
4833
finally {
49-
// Logger.log(`showQuickPickProgress`, `cancel`, message);
50-
5134
cancellation.cancel();
5235
scope && scope.dispose();
5336
}

0 commit comments

Comments
 (0)