mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
lsp: Report warnings correctly
Previously all diagnostics had the "error" severity, now warnings are correctly reported as such
This commit is contained in:
parent
93f2a27e35
commit
6576e02837
2 changed files with 14 additions and 1 deletions
|
@ -264,10 +264,15 @@ class LanguageServer:
|
|||
})
|
||||
|
||||
def _create_diagnostic(self, text, err):
|
||||
if isinstance(err, CompileWarning):
|
||||
severity = DiagnosticSeverity.Warning
|
||||
else:
|
||||
severity = DiagnosticSeverity.Error
|
||||
|
||||
return {
|
||||
"range": utils.idxs_to_range(err.start, err.end, text),
|
||||
"message": err.message,
|
||||
"severity": 1,
|
||||
"severity": severity,
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue