diff --git a/src/vs/base/common/uri.ts b/src/vs/base/common/uri.ts index ec6497ef0b6fc07b409a82de422b93a19d32abdd..a55224af59e5ae1facc88fae3868b3d801aa9fbf 100644 --- a/src/vs/base/common/uri.ts +++ b/src/vs/base/common/uri.ts @@ -384,8 +384,8 @@ export class URI implements UriComponents { return data; } else { const result = new _URI(data); - result._fsPath = (data).fsPath; result._formatted = (data).external; + result._fsPath = (data).fsPathBsl === (isWindows || undefined) ? (data).fsPath : null; return result; } } @@ -401,8 +401,9 @@ export interface UriComponents { interface UriState extends UriComponents { $mid: number; - fsPath: string; external: string; + fsPath: string; + fsPathBsl: true | undefined; } @@ -438,6 +439,7 @@ class _URI extends URI { // cached state if (this._fsPath) { res.fsPath = this._fsPath; + res.fsPathBsl = isWindows || undefined; } if (this._formatted) { res.external = this._formatted; diff --git a/src/vs/workbench/test/electron-browser/api/extHostTypes.test.ts b/src/vs/workbench/test/electron-browser/api/extHostTypes.test.ts index 56517bdd73c21d8ace9255ffc2e5e7987571a2e5..d69ac0f3fc3f2c3e3f3b797804acdb1b8003457a 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostTypes.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostTypes.test.ts @@ -31,6 +31,7 @@ suite('ExtHostTypes', function () { scheme: 'file', path: '/path/test.file', fsPath: '/path/test.file'.replace(/\//g, isWindows ? '\\' : '/'), + fsPathBsl: isWindows || undefined, }); assert.ok(uri.toString()); @@ -39,6 +40,7 @@ suite('ExtHostTypes', function () { scheme: 'file', path: '/path/test.file', fsPath: '/path/test.file'.replace(/\//g, isWindows ? '\\' : '/'), + fsPathBsl: isWindows || undefined, external: 'file:///path/test.file' }); });