Don't replace newer diagnostics with older ones

This commit is contained in:
Antonio Scandurra 2022-11-17 12:21:51 +01:00
parent 532a599239
commit 71eeeedc05
7 changed files with 33 additions and 13 deletions

View file

@ -1813,13 +1813,15 @@ where
path,
language_server_id,
error_count,
warning_count
warning_count,
version
)
VALUES ($1, $2, $3, $4, $5, $6)
VALUES ($1, $2, $3, $4, $5, $6, $7)
ON CONFLICT (project_id, worktree_id, path) DO UPDATE SET
language_server_id = excluded.language_server_id,
error_count = excluded.error_count,
warning_count = excluded.warning_count
warning_count = excluded.warning_count,
version = excluded.version
",
)
.bind(project_id)
@ -1828,6 +1830,7 @@ where
.bind(summary.language_server_id as i64)
.bind(summary.error_count as i32)
.bind(summary.warning_count as i32)
.bind(summary.version as i32)
.execute(&mut tx)
.await?;
@ -2042,6 +2045,7 @@ where
language_server_id: summary.language_server_id as u64,
error_count: summary.error_count as u32,
warning_count: summary.warning_count as u32,
version: summary.version as u32,
});
}
}
@ -2666,6 +2670,7 @@ struct WorktreeDiagnosticSummary {
language_server_id: i64,
error_count: i32,
warning_count: i32,
version: i32,
}
id_type!(LanguageServerId);