summaryrefslogtreecommitdiff
path: root/helix-term/src/application.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r--helix-term/src/application.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 71c6fba1..b3ddbe15 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -175,8 +175,20 @@ impl Application {
};
use helix_lsp::{lsp, util::lsp_pos_to_pos};
use lsp::DiagnosticSeverity;
- let start = lsp_pos_to_pos(text, diagnostic.range.start);
- let end = lsp_pos_to_pos(text, diagnostic.range.end);
+
+ let language_server = doc.language_server().unwrap();
+
+ // TODO: convert inside server
+ let start = lsp_pos_to_pos(
+ text,
+ diagnostic.range.start,
+ language_server.offset_encoding(),
+ );
+ let end = lsp_pos_to_pos(
+ text,
+ diagnostic.range.end,
+ language_server.offset_encoding(),
+ );
Diagnostic {
range: Range { start, end },