diagnostics: use debug rather than hidden terminology, and leave gaps for other severities

This commit is contained in:
Alex Ford
2021-05-13 13:37:32 +01:00
parent acdbd9859e
commit 277a6a020a
4 changed files with 13 additions and 13 deletions

View File

@@ -281,7 +281,7 @@ impl Visitor<'_> {
"diagnostics",
vec![
Arg::Label(id),
Arg::Int(3), // severity 3 = error
Arg::Int(40), // severity 40 = error
Arg::String("parse_error".to_string()),
Arg::String(error_message),
Arg::String(full_error_message),

View File

@@ -645,10 +645,10 @@ fn create_diagnostics<'a>() -> (dbscheme::Case<'a>, dbscheme::Table<'a>) {
],
};
let severities: Vec<(usize, &str)> = vec![
(0, "diagnostic_hidden"),
(1, "diagnostic_info"),
(2, "diagnostic_warning"),
(3, "diagnostic_error"),
(10, "diagnostic_debug"),
(20, "diagnostic_info"),
(30, "diagnostic_warning"),
(40, "diagnostic_error"),
];
let case = dbscheme::Case {
name: "diagnostic",

View File

@@ -17,13 +17,13 @@ class Diagnostic extends @diagnostic {
/** Gets a string representation of the severity of this diagnostic. */
string getSeverityText() {
severity = 0 and result = "Hidden"
severity = 10 and result = "Debug"
or
severity = 1 and result = "Info"
severity = 20 and result = "Info"
or
severity = 2 and result = "Warning"
severity = 30 and result = "Warning"
or
severity = 3 and result = "Error"
severity = 40 and result = "Error"
}
/** Gets the error code associated with this diagnostic, e.g. parse_error. */

View File

@@ -1247,10 +1247,10 @@ diagnostics(
);
case @diagnostic.severity of
0 = @diagnostic_hidden
| 1 = @diagnostic_info
| 2 = @diagnostic_warning
| 3 = @diagnostic_error
10 = @diagnostic_debug
| 20 = @diagnostic_info
| 30 = @diagnostic_warning
| 40 = @diagnostic_error
;