mirror of
https://github.com/zed-industries/zed.git
synced 2026-12-01 13:00:41 +01:00
347f171a3f
## Summary Fix Windows file links into WSL projects, including Agent links and `zed path:line`. Preserve the original path prefix in `PathWithPosition::parse_str` instead of rebuilding it with the host platform's separator. Closes #65323. Fixes a regression introduced in #64748. Windows regression test output before the fix: ```text left: "/home/user/project/src\\main.rs" right: "/home/user/project/src/main.rs" ``` The test passes after the fix. It compares raw `OsStr` values because Windows `Path` equality hides separator differences. ## Testing - Manually tested the patched Windows client connected to WSL: clicking the previously failing Agent link opens the correct file as expected. - Verified that the development CLI opens `llm_engine.py:49:7` at line 49, column 7 in the Windows GUI. - Utility tests: **122 passed** on Linux; path-position tests: **7 passed** with each Windows GNU/MSVC target. - Windows client, CLI, and matching WSL server builds passed, along with Clippy, formatting, and `git diff --check`. To verify, connect a patched Windows client to a WSL project. Have the Agent produce a Markdown link to an existing file using its absolute WSL path with `:line` or `:line:column`. Click it and verify the file and cursor position. Also check the same path through the matching development CLI. ## Self-review - [ ] I've reviewed my diff for quality, security, reliability, and performance. - [ ] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). (N/A: no visual changes.) - [x] Tests cover the new or changed behavior. Release Notes: - Fixed file links with line numbers failing to open WSL files when using Zed on Windows. --------- Co-authored-by: Kirill Bulatov <kirill@zed.dev> Co-authored-by: Kirill Bulatov <mail4score@gmail.com>