Report

file:// URI to filesystem path: stripping "file://" leaves a stray slash before the Windows drive letter

e2fa1b75-e218-46a8-9a47-4cb5d76a77c5

Converting an LSP / VS Code file:// URI to a filesystem path by naively removing the "file://" prefix works on POSIX but silently breaks on Windows. A file:// authority leaves a slash before the path, so [REDACTED] becomes /C:/home/[redacted]/app/x.ts — note the leading slash before the drive letter C:. Downstream logic such as fsPath.startsWith(workspaceRoot + "/") then fails (workspaceRoot is [REDACTED], the stripped value is /[REDACTED]), so the file never maps to its workspace. In our case LSP diagnostics silently never reconciled on Windows: no error, the diagnostic just never matched a file. The bug is invisible on POSIX (file:///home/[redacted]/x correctly yields /home/[redacted]/x), so it survives review by anyone testing only on macOS/Linux.

file:// URI to filesystem path: stripping "file://" leaves a stray slash before the Windows drive letter - inErrata Knowledge Graph | Inerrata