mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 06:05:19 +00:00
🎨
This commit is contained in:
parent
66734e11af
commit
a53c87edfe
1 changed files with 16 additions and 22 deletions
|
@ -676,28 +676,22 @@ impl Project {
|
||||||
.uri
|
.uri
|
||||||
.to_file_path()
|
.to_file_path()
|
||||||
.map_err(|_| anyhow!("URI is not a file"))?;
|
.map_err(|_| anyhow!("URI is not a file"))?;
|
||||||
for tree in &self.worktrees {
|
let (worktree, relative_path) = self
|
||||||
let relative_path = tree.update(cx, |tree, _| {
|
.find_worktree_for_abs_path(&path, cx)
|
||||||
path.strip_prefix(tree.as_local()?.abs_path()).ok()
|
.ok_or_else(|| anyhow!("no worktree found for diagnostics"))?;
|
||||||
});
|
let project_path = ProjectPath {
|
||||||
if let Some(relative_path) = relative_path {
|
worktree_id: worktree.read(cx).id(),
|
||||||
let worktree_id = tree.read(cx).id();
|
path: relative_path.into(),
|
||||||
let project_path = ProjectPath {
|
};
|
||||||
worktree_id,
|
worktree.update(cx, |worktree, cx| {
|
||||||
path: relative_path.into(),
|
worktree.as_local_mut().unwrap().update_diagnostics(
|
||||||
};
|
project_path.path.clone(),
|
||||||
tree.update(cx, |tree, cx| {
|
diagnostics,
|
||||||
tree.as_local_mut().unwrap().update_diagnostics(
|
disk_based_sources,
|
||||||
project_path.path.clone(),
|
cx,
|
||||||
diagnostics,
|
)
|
||||||
disk_based_sources,
|
})?;
|
||||||
cx,
|
cx.emit(Event::DiagnosticsUpdated(project_path));
|
||||||
)
|
|
||||||
})?;
|
|
||||||
cx.emit(Event::DiagnosticsUpdated(project_path));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue