Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/commands/lsp.rs')
-rw-r--r--helix-term/src/commands/lsp.rs21
1 files changed, 4 insertions, 17 deletions
diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs
index 0494db3e..ac9dd6e2 100644
--- a/helix-term/src/commands/lsp.rs
+++ b/helix-term/src/commands/lsp.rs
@@ -100,7 +100,7 @@ struct PickerDiagnostic {
diag: lsp::Diagnostic,
}
-fn location_to_file_location(location: &Location) -> Option<FileLocation<'_>> {
+fn location_to_file_location(location: &Location) -> Option<FileLocation> {
let path = location.uri.as_path()?;
let line = Some((
location.range.start.line as usize,
@@ -231,13 +231,6 @@ fn diag_picker(
}
}
- flat_diag.sort_by(|a, b| {
- a.diag
- .severity
- .unwrap_or(lsp::DiagnosticSeverity::HINT)
- .cmp(&b.diag.severity.unwrap_or(lsp::DiagnosticSeverity::HINT))
- });
-
let styles = DiagnosticStyles {
hint: cx.editor.theme.get("hint"),
info: cx.editor.theme.get("info"),
@@ -589,7 +582,7 @@ struct CodeActionOrCommandItem {
impl ui::menu::Item for CodeActionOrCommandItem {
type Data = ();
- fn format(&self, _data: &Self::Data) -> Row<'_> {
+ fn format(&self, _data: &Self::Data) -> Row {
match &self.lsp_item {
lsp::CodeActionOrCommand::CodeAction(action) => action.title.as_str().into(),
lsp::CodeActionOrCommand::Command(command) => command.title.as_str().into(),
@@ -935,13 +928,7 @@ where
}
let call = move |editor: &mut Editor, compositor: &mut Compositor| {
if locations.is_empty() {
- editor.set_error(match feature {
- LanguageServerFeature::GotoDeclaration => "No declaration found.",
- LanguageServerFeature::GotoDefinition => "No definition found.",
- LanguageServerFeature::GotoTypeDefinition => "No type definition found.",
- LanguageServerFeature::GotoImplementation => "No implementation found.",
- _ => "No location found.",
- });
+ editor.set_error("No definition found.");
} else {
goto_impl(editor, compositor, locations);
}
@@ -1146,7 +1133,7 @@ pub fn rename_symbol(cx: &mut Context) {
let Some(language_server) = doc
.language_servers_with_feature(LanguageServerFeature::RenameSymbol)
- .find(|ls| language_server_id.is_none_or(|id| id == ls.id()))
+ .find(|ls| language_server_id.map_or(true, |id| id == ls.id()))
else {
cx.editor
.set_error("No configured language server supports symbol renaming");