fix: normalize Windows file URIs for DAP source paths - #122
Conversation
| let path = path.strip_prefix("file://").unwrap_or(path); | ||
| let path = path.replace('\\', "/"); | ||
| let path = path | ||
| .strip_prefix('/') |
There was a problem hiding this comment.
hmm, could we use Uri::to_path() here and in other places?
There was a problem hiding this comment.
Addressed in f64ff66: both the UI loader and DAP path conversion now use Uri::to_path() instead of manually stripping the file URI prefix.
| let path = path.strip_prefix("file://").unwrap_or(path); | ||
| let path = path.replace('\\', "/"); | ||
| let path = path | ||
| .strip_prefix('/') |
There was a problem hiding this comment.
could we normalize drive-letter casing and add a regression test?
|
Addressed in
Validation:
|
|
Addressed the review points in f64ff66:
Validation run locally on Windows:
I also ran |
|
Submissions must have signed commits - this cannot be merged without that. GitHub tells you this, so we shouldn't have to ask you to do it. |
f64ff66 to
40421b9
Compare
|
Thanks, fixed. I squashed the branch into a single SSH-signed commit and force-pushed it. GitHub now reports the commit as verified. |
What changed
file:///C:/...toC:/...in DAP source path matching.file:///C:/...source path matching with and without source path prefixes.Why
The existing code stripped
file://but kept the extra slash before Windows drive letters. That madefile:///C:/workspace/src/main.masmbecome/C:/workspace/src/main.masm, which does not match the regular Windows path form used by editor/DAP requests or source path prefixes.Fixes #121
Validation
cargo test -p miden-debug-engine --features dap source_paths_match_only_uses_declared_trim_prefixescargo check --workspace --features dapgit diff --checkNote:
cargo test --workspace --features dap source_paths_match_only_uses_declared_trim_prefixeswas also attempted, but the full workspace compile exceeded the local 180s timeout before completion. The targeted DAP engine test and workspace check both passed.