Find the first `simple_identifier` child of a node.
(&self, node: &Node, source: &str)
| 544 | |
| 545 | /// Find the first `simple_identifier` child of a node. |
| 546 | fn find_first_simple_identifier(&self, node: &Node, source: &str) -> Option<String> { |
| 547 | let mut cursor = node.walk(); |
| 548 | for child in node.children(&mut cursor) { |
| 549 | if child.kind() == "simple_identifier" { |
| 550 | return Some(self.node_text(&child, source)); |
| 551 | } |
| 552 | } |
| 553 | None |
| 554 | } |
| 555 | |
| 556 | /// Get the text content of a node. |
| 557 | fn node_text(&self, node: &Node, source: &str) -> String { |
no test coverage detected