MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / last_simple_identifier

Function last_simple_identifier

codegraph-kernel/src/swift.rs:334–346  ·  view source on GitHub ↗

lastNamedOfType (function-ref.ts:600): rightmost matching DESCENDANT in document order (deeper matches override).

(node: Node<'t>)

Source from the content-addressed store, hash-verified

332/// lastNamedOfType (function-ref.ts:600): rightmost matching DESCENDANT in
333/// document order (deeper matches override).
334fn last_simple_identifier<'t>(node: Node<'t>) -> Option<Node<'t>> {
335 stack_guard!();
336 let mut found: Option<Node<'t>> = None;
337 for child in node.named_children(&mut node.walk()) {
338 if child.kind() == "simple_identifier" {
339 found = Some(child);
340 }
341 if let Some(deeper) = last_simple_identifier(child) {
342 found = Some(deeper);
343 }
344 }
345 found
346}
347
348impl<'t> Walker<'t> {
349 fn text(&self, node: Node) -> &'t str {

Callers 1

Calls 1

walkMethod · 0.45

Tested by

no test coverage detected