@@ -5,7 +5,10 @@ use helix_lsp::{
5 util::{diagnostic_to_lsp_diagnostic, lsp_pos_to_pos, lsp_range_to_range, range_to_lsp_range},
5 util::{diagnostic_to_lsp_diagnostic, lsp_pos_to_pos, lsp_range_to_range, range_to_lsp_range},
6 OffsetEncoding,
6 OffsetEncoding,
8−use tui::text::{Span, Spans};
9+ text::{Span, Spans},
10use super::{align_view, push_jump, Align, Context, Editor, Open};
13use super::{align_view, push_jump, Align, Context, Editor, Open};
@@ -46,7 +49,7 @@ impl ui::menu::Item for lsp::Location {
46 /// Current working directory.
49 /// Current working directory.
47 type Data = PathBuf;
50 type Data = PathBuf;
49− fn label(&self, cwdir: &Self::Data) -> Spans {
52+ fn format(&self, cwdir: &Self::Data) -> Row {
50 // The preallocation here will overallocate a few characters since it will account for the
53 // The preallocation here will overallocate a few characters since it will account for the
51 // URL's scheme, which is not used most of the time since that scheme will be "file://".
54 // URL's scheme, which is not used most of the time since that scheme will be "file://".
52 // Those extra chars will be used to avoid allocating when writing the line number (in the
55 // 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 {
80 /// Path to currently focussed document
83 /// Path to currently focussed document
81 type Data = Option<lsp::Url>;
84 type Data = Option<lsp::Url>;
83− fn label(&self, current_doc_path: &Self::Data) -> Spans {
86+ fn format(&self, current_doc_path: &Self::Data) -> Row {
84 if current_doc_path.as_ref() == Some(&self.location.uri) {
87 if current_doc_path.as_ref() == Some(&self.location.uri) {
85 self.name.as_str().into()
88 self.name.as_str().into()
@@ -110,7 +113,7 @@ struct PickerDiagnostic {
110impl ui::menu::Item for PickerDiagnostic {
113impl ui::menu::Item for PickerDiagnostic {
111 type Data = (DiagnosticStyles, DiagnosticsFormat);
114 type Data = (DiagnosticStyles, DiagnosticsFormat);
113− fn label(&self, (styles, format): &Self::Data) -> Spans {
116+ fn format(&self, (styles, format): &Self::Data) -> Row {
114 let mut style = self
117 let mut style = self
116 .severity
119 .severity
@@ -149,6 +152,7 @@ impl ui::menu::Item for PickerDiagnostic {
149 Span::styled(&self.diag.message, style),
152 Span::styled(&self.diag.message, style),
150 Span::styled(code, style),
153 Span::styled(code, style),
@@ -467,7 +471,7 @@ pub fn workspace_diagnostics_picker(cx: &mut Context) {
468impl ui::menu::Item for lsp::CodeActionOrCommand {
472impl ui::menu::Item for lsp::CodeActionOrCommand {
469 type Data = ();
473 type Data = ();
470− fn label(&self, _data: &Self::Data) -> Spans {
474+ fn format(&self, _data: &Self::Data) -> Row {
471 match self {
475 match self {
472 lsp::CodeActionOrCommand::CodeAction(action) => action.title.as_str().into(),
476 lsp::CodeActionOrCommand::CodeAction(action) => action.title.as_str().into(),
473 lsp::CodeActionOrCommand::Command(command) => command.title.as_str().into(),
477 lsp::CodeActionOrCommand::Command(command) => command.title.as_str().into(),
@@ -662,7 +666,7 @@ pub fn code_action(cx: &mut Context) {
663impl ui::menu::Item for lsp::Command {
667impl ui::menu::Item for lsp::Command {
664 type Data = ();
668 type Data = ();
665− fn label(&self, _data: &Self::Data) -> Spans {
669+ fn format(&self, _data: &Self::Data) -> Row {
666 self.title.as_str().into()
670 self.title.as_str().into()