|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information.
|
4 | 4 | *--------------------------------------------------------------------------------------------*/
|
5 | 5 |
|
6 |
| -import { workspace, WorkspaceFoldersChangeEvent, Uri, window, Event, EventEmitter, QuickPickItem, Disposable, SourceControl, SourceControlResourceGroup, TextEditor, Memento, commands, LogOutputChannel, l10n } from 'vscode'; |
| 6 | +import { workspace, WorkspaceFoldersChangeEvent, Uri, window, Event, EventEmitter, QuickPickItem, Disposable, SourceControl, SourceControlResourceGroup, TextEditor, Memento, commands, LogOutputChannel, l10n, ProgressLocation } from 'vscode'; |
7 | 7 | import TelemetryReporter from '@vscode/extension-telemetry';
|
8 | 8 | import { Operation, Repository, RepositoryState } from './repository';
|
9 | 9 | import { memoize, sequentialize, debounce } from './decorators';
|
@@ -130,14 +130,20 @@ export class Model implements IRemoteSourcePublisherRegistry, IPostCommitCommand
|
130 | 130 | }
|
131 | 131 |
|
132 | 132 | private async doInitialScan(): Promise<void> {
|
133 |
| - await Promise.all([ |
| 133 | + const config = workspace.getConfiguration('git'); |
| 134 | + const autoRepositoryDetection = config.get<boolean | 'subFolders' | 'openEditors'>('autoRepositoryDetection'); |
| 135 | + |
| 136 | + const initialScanFn = () => Promise.all([ |
134 | 137 | this.onDidChangeWorkspaceFolders({ added: workspace.workspaceFolders || [], removed: [] }),
|
135 | 138 | this.onDidChangeVisibleTextEditors(window.visibleTextEditors),
|
136 | 139 | this.scanWorkspaceFolders()
|
137 | 140 | ]);
|
138 | 141 |
|
139 |
| - const config = workspace.getConfiguration('git'); |
140 |
| - const autoRepositoryDetection = config.get<boolean | 'subFolders' | 'openEditors'>('autoRepositoryDetection'); |
| 142 | + if (config.get<boolean>('showProgress', true)) { |
| 143 | + await window.withProgress({ location: ProgressLocation.SourceControl }, initialScanFn); |
| 144 | + } else { |
| 145 | + await initialScanFn(); |
| 146 | + } |
141 | 147 |
|
142 | 148 | /* __GDPR__
|
143 | 149 | "git.repositoryInitialScan" : {
|
|
0 commit comments