@@ -5,7 +5,10 @@ use helix_lsp::{
55 util::{diagnostic_to_lsp_diagnostic, lsp_pos_to_pos, lsp_range_to_range, range_to_lsp_range},
66 OffsetEncoding,
77};
8−use tui::text::{Span, Spans};
8+use tui::{
9+ text::{Span, Spans},
10+ widgets::Row,
11+};
912
1013use super::{align_view, push_jump, Align, Context, Editor, Open};
1114
@@ -46,7 +49,7 @@ impl ui::menu::Item for lsp::Location {
4649 /// Current working directory.
4750 type Data = PathBuf;
4851
49− fn label(&self, cwdir: &Self::Data) -> Spans {
52+ fn format(&self, cwdir: &Self::Data) -> Row {
5053 // The preallocation here will overallocate a few characters since it will account for the
5154 // URL's scheme, which is not used most of the time since that scheme will be "file://".
5255 // Those extra chars will be used to avoid allocating when writing the line number (in the
@@ -80,7 +83,7 @@ impl ui::menu::Item for lsp::SymbolInformation {
8083 /// Path to currently focussed document
8184 type Data = Option<lsp::Url>;
8285
83− fn label(&self, current_doc_path: &Self::Data) -> Spans {
86+ fn format(&self, current_doc_path: &Self::Data) -> Row {
8487 if current_doc_path.as_ref() == Some(&self.location.uri) {
8588 self.name.as_str().into()
8689 } else {
@@ -110,7 +113,7 @@ struct PickerDiagnostic {
110113impl ui::menu::Item for PickerDiagnostic {
111114 type Data = (DiagnosticStyles, DiagnosticsFormat);
112115
113− fn label(&self, (styles, format): &Self::Data) -> Spans {
116+ fn format(&self, (styles, format): &Self::Data) -> Row {
114117 let mut style = self
115118 .diag
116119 .severity
@@ -149,6 +152,7 @@ impl ui::menu::Item for PickerDiagnostic {
149152 Span::styled(&self.diag.message, style),
150153 Span::styled(code, style),
151154 ])
155+ .into()
152156 }
153157}
154158
@@ -467,7 +471,7 @@ pub fn workspace_diagnostics_picker(cx: &mut Context) {
467471
468472impl ui::menu::Item for lsp::CodeActionOrCommand {
469473 type Data = ();
470− fn label(&self, _data: &Self::Data) -> Spans {
474+ fn format(&self, _data: &Self::Data) -> Row {
471475 match self {
472476 lsp::CodeActionOrCommand::CodeAction(action) => action.title.as_str().into(),
473477 lsp::CodeActionOrCommand::Command(command) => command.title.as_str().into(),
@@ -662,7 +666,7 @@ pub fn code_action(cx: &mut Context) {
662666
663667impl ui::menu::Item for lsp::Command {
664668 type Data = ();
665− fn label(&self, _data: &Self::Data) -> Spans {
669+ fn format(&self, _data: &Self::Data) -> Row {
666670 self.title.as_str().into()
667671 }
668672}