Move Store::update_diagnostic_summary to Db

This commit is contained in:
Antonio Scandurra 2022-11-16 15:41:33 +01:00
parent 117458f4f6
commit 95369f92eb
3 changed files with 97 additions and 65 deletions

View file

@ -251,31 +251,6 @@ impl Store {
}
}
pub fn update_diagnostic_summary(
&mut self,
project_id: ProjectId,
worktree_id: u64,
connection_id: ConnectionId,
summary: proto::DiagnosticSummary,
) -> Result<Vec<ConnectionId>> {
let project = self
.projects
.get_mut(&project_id)
.ok_or_else(|| anyhow!("no such project"))?;
if project.host_connection_id == connection_id {
let worktree = project
.worktrees
.get_mut(&worktree_id)
.ok_or_else(|| anyhow!("no such worktree"))?;
worktree
.diagnostic_summaries
.insert(summary.path.clone().into(), summary);
return Ok(project.connection_ids());
}
Err(anyhow!("no such worktree"))?
}
pub fn start_language_server(
&mut self,
project_id: ProjectId,