Skip to content

Commit

Permalink
lsp: also show diagnostic note in client
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp15b committed Jun 22, 2024
1 parent ff1961e commit a734b28
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ast/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ impl Diagnostic {
.msg
.clone()
.unwrap_or_else(|| "(no message)".to_string());
let related_information = self
let mut related_information = self
.0
.labels
.iter()
Expand All @@ -543,6 +543,15 @@ impl Diagnostic {
})
})
.collect::<Vec<_>>();
if let Some(note) = &self.0.note {
related_information.push(lsp_types::DiagnosticRelatedInformation {
location: lsp_types::Location {
uri: document_id.uri.clone(),
range,
},
message: format!("Note: {}", note),
})
}
let diagnostic = lsp_types::Diagnostic {
range,
severity: Some(severity),
Expand Down

0 comments on commit a734b28

Please sign in to comment.