diff options
author | Philipp Mildenberger | 2023-03-17 14:30:49 +0000 |
---|---|---|
committer | Philipp Mildenberger | 2023-05-18 19:48:32 +0000 |
commit | f9b08656f41cbb9573ffb144f5dc2e24ea764ac9 (patch) | |
tree | b5afb283e1aee452c0b9ed5448cfc9150c52d0ae /helix-term/src/commands | |
parent | 4da6d8ccc7ea4c31cbb31965ee0e6a25b7d403e9 (diff) |
Fix sorting issues of the editor wide diagnostics and apply diagnostics related review suggestions
Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r-- | helix-term/src/commands/lsp.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index efef1211..1a1233a9 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -262,7 +262,7 @@ enum DiagnosticsFormat { fn diag_picker( cx: &Context, - diagnostics: BTreeMap<lsp::Url, Vec<(lsp::Diagnostic, usize, OffsetEncoding)>>, + diagnostics: BTreeMap<lsp::Url, Vec<(lsp::Diagnostic, usize)>>, current_path: Option<lsp::Url>, format: DiagnosticsFormat, ) -> FilePicker<PickerDiagnostic> { @@ -272,12 +272,15 @@ fn diag_picker( let mut flat_diag = Vec::new(); for (url, diags) in diagnostics { flat_diag.reserve(diags.len()); - for (diag, _, offset_encoding) in diags { - flat_diag.push(PickerDiagnostic { - url: url.clone(), - diag, - offset_encoding, - }); + + for (diag, ls) in diags { + if let Some(ls) = cx.editor.language_servers.get_by_id(ls) { + flat_diag.push(PickerDiagnostic { + url: url.clone(), + diag, + offset_encoding: ls.offset_encoding(), + }); + } } } |