Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
project_symbols: Display line numbers in symbol picker (#46507)
Shuhei Kadowaki1148773d496e
diff --git a/crates/project_symbols/src/project_symbols.rs b/crates/project_symbols/src/project_symbols.rsindex 2031f22ad8a..002bf3a4f78 100644--- a/crates/project_symbols/src/project_symbols.rs+++ b/crates/project_symbols/src/project_symbols.rs@@ -254,7 +254,8 @@ impl PickerDelegate for ProjectSymbolsDelegate {} => abs_path.to_string_lossy(),};let label = symbol.label.text.clone();- let path = path.to_string();+ let line_number = symbol.range.start.0.row + 1;+ let path = path.into_owned();let settings = ThemeSettings::get_global(cx);@@ -290,7 +291,15 @@ impl PickerDelegate for ProjectSymbolsDelegate {.child(LabelLike::new().child(StyledText::new(label).with_default_highlights(&text_style, highlights),))- .child(Label::new(path).size(LabelSize::Small).color(Color::Muted)),+ .child(+ h_flex()+ .child(Label::new(path).size(LabelSize::Small).color(Color::Muted))+ .child(+ Label::new(format!(":{}", line_number))+ .size(LabelSize::Small)+ .color(Color::Placeholder),+ ),+ ),),)}