feat(natu): report expected let order

This commit was merged in pull request #102.
This commit is contained in:
2026-09-26 23:20:00 -04:00
parent 09a2093f90
commit 5e5c3e2534
7 changed files with 87 additions and 25 deletions

View File

@@ -22,6 +22,7 @@ pub struct Finding {
pub range: ast::SourceRange,
pub message: &'static str,
pub binding: Option<String>,
pub expected_order: Option<Vec<String>>,
}
impl std::fmt::Display for Diagnostic {
@@ -79,7 +80,8 @@ pub fn run_rules(file: &ast::ParsedFile, graph: &ScopeGraph) -> Vec<Diagnostic>
rule_id: "let_order",
range: finding.range,
message: "Let bindings must follow dependency order",
binding: Some(finding.binding),
binding: None,
expected_order: Some(finding.expected_order),
});
node_diagnostics
@@ -104,6 +106,7 @@ where
range: node.range,
message,
binding: None,
expected_order: None,
})
}
@@ -119,5 +122,6 @@ where
range: token.range,
message,
binding: None,
expected_order: None,
})
}