From 28a504b281a46db6f4654bebeb3e2ec0034aecef Mon Sep 17 00:00:00 2001 From: Brett Saviano Date: Thu, 9 May 2024 07:43:55 -0400 Subject: [PATCH] Support trailing slash in `isfs` directory URIs (#1357) --- src/providers/FileSystemProvider/FileSystemProvider.ts | 4 ++-- src/utils/FileProviderUtil.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/providers/FileSystemProvider/FileSystemProvider.ts b/src/providers/FileSystemProvider/FileSystemProvider.ts index 346bbb33..e4048263 100644 --- a/src/providers/FileSystemProvider/FileSystemProvider.ts +++ b/src/providers/FileSystemProvider/FileSystemProvider.ts @@ -218,7 +218,7 @@ export class FileSystemProvider implements vscode.FileSystemProvider { if (!entry.Name.includes(".")) { if (!parent.entries.has(entry.Name)) { const folder = !csp - ? uri.path.replace(/\//g, ".") + ? uri.path.replace(/\/$/, "").replace(/\//g, ".") : uri.path === "/" ? "" : uri.path.endsWith("/") @@ -247,7 +247,7 @@ export class FileSystemProvider implements vscode.FileSystemProvider { } const csp = params.has("csp") && ["", "1"].includes(params.get("csp")); const folder = !csp - ? uri.path.replace(/\//g, ".") + ? uri.path.replace(/\/$/, "").replace(/\//g, ".") : uri.path === "/" ? "" : uri.path.endsWith("/") diff --git a/src/utils/FileProviderUtil.ts b/src/utils/FileProviderUtil.ts index 0411347b..bcfa171a 100644 --- a/src/utils/FileProviderUtil.ts +++ b/src/utils/FileProviderUtil.ts @@ -110,7 +110,7 @@ export function fileSpecFromURI(uri: vscode.Uri): string { const csp = params.has("csp") && ["", "1"].includes(params.get("csp")); const folder = !csp - ? uri.path.replace(/\//g, ".") + ? uri.path.replace(/\/$/, "").replace(/\//g, ".") : uri.path === "/" ? "" : uri.path.endsWith("/")