Implement session-global include_warnings in the diagnostic item (#21618)

Release Notes:

- Make the include warnings toggle in the diagnostic tab global for a
zed session.
This commit is contained in:
Mikayla Maki 2024-12-05 16:32:17 -08:00 committed by GitHub
parent aff17322f3
commit cf4e847c62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 61 additions and 9 deletions

View file

@ -151,7 +151,13 @@ async fn test_diagnostics(cx: &mut TestAppContext) {
// Open the project diagnostics view while there are already diagnostics.
let view = window.build_view(cx, |cx| {
ProjectDiagnosticsEditor::new_with_context(1, project.clone(), workspace.downgrade(), cx)
ProjectDiagnosticsEditor::new_with_context(
1,
true,
project.clone(),
workspace.downgrade(),
cx,
)
});
let editor = view.update(cx, |view, _| view.editor.clone());
@ -459,7 +465,13 @@ async fn test_diagnostics_multiple_servers(cx: &mut TestAppContext) {
let workspace = window.root(cx).unwrap();
let view = window.build_view(cx, |cx| {
ProjectDiagnosticsEditor::new_with_context(1, project.clone(), workspace.downgrade(), cx)
ProjectDiagnosticsEditor::new_with_context(
1,
true,
project.clone(),
workspace.downgrade(),
cx,
)
});
let editor = view.update(cx, |view, _| view.editor.clone());
@ -720,7 +732,13 @@ async fn test_random_diagnostics(cx: &mut TestAppContext, mut rng: StdRng) {
let workspace = window.root(cx).unwrap();
let mutated_view = window.build_view(cx, |cx| {
ProjectDiagnosticsEditor::new_with_context(1, project.clone(), workspace.downgrade(), cx)
ProjectDiagnosticsEditor::new_with_context(
1,
true,
project.clone(),
workspace.downgrade(),
cx,
)
});
workspace.update(cx, |workspace, cx| {
@ -816,7 +834,13 @@ async fn test_random_diagnostics(cx: &mut TestAppContext, mut rng: StdRng) {
log::info!("constructing reference diagnostics view");
let reference_view = window.build_view(cx, |cx| {
ProjectDiagnosticsEditor::new_with_context(1, project.clone(), workspace.downgrade(), cx)
ProjectDiagnosticsEditor::new_with_context(
1,
true,
project.clone(),
workspace.downgrade(),
cx,
)
});
cx.run_until_parked();