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

Function has_function_ancestor

codegraph-kernel/src/ccpp/mod.rs:1974–1983  ·  view source on GitHub ↗

hasFunctionAncestor (tree-sitter.ts:295).

(node: Node)

Source from the content-addressed store, hash-verified

1972
1973/// hasFunctionAncestor (tree-sitter.ts:295).
1974fn has_function_ancestor(node: Node) -> bool {
1975 let mut p = node.parent();
1976 while let Some(n) = p {
1977 if n.kind() == "function_definition" {
1978 return true;
1979 }
1980 p = n.parent();
1981 }
1982 false
1983}
1984
1985fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef {
1986 match s {

Callers 1

extract_variableMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected