浏览代码

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 {

正在加载...
取消
保存