mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
diagnostics: Respect toolbar breadcrumbs setting in diagnostics panel (#44974)
## Summary The diagnostics panel was ignoring the user's `toolbar.breadcrumbs` setting and always showing breadcrumbs. This makes both `BufferDiagnosticsEditor` and `ProjectDiagnosticsEditor` check the `EditorSettings` to determine whether to display breadcrumbs. ## Changes - `buffer_diagnostics.rs`: Updated `breadcrumb_location` to check `EditorSettings::get_global(cx).toolbar.breadcrumbs` - `diagnostics.rs`: Updated `breadcrumb_location` to check `EditorSettings::get_global(cx).toolbar.breadcrumbs` This follows the same pattern used by the regular `Editor` in `items.rs`. ## Test plan 1. Set `toolbar.breadcrumbs` to `false` in settings.json 2. Open a file with diagnostics 3. Run `diagnostics: deploy current file` 4. Verify that breadcrumbs are hidden in the diagnostics panel Fixes #43020
This commit is contained in:
parent
775548e93c
commit
37bd27b2a8
2 changed files with 14 additions and 6 deletions
|
|
@ -6,7 +6,7 @@ use crate::{
|
|||
use anyhow::Result;
|
||||
use collections::HashMap;
|
||||
use editor::{
|
||||
Editor, EditorEvent, ExcerptRange, MultiBuffer, PathKey,
|
||||
Editor, EditorEvent, EditorSettings, ExcerptRange, MultiBuffer, PathKey,
|
||||
display_map::{BlockPlacement, BlockProperties, BlockStyle, CustomBlockId},
|
||||
multibuffer_context_lines,
|
||||
};
|
||||
|
|
@ -701,8 +701,12 @@ impl Item for BufferDiagnosticsEditor {
|
|||
});
|
||||
}
|
||||
|
||||
fn breadcrumb_location(&self, _: &App) -> ToolbarItemLocation {
|
||||
ToolbarItemLocation::PrimaryLeft
|
||||
fn breadcrumb_location(&self, cx: &App) -> ToolbarItemLocation {
|
||||
if EditorSettings::get_global(cx).toolbar.breadcrumbs {
|
||||
ToolbarItemLocation::PrimaryLeft
|
||||
} else {
|
||||
ToolbarItemLocation::Hidden
|
||||
}
|
||||
}
|
||||
|
||||
fn breadcrumbs(&self, theme: &theme::Theme, cx: &App) -> Option<Vec<BreadcrumbText>> {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ use buffer_diagnostics::BufferDiagnosticsEditor;
|
|||
use collections::{BTreeSet, HashMap, HashSet};
|
||||
use diagnostic_renderer::DiagnosticBlock;
|
||||
use editor::{
|
||||
Editor, EditorEvent, ExcerptRange, MultiBuffer, PathKey,
|
||||
Editor, EditorEvent, EditorSettings, ExcerptRange, MultiBuffer, PathKey,
|
||||
display_map::{BlockPlacement, BlockProperties, BlockStyle, CustomBlockId},
|
||||
multibuffer_context_lines,
|
||||
};
|
||||
|
|
@ -894,8 +894,12 @@ impl Item for ProjectDiagnosticsEditor {
|
|||
Some(Box::new(self.editor.clone()))
|
||||
}
|
||||
|
||||
fn breadcrumb_location(&self, _: &App) -> ToolbarItemLocation {
|
||||
ToolbarItemLocation::PrimaryLeft
|
||||
fn breadcrumb_location(&self, cx: &App) -> ToolbarItemLocation {
|
||||
if EditorSettings::get_global(cx).toolbar.breadcrumbs {
|
||||
ToolbarItemLocation::PrimaryLeft
|
||||
} else {
|
||||
ToolbarItemLocation::Hidden
|
||||
}
|
||||
}
|
||||
|
||||
fn breadcrumbs(&self, theme: &theme::Theme, cx: &App) -> Option<Vec<BreadcrumbText>> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue