From 10c8c1c2cce90256dc84597034c18b391a8b189f Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 6 May 2022 11:48:53 -0700 Subject: [PATCH] Include authority in TS in-memory scheme (#148940) For #146853 Make sure we include the uri authority when serializing and then restoring the file paths we send to TSServer (similarly to how we already handle the uri scheme) --- .../src/typescriptServiceClient.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index 172a61301fd..9df101d76dd 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -674,7 +674,9 @@ export default class TypeScriptServiceClient extends Disposable implements IType } default: { - return this.inMemoryResourcePrefix + '/' + resource.scheme + return this.inMemoryResourcePrefix + + '/' + resource.scheme + + '/' + resource.authority + (resource.path.startsWith('/') ? resource.path : '/' + resource.path) + (resource.fragment ? '#' + resource.fragment : ''); } @@ -724,7 +726,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType if (filepath.startsWith(this.inMemoryResourcePrefix)) { const parts = filepath.match(/^\^\/([^\/]+)\/(.+)$/); if (parts) { - const resource = vscode.Uri.parse(parts[1] + ':/' + parts[2]); + const resource = vscode.Uri.parse(parts[1] + '://' + parts[2]); return this.bufferSyncSupport.toVsCodeResource(resource); } }