zed/crates/paths
Dino 7377cb6554
Canonicalize --user-data-dir path to match file watcher events (#48470)
This commit updates the `paths::set_custom_data_dir` implementation so
as to always canonicalize the provided `dir`, even when dealing with an
absolute path.

This ensures that we correctly deal with symlinks and don't end up not
reacting to filesystem watcher events in this specific case. For
example, when using `--user-data-dir /tmp/zed` on macOS, since `/tmp` is
a symlink to `/private/tmp`, if any setting was changed, the application
would not react, as the event would be using
`/private/tmp/zed/config/settings.json`, while the watcher would be
looking out for `/tmp/zed/config/settings.json`.

Lastly, the canonicalization of the path is now done after
`std::fs::create_dir_all` is called, in order to guarantee that the
directory already exists at that point.

Release Notes:

- N/A
2026-02-06 15:10:28 +00:00
..
src Canonicalize --user-data-dir path to match file watcher events (#48470) 2026-02-06 15:10:28 +00:00
Cargo.toml Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
LICENSE-GPL Extract paths out of util (#13182) 2024-06-17 19:27:42 -04:00