Fix diagnostics randomized tests (#21775)

These were silently passing after the delay in updating diagnostics was
added.

Co-Authored-By: Max <max@zed.dev>

cc @someonetoignore

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
This commit is contained in:
Conrad Irwin
2024-12-09 21:56:43 -07:00
committed by GitHub
co-authored by Max
parent 8a85d6ef96
commit a35ef5b79f
5 changed files with 66 additions and 61 deletions
+8 -6
View File
@@ -9923,7 +9923,8 @@ async fn go_to_prev_overlapping_diagnostic(
init_test(cx, |_| {});
let mut cx = EditorTestContext::new(cx).await;
let project = cx.update_editor(|editor, _| editor.project.clone().unwrap());
let lsp_store =
cx.update_editor(|editor, cx| editor.project.as_ref().unwrap().read(cx).lsp_store());
cx.set_state(indoc! {"
ˇfn func(abc def: i32) -> u32 {
@@ -9931,8 +9932,8 @@ async fn go_to_prev_overlapping_diagnostic(
"});
cx.update(|cx| {
project.update(cx, |project, cx| {
project
lsp_store.update(cx, |lsp_store, cx| {
lsp_store
.update_diagnostics(
LanguageServerId(0),
lsp::PublishDiagnosticsParams {
@@ -10021,11 +10022,12 @@ async fn test_diagnostics_with_links(cx: &mut TestAppContext) {
fn func(abˇc def: i32) -> u32 {
}
"});
let project = cx.update_editor(|editor, _| editor.project.clone().unwrap());
let lsp_store =
cx.update_editor(|editor, cx| editor.project.as_ref().unwrap().read(cx).lsp_store());
cx.update(|cx| {
project.update(cx, |project, cx| {
project.update_diagnostics(
lsp_store.update(cx, |lsp_store, cx| {
lsp_store.update_diagnostics(
LanguageServerId(0),
lsp::PublishDiagnosticsParams {
uri: lsp::Url::from_file_path("/root/file").unwrap(),