Ref T8674. This implementation is not really very efficient, but I'll try to iterate on that.
Details
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Maniphest Tasks
- T8674: ArcanistClassNameLiteralXHPASTLinterRule can produce incorrect results
- Commits
- rPHUe020e10ffa03: Add a method to query whether an AASTNode is a descendent of another node
See D13820.
Diff Detail
Diff Detail
- Repository
- rPHU libphutil
- Branch
- master
- Lint
Lint Passed - Unit
Tests Passed - Build Status
Buildable 7547 Build 8134: [Placeholder Plan] Wait for 30 Seconds Build 8133: arc lint + arc unit
Event Timeline
Comment Actions
Consider isDescendantOf($x) or hasDescendant($x) or isAncestorOf($x) or hasAncestor($x) or similar to make intent more clear -- I think this $x->isDescendant($y) can be reasonably be read as either "$x is a descendant of $y" or "$y is a descendant of $x".
Specifically, I would expect this to mean "$x is a descendant of $y", because most $x->is...() methods return information about $x, but it actually means "$y is a descendant of $x". I would perhaps call this method isAncestorOf($y). This makes the $x/$y relationship more clear, although I don't think X being an ancestor of itself is always intuitive (but I don't have a better term for it offhand).