feat(lsp): add container name as a column in the symbol pickers (#12930)

This commit is contained in:
David Vogt 2025-02-27 00:28:34 +01:00 committed by GitHub
parent 0ba2e05a6f
commit c98302a543
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -407,6 +407,13 @@ pub fn symbol_picker(cx: &mut Context) {
ui::PickerColumn::new("name", |item: &SymbolInformationItem, _| {
item.symbol.name.as_str().into()
}),
ui::PickerColumn::new("container", |item: &SymbolInformationItem, _| {
item.symbol
.container_name
.as_deref()
.unwrap_or_default()
.into()
}),
];
let picker = Picker::new(
@ -508,6 +515,13 @@ pub fn workspace_symbol_picker(cx: &mut Context) {
item.symbol.name.as_str().into()
})
.without_filtering(),
ui::PickerColumn::new("container", |item: &SymbolInformationItem, _| {
item.symbol
.container_name
.as_deref()
.unwrap_or_default()
.into()
}),
ui::PickerColumn::new("path", |item: &SymbolInformationItem, _| {
if let Some(path) = item.location.uri.as_path() {
path::get_relative_path(path)