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

Method extract_name

codegraph-kernel/src/ruby.rs:370–380  ·  view source on GitHub ↗
(&self, node: Node)

Source from the content-addressed store, hash-verified

368 }
369
370 fn extract_name(&self, node: Node) -> String {
371 if let Some(name_node) = node.child_by_field_name("name") {
372 return self.text(name_node).to_string();
373 }
374 for c in node.named_children(&mut node.walk()) {
375 if matches!(c.kind(), "identifier" | "type_identifier" | "simple_identifier" | "constant") {
376 return self.text(c).to_string();
377 }
378 }
379 "<anonymous>".to_string()
380 }
381
382 /// rubyExtractor.getVisibility — walk the previousNamedSibling chain
383 /// (unbounded, through non-matching siblings); the first `call` sibling

Callers 4

extract_functionMethod · 0.45
extract_methodMethod · 0.45
extract_classMethod · 0.45

Calls 2

textMethod · 0.65
walkMethod · 0.45

Tested by

no test coverage detected