瀏覽代碼

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

main
Ramin Tadayon 1 年之前
committed by GitHub
父節點
當前提交
b2bb4f85a5
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 2 個檔案被更改,包括 11 行新增0 行删除
  1. +3
    -0
      src/git/gitProviderService.ts
  2. +8
    -0
      src/uris/deepLinks/deepLinkService.ts

+ 3
- 0
src/git/gitProviderService.ts 查看文件

@ -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 查看文件

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

Loading…
取消
儲存