Skip to content

Commit

Permalink
Report warning class
Browse files Browse the repository at this point in the history
Signed-off-by: Ramona Łuczkiewicz <[email protected]>
  • Loading branch information
Ramona Łuczkiewicz authored and ramonacat committed Dec 21, 2022
1 parent 6b1cf02 commit 533f880
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use tower_lsp::lsp_types::{
use tower_lsp::{jsonrpc::Result, lsp_types::WorkspaceServerCapabilities};
use tower_lsp::{Client, LanguageServer};
use tremor_script::arena::Arena;
use tremor_script::highlighter::ErrorLevel;

// stores the latest state of the document as it changes (on edits)
// TODO can add more fields here based on ast parsing
Expand Down Expand Up @@ -86,6 +87,10 @@ impl Backend {
message = format!("{}, Note: {}", message, hint);
}

if let ErrorLevel::Warning(class) = e.level() {
message = format!("{}: {}", class, message);
}

diagnostics.push(Diagnostic {
range,
message,
Expand Down

0 comments on commit 533f880

Please sign in to comment.