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

Function last_simple_identifier

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

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected