mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-24 06:19:37 +00:00
Canonicalize paths when opening workspaces (#21039)
Closes #17161 Release Notes: - Added symlink resolution when opening projects from within Zed. Previously this only happened within zed's cli, but that broke file watching on Linux when opening a symlinked directory.
This commit is contained in:
parent
d489f96aef
commit
852fb51528
1 changed files with 10 additions and 3 deletions
|
@ -1096,10 +1096,17 @@ impl Workspace {
|
|||
);
|
||||
|
||||
cx.spawn(|mut cx| async move {
|
||||
let serialized_workspace: Option<SerializedWorkspace> =
|
||||
persistence::DB.workspace_for_roots(abs_paths.as_slice());
|
||||
let mut paths_to_open = Vec::with_capacity(abs_paths.len());
|
||||
for path in abs_paths.into_iter() {
|
||||
if let Some(canonical) = app_state.fs.canonicalize(&path).await.ok() {
|
||||
paths_to_open.push(canonical)
|
||||
} else {
|
||||
paths_to_open.push(path)
|
||||
}
|
||||
}
|
||||
|
||||
let mut paths_to_open = abs_paths;
|
||||
let serialized_workspace: Option<SerializedWorkspace> =
|
||||
persistence::DB.workspace_for_roots(paths_to_open.as_slice());
|
||||
|
||||
let workspace_location = serialized_workspace
|
||||
.as_ref()
|
||||
|
|
Loading…
Reference in a new issue