workspaces - do not leave stale untitled workspaces around

This commit is contained in:
Benjamin Pasero 2020-06-26 10:47:35 +02:00
parent bf31134f0d
commit 90a0ecc49e

View file

@ -200,8 +200,11 @@ export abstract class AbstractWorkspaceEditingService implements IWorkspaceEditi
const remoteAuthority = this.environmentService.configuration.remoteAuthority;
const untitledWorkspace = await this.workspacesService.createUntitledWorkspace(folders, remoteAuthority);
if (path) {
await this.saveWorkspaceAs(untitledWorkspace, path);
await this.workspacesService.deleteUntitledWorkspace(untitledWorkspace); // https://github.com/microsoft/vscode/issues/100276
try {
await this.saveWorkspaceAs(untitledWorkspace, path);
} finally {
await this.workspacesService.deleteUntitledWorkspace(untitledWorkspace); // https://github.com/microsoft/vscode/issues/100276
}
} else {
path = untitledWorkspace.configPath;
}