Skip to content

Commit 6158006

Browse files
Copilotalexr00
andcommitted
Add clarifying comment for regex in isValidWorkspaceUri
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 385df2a commit 6158006

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/uriHandler.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export function isValidWorkspaceUri(uri: vscode.Uri): boolean {
3131
// On Windows, valid paths have a drive letter (e.g., C:\...)
3232
// On Unix, valid paths start with / followed by directory names
3333
const fsPath = uri.fsPath;
34-
// Check if the path is just a number (invalid)
34+
// Check if the path is just a number (invalid).
35+
// The optional leading [/\\] handles both Unix paths (/1234) and potential Windows paths (\1234),
36+
// though in practice fsPath typically includes a leading separator.
3537
if (/^[/\\]?\d+$/.test(fsPath)) {
3638
return false;
3739
}

0 commit comments

Comments
 (0)