From 9dd1ee404b4c25d5aa4e117b38cf4243600318ba Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 6 Feb 2020 11:44:15 +0100 Subject: [PATCH] untitled - ensure paths are absolute (#90116) --- .../workbench/services/textfile/browser/textFileService.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/services/textfile/browser/textFileService.ts b/src/vs/workbench/services/textfile/browser/textFileService.ts index 4156e0db1c0..27273f2213d 100644 --- a/src/vs/workbench/services/textfile/browser/textFileService.ts +++ b/src/vs/workbench/services/textfile/browser/textFileService.ts @@ -35,6 +35,7 @@ import { coalesce } from 'vs/base/common/arrays'; import { suggestFilename } from 'vs/base/common/mime'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { toErrorMessage } from 'vs/base/common/errorMessage'; +import { resolve } from 'vs/base/common/path'; /** * The workbench file service implementation implements the raw file service spec and adds additional methods on top. @@ -587,7 +588,10 @@ export abstract class AbstractTextFileService extends Disposable implements ITex } // Finally fallback to suggest just the file name - return toLocalResource(resource.with({ path: suggestedFilename }), remoteAuthority); + // Since we do not have a default file path to + // put, we use path.resolve() to make sure the path + // is absolute. + return toLocalResource(resource.with({ path: resolve(suggestedFilename) }), remoteAuthority); } //#endregion -- GitLab