Apply all review suggestions (doc_id -> id, error message, unnecessary if)
Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
commitf45bbf165e225142b7f1d9f68d0ffcc9fabd265d
authorPhilipp Mildenberger <philipp@mildenberger.me>
dateThu 6 Apr 2023, 02:37 (4 years ago)
parent656ee24
helix-term/src/ui/completion.rs+1−1
@@ -220,7 +220,7 @@ impl Completion {
220220 {
221221 Some(ls) => ls,
222222 None => {
223− editor.set_error("language server disappeared between completion request and application");
223+ editor.set_error("completions are outdated");
224224 // TODO close the completion menu somehow,
225225 // currently there is no trivial way to access the EditorView to close the completion menu
226226 return;
helix-view/src/editor.rs+3−3
@@ -1353,10 +1353,10 @@ impl Editor {
13531353 }
13541354 doc.set_version_control_head(self.diff_providers.get_current_head_name(&path));
13551355
1356− let doc_id = self.new_document(doc);
1357− let _ = self.launch_language_servers(doc_id);
1356+ let id = self.new_document(doc);
1357+ let _ = self.launch_language_servers(id);
13581358
1359− doc_id
1359+ id
13601360 };
13611361
13621362 self.switch(id, action);
helix-view/src/gutter.rs−3
@@ -66,9 +66,6 @@ pub fn diagnostic<'doc>(
6666 }
6767 use helix_core::diagnostic::Severity;
6868 let first_diag_idx_maybe_on_line = diagnostics.partition_point(|d| d.line < line);
69− if first_diag_idx_maybe_on_line == diagnostics.len() {
70− return None;
71− }
7269 let diagnostics_on_line = diagnostics[first_diag_idx_maybe_on_line..]
7370 .iter()
7471 .take_while(|d| {