Skip to content

Commit 28a504b

Browse files
authored
Support trailing slash in isfs directory URIs (#1357)
1 parent cee4a1e commit 28a504b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/providers/FileSystemProvider/FileSystemProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
218218
if (!entry.Name.includes(".")) {
219219
if (!parent.entries.has(entry.Name)) {
220220
const folder = !csp
221-
? uri.path.replace(/\//g, ".")
221+
? uri.path.replace(/\/$/, "").replace(/\//g, ".")
222222
: uri.path === "/"
223223
? ""
224224
: uri.path.endsWith("/")
@@ -247,7 +247,7 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
247247
}
248248
const csp = params.has("csp") && ["", "1"].includes(params.get("csp"));
249249
const folder = !csp
250-
? uri.path.replace(/\//g, ".")
250+
? uri.path.replace(/\/$/, "").replace(/\//g, ".")
251251
: uri.path === "/"
252252
? ""
253253
: uri.path.endsWith("/")

src/utils/FileProviderUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export function fileSpecFromURI(uri: vscode.Uri): string {
110110
const csp = params.has("csp") && ["", "1"].includes(params.get("csp"));
111111

112112
const folder = !csp
113-
? uri.path.replace(/\//g, ".")
113+
? uri.path.replace(/\/$/, "").replace(/\//g, ".")
114114
: uri.path === "/"
115115
? ""
116116
: uri.path.endsWith("/")

0 commit comments

Comments
 (0)