Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions server/src/core/diagnostic_codes_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,6 @@ OLS05036, DiagnosticSetting::Error, "Empty Value data, text data or file attribu
*/
OLS05037, DiagnosticSetting::Error, "Empty Value data, one of text data, `file`, `eval`, or `search` has to be provided",
/**
* Empty Function data, either of `eval` attribute , or one or more `value`, or `function` children have to be provided.
*/
OLS05038, DiagnosticSetting::Error, "Empty Function data, either of `eval` attribute , or one or more `value`, or `function` children have to be provided",
/**
* You provided an empty XML ID. Please provide a valid XML ID.
*/
OLS05039, DiagnosticSetting::Error, "Empty XML ID. Please provide a valid XML ID.",
Expand Down
11 changes: 0 additions & 11 deletions server/src/core/xml_arch_builder_rng_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,8 @@ impl XmlArchBuilder {
}
}
}
let mut has_value_or_function_child = false;
for child in node.children().filter(|n| n.is_element()) {
if self.load_value(session, &child, diagnostics) {
has_value_or_function_child = true;
if has_eval {
if let Some(diagnostic) = create_diagnostic(session, DiagnosticCode::OLS05045, &[]) {
diagnostics.push(Diagnostic {
Expand All @@ -575,7 +573,6 @@ impl XmlArchBuilder {
}
}
} else if self.load_function(session, &child, diagnostics) {
has_value_or_function_child = true;
if has_eval {
if let Some(diagnostic) = create_diagnostic(session, DiagnosticCode::OLS05047, &[]) {
diagnostics.push(Diagnostic {
Expand All @@ -593,14 +590,6 @@ impl XmlArchBuilder {
}
}
}
if !has_eval && !has_value_or_function_child {
if let Some(diagnostic) = create_diagnostic(session, DiagnosticCode::OLS05038, &[]) {
diagnostics.push(Diagnostic {
range: Range { start: Position::new(node.range().start as u32, 0), end: Position::new(node.range().end as u32, 0) },
..diagnostic.clone()
});
}
}
true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<function name="name" model="model" eval="eval"><value>children values not allowed</value></function> <!-- OLS05045 -->
<function name="name" model="model" invalid_attr="error" eval="some_data"/> <!-- OLS05046 -->
<function name="name" model="model" eval="eval"><function name="name" model="model" eval="some_data"/></function> <!-- OLS05047 -->
<function name="name" model="model"/> <!-- OLS05038 -->
<function name="name" model="model"/>
<function name="name" model="model" eval="eval"><invalid_node /></function> <!-- OLS05048 -->
<record id="bike_5" model="bikes.bike"><field name="wheel_id" ref=""/></record> <!-- OLS05039 -->
<record id="bike_6" model="bikes.bike"><field name="wheel_id" ref="module_for_diagnostics.bike_wheel_6.too.many.dots"/></record> <!-- OLS05051 -->
Expand Down
1 change: 0 additions & 1 deletion server/tests/diagnostics/ols05000s.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ fn test_ols05000s_xml_file() {
check_xml_diag("OLS05045", 79);
check_xml_diag("OLS05046", 80);
check_xml_diag("OLS05047", 81);
check_xml_diag("OLS05038", 82);
check_xml_diag("OLS05048", 83);
check_xml_diag("OLS05039", 84);
check_xml_diag("OLS05051", 85);
Expand Down