Skip to content

Commit 4c0c322

Browse files
committed
Avoid loading second copy of file when a breakpoint is hit
1 parent de2e2d5 commit 4c0c322

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/providers/DocumentContentProvider.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ export class DocumentContentProvider implements vscode.TextDocumentContentProvid
7777
}
7878
let uri: vscode.Uri;
7979
if (wFolderUri && (wFolderUri.scheme === FILESYSTEM_SCHEMA || wFolderUri.scheme === FILESYSTEM_READONLY_SCHEMA)) {
80+
// Avoid later adding a namespace=XXX queryparam when this is implied by the authority part of the workspace folder uri
81+
// otherwise stopping at a breakpoint would load a second copy of the file
82+
const authorityParts = wFolderUri.authority.split(":");
83+
if (authorityParts.length === 2 && namespace?.toLowerCase() === authorityParts[1]) {
84+
namespace = "";
85+
}
8086
const flat = new URLSearchParams(wFolderUri.query).get("flat") == "1";
8187
const fileExt = name.split(".").pop();
8288
const fileName = name
@@ -180,6 +186,9 @@ export class DocumentContentProvider implements vscode.TextDocumentContentProvid
180186
uri = uri.with({
181187
query: "csp=1",
182188
});
189+
} else {
190+
// Remove filters etc which the folder uri may have specified
191+
uri = uri.with({ query: "" });
183192
}
184193
}
185194
return uri;

0 commit comments

Comments
 (0)