From c7bc03181df370e661e708f73edeb8339027fb30 Mon Sep 17 00:00:00 2001 From: captaincrazybro Date: Mon, 5 Aug 2024 11:11:19 -0400 Subject: [PATCH 1/2] fix: `manageExtensions` provider correctly parses extension name on Windows --- src/extension-host/services/extension.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/extension-host/services/extension.service.ts b/src/extension-host/services/extension.service.ts index 4a7dd81e8d..b365a382e2 100644 --- a/src/extension-host/services/extension.service.ts +++ b/src/extension-host/services/extension.service.ts @@ -611,7 +611,8 @@ function getExtensionUri(baseUri: string, extensionName: string, extensionVersio */ function extractExtensionDetailsFromFileNames(fileUris: string[]): ExtensionIdentifier[] { return fileUris.map((fileUri: string) => { - const fileName = fileUri.split('/').pop(); + // Splits by either a forward-slash or back-slash to support Windows as well + const fileName = fileUri.split(/\\|\//).pop(); if (!fileName?.endsWith('.zip')) throw new Error(`Not a ZIP file: ${fileName}`); const lastDashIndex = fileName.lastIndexOf('_'); const extensionName = fileName.substring(0, lastDashIndex); From 869b206e46cbee54421fb13a49f770474881f623 Mon Sep 17 00:00:00 2001 From: captaincrazybro Date: Mon, 5 Aug 2024 13:31:28 -0400 Subject: [PATCH 2/2] fix: used `path.sep` instead of string regex --- src/extension-host/services/extension.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extension-host/services/extension.service.ts b/src/extension-host/services/extension.service.ts index b365a382e2..c0a5bf9668 100644 --- a/src/extension-host/services/extension.service.ts +++ b/src/extension-host/services/extension.service.ts @@ -612,7 +612,7 @@ function getExtensionUri(baseUri: string, extensionName: string, extensionVersio function extractExtensionDetailsFromFileNames(fileUris: string[]): ExtensionIdentifier[] { return fileUris.map((fileUri: string) => { // Splits by either a forward-slash or back-slash to support Windows as well - const fileName = fileUri.split(/\\|\//).pop(); + const fileName = fileUri.split(path.sep).pop(); if (!fileName?.endsWith('.zip')) throw new Error(`Not a ZIP file: ${fileName}`); const lastDashIndex = fileName.lastIndexOf('_'); const extensionName = fileName.substring(0, lastDashIndex);