MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / find_first_simple_identifier

Method find_first_simple_identifier

atomic-semantic/src/parsers/swift.rs:546–554  ·  view source on GitHub ↗

Find the first `simple_identifier` child of a node.

(&self, node: &Node, source: &str)

Source from the content-addressed store, hash-verified

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 {

Callers 2

extract_functionMethod · 0.80

Calls 4

walkMethod · 0.80
childrenMethod · 0.80
kindMethod · 0.45
node_textMethod · 0.45

Tested by

no test coverage detected