Explorar el Código

Attempts to fix #2629 retries repo discovery

main
Eric Amodio hace 1 año
padre
commit
dae3ff4648
Se han modificado 2 ficheros con 15 adiciones y 4 borrados
  1. +1
    -1
      src/container.ts
  2. +14
    -3
      src/git/gitProviderService.ts

+ 1
- 1
src/container.ts Ver fichero

@ -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 Ver fichero

@ -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();
}

Cargando…
Cancelar
Guardar