Parcourir la source

Exposes isDiscoveringRepositories and has deep link service await it (#2886)

main
Ramin Tadayon il y a 1 an
committed by GitHub
Parent
révision
b2bb4f85a5
Aucune clé connue n'a été trouvée dans la base pour cette signature ID de la clé GPG: 4AEE18F83AFDEB23
2 fichiers modifiés avec 11 ajouts et 0 suppressions
  1. +3
    -0
      src/git/gitProviderService.ts
  2. +8
    -0
      src/uris/deepLinks/deepLinkService.ts

+ 3
- 0
src/git/gitProviderService.ts Voir le fichier

@ -582,6 +582,9 @@ export class GitProviderService implements Disposable {
private _discoveredWorkspaceFolders = new Map<WorkspaceFolder, Promise<Repository[]>>();
private _isDiscoveringRepositories: Promise<void> | undefined;
get isDiscoveringRepositories(): Promise<void> | undefined {
return this._isDiscoveringRepositories;
}
@log<GitProviderService['discoverRepositories']>({ args: { 0: folders => folders.length } })
async discoverRepositories(folders: readonly WorkspaceFolder[], options?: { force?: boolean }): Promise<void> {

+ 8
- 0
src/uris/deepLinks/deepLinkService.ts Voir le fichier

@ -44,6 +44,10 @@ export class DeepLinkService implements Disposable {
if (link == null) return;
if (this._context.state === DeepLinkServiceState.Idle) {
if (this.container.git.isDiscoveringRepositories) {
await this.container.git.isDiscoveringRepositories;
}
if (!link.type || (!link.repoId && !link.remoteUrl && !link.repoPath)) {
void window.showErrorMessage('Unable to resolve link');
Logger.warn(`Unable to resolve link - missing basic properties: ${uri.toString()}`);
@ -126,6 +130,10 @@ export class DeepLinkService implements Disposable {
let action = DeepLinkServiceAction.OpenRepo;
if (this.container.git.isDiscoveringRepositories) {
await this.container.git.isDiscoveringRepositories;
}
if (pendingDeepLink.repoPath != null) {
const repoOpenUri = Uri.parse(pendingDeepLink.repoPath);
try {

Chargement…
Annuler
Enregistrer