aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/document.rs
diff options
context:
space:
mode:
authorKirawi2021-10-29 01:11:30 +0000
committerGitHub2021-10-29 01:11:30 +0000
commitcec0cfdaecdb9b3e7fdf3ae3bb3252ba3f2f2752 (patch)
treec3fc9505476476d304e82f76e00d3a819e1aaf58 /helix-view/src/document.rs
parentbc6a34d97edae55811c2476278a6288d7d258af3 (diff)
Uncomment mapping LSP diagnostics through changes (#925)
Diffstat (limited to 'helix-view/src/document.rs')
-rw-r--r--helix-view/src/document.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index c623277d..02da4b7a 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -657,14 +657,13 @@ impl Document {
}
// 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);
- // }
+ 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
if let Some(language_server) = self.language_server() {