Ignore diagnostics received for invisible worktrees

This commit is contained in:
Antonio Scandurra committed 2022-03-03 13:58:55 +01:00
1 parent 7470cadc51
commit 94f4cc2b65
1 file changed
+4
+4
View File
@@ -1218,6 +1218,10 @@ impl Project {
let (worktree, relative_path) = self
.find_local_worktree(&abs_path, cx)
.ok_or_else(|| anyhow!("no worktree found for diagnostics"))?;
if !worktree.read(cx).is_visible() {
return Ok(());
}
let project_path = ProjectPath {
worktree_id: worktree.read(cx).id(),
path: relative_path.into(),