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

Function last_simple_identifier

codegraph-kernel/src/swift.rs:336–349  ·  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

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected