aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/lsp.rs17
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(),
+ });
+ }
}
}