diff options
author | Blaž Hrastnik | 2021-05-03 08:47:48 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-05-03 08:47:48 +0000 |
commit | b0bdcab97095f9611990211cef679d8a5a05116c (patch) | |
tree | 18c76dc6b83985c1e8ce17a02339c19a586670be /helix-view/src | |
parent | d559199cecb105e07d9812603889a469d415e8b8 (diff) |
doc: Note about diagnostic mapping.
Diffstat (limited to 'helix-view/src')
-rw-r--r-- | helix-view/src/document.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 16a7a88a..9b6f3cca 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -213,10 +213,14 @@ impl Document { .unwrap(); } - // if let Some(diagnostics) = &mut self.diagnostics { - // for diagnostic in diagnostics { - // // TODO: map state.diagnostics over changes::map_pos too - // } + // map state.diagnostics over changes::map_pos too + // NOTE: seems to do nothing since the language server resends diagnostics on each edit + // for diagnostic in &mut self.diagnostics { + // use helix_core::Assoc; + // let changes = transaction.changes(); + // diagnostic.range.start = changes.map_pos(diagnostic.range.start, Assoc::After); + // diagnostic.range.end = changes.map_pos(diagnostic.range.end, Assoc::After); + // diagnostic.line = self.text.char_to_line(diagnostic.range.start); // } // emit lsp notification |