Skip to content

Commit 9dd1ee4

Browse files
committed
untitled - ensure paths are absolute (microsoft#90116)
1 parent 94f9359 commit 9dd1ee4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/vs/workbench/services/textfile/browser/textFileService.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { coalesce } from 'vs/base/common/arrays';
3535
import { suggestFilename } from 'vs/base/common/mime';
3636
import { INotificationService } from 'vs/platform/notification/common/notification';
3737
import { toErrorMessage } from 'vs/base/common/errorMessage';
38+
import { resolve } from 'vs/base/common/path';
3839

3940
/**
4041
* 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
587588
}
588589

589590
// Finally fallback to suggest just the file name
590-
return toLocalResource(resource.with({ path: suggestedFilename }), remoteAuthority);
591+
// Since we do not have a default file path to
592+
// put, we use path.resolve() to make sure the path
593+
// is absolute.
594+
return toLocalResource(resource.with({ path: resolve(suggestedFilename) }), remoteAuthority);
591595
}
592596

593597
//#endregion

0 commit comments

Comments
 (0)