提交 9dd1ee40 编写于 作者: B Benjamin Pasero

untitled - ensure paths are absolute (#90116)

上级 94f93598
...@@ -35,6 +35,7 @@ import { coalesce } from 'vs/base/common/arrays'; ...@@ -35,6 +35,7 @@ import { coalesce } from 'vs/base/common/arrays';
import { suggestFilename } from 'vs/base/common/mime'; import { suggestFilename } from 'vs/base/common/mime';
import { INotificationService } from 'vs/platform/notification/common/notification'; import { INotificationService } from 'vs/platform/notification/common/notification';
import { toErrorMessage } from 'vs/base/common/errorMessage'; 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. * 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 ...@@ -587,7 +588,10 @@ export abstract class AbstractTextFileService extends Disposable implements ITex
} }
// Finally fallback to suggest just the file name // 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 //#endregion
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册