(mut node: Node<'_>)
| 143 | } |
| 144 | |
| 145 | fn enclosing_callable(mut node: Node<'_>) -> Option<Node<'_>> { |
| 146 | while let Some(parent) = node.parent() { |
| 147 | if matches!( |
| 148 | parent.kind(), |
| 149 | "closure_expression" |
| 150 | | "arrow_function" |
| 151 | | "lambda_expression" |
| 152 | | "lambda" |
| 153 | | "lambda_literal" |
| 154 | ) { |
| 155 | return None; |
| 156 | } |
| 157 | if callable(parent) { |
| 158 | return Some(parent); |
| 159 | } |
| 160 | node = parent; |
| 161 | } |
| 162 | None |
| 163 | } |
| 164 | |
| 165 | fn lexical_container(mut node: Node<'_>) -> Node<'_> { |
| 166 | while let Some(parent) = node.parent() { |