on master help sign in
doc: Note about diagnostic mapping.
b0bdcabBlaž Hrastnik
helix-view/src/document.rs+8−4
@@ -213,10 +213,14 @@ impl Document {
213 .unwrap();
213 .unwrap();
214 }
214 }
215
215
216− // if let Some(diagnostics) = &mut self.diagnostics {
217− // for diagnostic in diagnostics {
218− // // TODO: map state.diagnostics over changes::map_pos too
216+ // map state.diagnostics over changes::map_pos too
219− // }
217+ // NOTE: seems to do nothing since the language server resends diagnostics on each edit
218+ // for diagnostic in &mut self.diagnostics {
219+ // use helix_core::Assoc;
220+ // let changes = transaction.changes();
221+ // diagnostic.range.start = changes.map_pos(diagnostic.range.start, Assoc::After);
222+ // diagnostic.range.end = changes.map_pos(diagnostic.range.end, Assoc::After);
223+ // diagnostic.line = self.text.char_to_line(diagnostic.range.start);
220 // }
224 // }
221
225
222 // emit lsp notification
226 // emit lsp notification