Przeglądaj źródła

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

main
Ramin Tadayon 1 rok temu
committed by GitHub
rodzic
commit
b2bb4f85a5
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 11 dodań i 0 usunięć
  1. +3
    -0
      src/git/gitProviderService.ts
  2. +8
    -0
      src/uris/deepLinks/deepLinkService.ts

+ 3
- 0
src/git/gitProviderService.ts Wyświetl plik

@ -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 Wyświetl plik

@ -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 {

Ładowanie…
Anuluj
Zapisz