feat(xatu): add let order rule #88

Closed
alexion wants to merge 5 commits from refs/pull/88/head into main
pull from: refs/pull/88/head
2 changed files with 12 additions and 7 deletions
Showing only changes of commit 90be3f871c - Show all commits

No files matched your search

+11 -6
View File
@@ -144,13 +144,18 @@ impl ExprReferences for rnix::ast::Expr {
} }
fn is_reference(ident: &rnix::ast::Ident) -> bool { fn is_reference(ident: &rnix::ast::Ident) -> bool {
let parent = ident.syntax().parent();
let grandparent = parent.as_ref().and_then(rowan::SyntaxNode::parent);
!matches!( !matches!(
ident.syntax().parent().and_then(|parent| parent.parent()), (
Some(grandparent) parent.map(|node| node.kind()),
if matches!( grandparent.map(|node| node.kind())
grandparent.kind(), ),
rnix::SyntaxKind::NODE_ATTRPATH_VALUE | rnix::SyntaxKind::NODE_SELECT (
) Some(rnix::SyntaxKind::NODE_ATTRPATH),
Some(rnix::SyntaxKind::NODE_ATTRPATH_VALUE | rnix::SyntaxKind::NODE_SELECT),
)
) )
} }
+1 -1
View File
@@ -1,6 +1,6 @@
let let
support = "support"; support = "support";
primary = support; primary = support.value;
in { in {
package = package; package = package;
from = pkgs.from; from = pkgs.from;