aboutsummaryrefslogtreecommitdiff
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, 13 insertions, 3 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 583d8fc8..24b5317b 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -139,15 +139,25 @@ impl Application {
.diagnostics
.into_iter()
.map(|diagnostic| {
- use helix_lsp::util::lsp_pos_to_pos;
+ use helix_core::diagnostic::Severity::*;
+ use helix_core::{diagnostic::Severity, Diagnostic};
+ use helix_lsp::{lsp, util::lsp_pos_to_pos};
+ use lsp::DiagnosticSeverity;
let start = lsp_pos_to_pos(doc, diagnostic.range.start);
let end = lsp_pos_to_pos(doc, diagnostic.range.end);
- helix_core::Diagnostic {
+ Diagnostic {
range: (start, end),
line: diagnostic.range.start.line as usize,
message: diagnostic.message,
- // severity
+ severity: diagnostic.severity.map(
+ |severity| match severity {
+ DiagnosticSeverity::Error => Error,
+ DiagnosticSeverity::Warning => Warning,
+ DiagnosticSeverity::Information => Info,
+ DiagnosticSeverity::Hint => Hint,
+ },
+ ),
// code
// source
}