Explorar el Código

Adds progress for repo discovery on workspace add repos

main
Ramin Tadayon hace 1 año
padre
commit
d7427db149
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: 79D60DDE3DFB95F5
Se han modificado 1 ficheros con 46 adiciones y 24 borrados
  1. +46
    -24
      src/plus/workspaces/workspacesService.ts

+ 46
- 24
src/plus/workspaces/workspacesService.ts Ver fichero

@ -1,5 +1,5 @@
import type { CancellationToken, Event } from 'vscode';
import { Disposable, EventEmitter, Uri, window } from 'vscode';
import { Disposable, EventEmitter, ProgressLocation, Uri, window } from 'vscode';
import { getSupportedWorkspacesPathMappingProvider } from '@env/providers';
import type { Container } from '../../container';
import type { GitRemote } from '../../git/models/remote';
@ -661,30 +661,52 @@ export class WorkspacesService implements Disposable {
if (repoChoice == null) return;
if (repoChoice.choice === WorkspaceAddRepositoriesChoice.ParentFolder) {
const foundRepos = await this.getRepositoriesInParentFolder();
if (foundRepos == null) return;
validRepos = await this.filterReposForProvider(foundRepos, workspace.provider);
if (validRepos.length === 0) {
if (!options?.suppressNotifications) {
void window.showInformationMessage(
`No matching repositories found for provider ${workspace.provider}.`,
{
modal: true,
},
);
}
return;
}
await window.withProgress(
{
location: ProgressLocation.Notification,
title: `Finding repositories to add to the workspace...`,
cancellable: true,
},
async (_progress, token) => {
const foundRepos = await this.getRepositoriesInParentFolder(token);
if (foundRepos == null) return;
if (foundRepos.length === 0) {
if (!options?.suppressNotifications) {
void window.showInformationMessage(`No repositories found in the chosen folder.`, {
modal: true,
});
}
return;
}
validRepos = await this.filterReposForCloudWorkspace(validRepos, workspaceId);
if (validRepos.length === 0) {
if (!options?.suppressNotifications) {
void window.showInformationMessage(`All possible repositories are already in this workspace.`, {
modal: true,
});
}
return;
}
if (token.isCancellationRequested) return;
validRepos = await this.filterReposForProvider(foundRepos, workspace.provider);
if (validRepos.length === 0) {
if (!options?.suppressNotifications) {
void window.showInformationMessage(
`No matching repositories found for provider ${workspace.provider}.`,
{
modal: true,
},
);
}
return;
}
if (token.isCancellationRequested) return;
validRepos = await this.filterReposForCloudWorkspace(validRepos, workspaceId);
if (validRepos.length === 0) {
if (!options?.suppressNotifications) {
void window.showInformationMessage(
`All possible repositories are already in this workspace.`,
{
modal: true,
},
);
}
}
},
);
}
const pick = await showRepositoriesPicker(

Cargando…
Cancelar
Guardar