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

Method extract_name

codegraph-kernel/src/php.rs:414–426  ·  view source on GitHub ↗
(&self, node: Node)

Source from the content-addressed store, hash-verified

412 }
413
414 fn extract_name(&self, node: Node) -> String {
415 if let Some(name_node) = node.child_by_field_name("name") {
416 return self.text(name_node).to_string();
417 }
418 for i in 0..node.named_child_count() {
419 if let Some(c) = node.named_child(i) {
420 if matches!(c.kind(), "identifier" | "type_identifier" | "simple_identifier" | "constant") {
421 return self.text(c).to_string();
422 }
423 }
424 }
425 "<anonymous>".to_string()
426 }
427
428 // --- hooks (languages/php.ts) ------------------------------------------------
429

Callers 6

extract_functionMethod · 0.45
extract_methodMethod · 0.45
extract_classMethod · 0.45
extract_interfaceMethod · 0.45
extract_enumMethod · 0.45

Calls 1

textMethod · 0.65

Tested by

no test coverage detected