Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Fix canonicalize return UNC path #10501

Conversation

CharlesChen0823
Copy link
Contributor

In windows platform, fs::canonicalize return unc path, some relative issue, when strip_prefix with unc path and path in windows, there will not be match, will log many error.

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Apr 13, 2024
@CharlesChen0823 CharlesChen0823 marked this pull request as draft April 13, 2024 03:38
@maxdeviant maxdeviant changed the title Windows: Fixed windows canonicalize return unc path Windows: Fix canonicalize return UNC path Apr 13, 2024
@CharlesChen0823 CharlesChen0823 marked this pull request as ready for review April 14, 2024 02:02
mikayla-maki pushed a commit that referenced this pull request May 7, 2024
In Windows platform, using notify to watch file events. 
1. in [notify windows
implement](https://github.com/notify-rs/notify/blob/3df0f65152c8585cfb29d231c880b86b9164dcfd/notify/src/windows.rs#L344),
we get the full file path, just with `path.join(file_path)`.
2. In [zed worktree
start_backgroud_scan_tasks](https://github.com/zed-industries/zed/blob/d2569afe662be93c926eed1aeb2b17d050ba90b0/crates/worktree/src/worktree.rs#L679),
`abs_path` is not unc path, so we get all file events with not unc path.
3. but in [zed worktree
process_event](https://github.com/zed-industries/zed/blob/d2569afe662be93c926eed1aeb2b17d050ba90b0/crates/worktree/src/worktree.rs#L3619),
we `strip_prefix` unc path all times, it will always print annoy error.

@mikayla-maki I can't reopen pre closed pr #10501 .

Release Notes:

- N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants