Skip to content

fix(provider): emit drive-letter file URIs for Windows paths - #641

Merged
Teakowa merged 1 commit into
mainfrom
fix/provider-windows-file-uri
Oct 22, 2026
Merged

Teakowa merged 1 commit into
mainfrom
fix/provider-windows-file-uri

Conversation

@e54-bot

@e54-bot e54-bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

On Windows, path_to_file_uri encoded E:\dir and \\?\E:\dir verbatim, so the path landed in the URI host (file://E%3A/..., file://%5C%5C%3F...). Clients such as wright could not map the URIs back to files and reported source-map-member-unreadable (os error 123) for every source-map member.

Changes:

  • Normalize separators, drop the \\?\ prefix, and emit file:///E:/dir/f.
  • filesystem_path decodes through file_uri_path, so the drive form round-trips on Windows.
  • Move the URI helpers and tests to uri.rs; main.rs shrinks.

Verification: cargo test -p opy-provider and clippy pass on macOS. Not yet run on Windows; UNC paths are not handled.

path_to_file_uri encoded E:\dir and \\?\E:\dir verbatim, producing URIs with the path in the host. Clients could not map them back to files. Normalize separators, drop the verbatim prefix, and emit file:///E:/dir. filesystem_path now decodes through file_uri_path so the drive form round-trips on Windows. The URI helpers move to uri.rs to keep main.rs shrinking.
@Teakowa
Teakowa enabled auto-merge (squash) October 22, 2026 10:48
@Teakowa
Teakowa merged commit 22fe441 into main Oct 22, 2026
7 checks passed
@Teakowa
Teakowa deleted the fix/provider-windows-file-uri branch October 22, 2026 10:50
@e54-bot e54-bot mentioned this pull request Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants