From 90a0ecc49e601e3f3063db7ccea0e57fd179eec9 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 26 Jun 2020 10:47:35 +0200 Subject: [PATCH] workspaces - do not leave stale untitled workspaces around --- .../workspaces/browser/abstractWorkspaceEditingService.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.ts b/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.ts index a76834a87de..067eae83070 100644 --- a/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.ts +++ b/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.ts @@ -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; }