Skip to content

Commit db0a9fc

Browse files
mmahroussfda-odoo
authored andcommitted
[FIX] fix range for OLS05009 diagnostic
1 parent fd14824 commit db0a9fc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

server/src/core/xml_arch_builder_rng_validation.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,10 @@ impl XmlArchBuilder {
8888
"name" | "active" => {},
8989
"action" => {
9090
if (has_parent || is_submenu) && node.has_children() {
91-
let other_than_text = node.children().any(|c| !c.is_text() && !c.is_comment());
92-
if other_than_text {
91+
for sub_menu in node.children().filter(|c| c.is_element() && c.tag_name().name() == "menuitem") {
9392
if let Some(diagnostic) = create_diagnostic(session, DiagnosticCode::OLS05009, &[]) {
9493
diagnostics.push(Diagnostic {
95-
range: Range { start: Position::new(attr.range().start as u32, 0), end: Position::new(attr.range().end as u32, 0) },
94+
range: Range { start: Position::new(sub_menu.range().start as u32, 0), end: Position::new(sub_menu.range().end as u32, 0) },
9695
..diagnostic.clone()
9796
});
9897
}

0 commit comments

Comments
 (0)