Repository navigation
fix(provider): emit drive-letter file URIs for Windows paths - #641
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows,
path_to_file_uriencodedE:\dirand\\?\E:\dirverbatim, 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 reportedsource-map-member-unreadable(os error 123) for every source-map member.Changes:
\\?\prefix, and emitfile:///E:/dir/f.filesystem_pathdecodes throughfile_uri_path, so the drive form round-trips on Windows.uri.rs;main.rsshrinks.Verification:
cargo test -p opy-providerand clippy pass on macOS. Not yet run on Windows; UNC paths are not handled.