Skip to content

Commit

Permalink
fix: display warnings and notes
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru committed Jan 6, 2022
1 parent c7fb497 commit e0c4e1c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lsp/utils.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clarity_repl::clarity::analysis::ContractAnalysis;
use clarity_repl::clarity::diagnostic::Diagnostic as ClarityDiagnostic;
use clarity_repl::clarity::diagnostic::{Diagnostic as ClarityDiagnostic, Level as ClarityLevel};
use clarity_repl::clarity::docs::{
make_api_reference, make_define_reference, make_keyword_reference,
};
Expand Down Expand Up @@ -29,7 +29,11 @@ pub fn convert_clarity_diagnotic_to_lsp_diagnostic(diagnostic: ClarityDiagnostic
// TODO(lgalabru): add hint for contracts not found errors
LspDiagnostic {
range,
severity: Some(DiagnosticSeverity::Error),
severity: match diagnostic.level {
ClarityLevel::Error => Some(DiagnosticSeverity::Error),
ClarityLevel::Warning => Some(DiagnosticSeverity::Warning),
ClarityLevel::Note => Some(DiagnosticSeverity::Information),
},
code: None,
code_description: None,
source: Some("clarity".to_string()),
Expand Down

0 comments on commit e0c4e1c

Please sign in to comment.