Переглянути джерело

Attempts to fix #2629 retries repo discovery

main
Eric Amodio 1 рік тому
джерело
коміт
dae3ff4648
2 змінених файлів з 15 додано та 4 видалено
  1. +1
    -1
      src/container.ts
  2. +14
    -3
      src/git/gitProviderService.ts

+ 1
- 1
src/container.ts Переглянути файл

@ -297,7 +297,7 @@ export class Container {
this._disposables.push(this._git.register(provider.descriptor.id, provider));
}
this._git.registrationComplete();
await this._git.registrationComplete();
}
private onAnyConfigurationChanged(e: ConfigurationChangeEvent) {

+ 14
- 3
src/git/gitProviderService.ts Переглянути файл

@ -10,6 +10,7 @@ import type {
WorkspaceFoldersChangeEvent,
} from 'vscode';
import { Disposable, EventEmitter, FileType, ProgressLocation, Uri, window, workspace } from 'vscode';
import { isWeb } from '@env/platform';
import { resetAvatarCache } from '../avatars';
import type { CoreGitConfiguration } from '../constants';
import { GlyphChars, Schemes } from '../constants';
@ -494,14 +495,24 @@ export class GitProviderService implements Disposable {
private _initializing: boolean = true;
@log({ singleLine: true })
registrationComplete() {
async registrationComplete() {
const scope = getLogScope();
this._initializing = false;
const { workspaceFolders } = workspace;
let { workspaceFolders } = workspace;
if (workspaceFolders?.length) {
void this.discoverRepositories(workspaceFolders);
await this.discoverRepositories(workspaceFolders);
// This is a hack to work around some issue with remote repositories on the web not being discovered on the initial load
if (this.repositoryCount === 0 && isWeb) {
setTimeout(() => {
({ workspaceFolders } = workspace);
if (workspaceFolders?.length) {
void this.discoverRepositories(workspaceFolders, { force: true });
}
}, 1000);
}
} else {
this.updateContext();
}

Завантаження…
Відмінити
Зберегти