Apply all review suggestions (doc_id -> id, error message, unnecessary if)

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
pull/2507/head
Philipp Mildenberger 2 years ago
parent 656ee24966
commit f45bbf165e

@ -220,7 +220,7 @@ impl Completion {
{ {
Some(ls) => ls, Some(ls) => ls,
None => { None => {
editor.set_error("language server disappeared between completion request and application"); editor.set_error("completions are outdated");
// TODO close the completion menu somehow, // TODO close the completion menu somehow,
// currently there is no trivial way to access the EditorView to close the completion menu // currently there is no trivial way to access the EditorView to close the completion menu
return; return;

@ -1353,10 +1353,10 @@ impl Editor {
} }
doc.set_version_control_head(self.diff_providers.get_current_head_name(&path)); doc.set_version_control_head(self.diff_providers.get_current_head_name(&path));
let doc_id = self.new_document(doc); let id = self.new_document(doc);
let _ = self.launch_language_servers(doc_id); let _ = self.launch_language_servers(id);
doc_id id
}; };
self.switch(id, action); self.switch(id, action);

@ -66,9 +66,6 @@ pub fn diagnostic<'doc>(
} }
use helix_core::diagnostic::Severity; use helix_core::diagnostic::Severity;
let first_diag_idx_maybe_on_line = diagnostics.partition_point(|d| d.line < line); let first_diag_idx_maybe_on_line = diagnostics.partition_point(|d| d.line < line);
if first_diag_idx_maybe_on_line == diagnostics.len() {
return None;
}
let diagnostics_on_line = diagnostics[first_diag_idx_maybe_on_line..] let diagnostics_on_line = diagnostics[first_diag_idx_maybe_on_line..]
.iter() .iter()
.take_while(|d| { .take_while(|d| {

Loading…
Cancel
Save