on master help sign in
doc: Note about diagnostic mapping.
commitb0bdcab97095f9611990211cef679d8a5a05116c authorBlaž Hrastnik <blaz@mxxn.io> dateMon 3 May 2021, 17:47 (5 years ago) parentd559199
1 file changed+8−4
helix-view/src/document.rs+8−4
helix-view/src/document.rs+8−4
@@ -213,10 +213,14 @@ impl Document {
213213 .unwrap();
214214 }
215215
216− // if let Some(diagnostics) = &mut self.diagnostics {
217− // for diagnostic in diagnostics {
218− // // TODO: map state.diagnostics over changes::map_pos too
219− // }
216+ // map state.diagnostics over changes::map_pos too
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);
220224 // }
221225
222226 // emit lsp notification