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

Method extract_name

codegraph-kernel/src/python.rs:280–292  ·  view source on GitHub ↗
(&self, node: Node)

Source from the content-addressed store, hash-verified

278 }
279
280 fn extract_name(&self, node: Node) -> String {
281 if let Some(name_node) = node.child_by_field_name("name") {
282 return self.text(name_node).to_string();
283 }
284 for i in 0..node.named_child_count() {
285 if let Some(c) = node.named_child(i) {
286 if matches!(c.kind(), "identifier" | "type_identifier" | "simple_identifier" | "constant") {
287 return self.text(c).to_string();
288 }
289 }
290 }
291 "<anonymous>".to_string()
292 }
293
294 /// pythonExtractor.getSignature: params + ` -> returnType`.
295 fn signature_of(&self, node: Node) -> Option<String> {

Callers 4

extract_functionMethod · 0.45
extract_methodMethod · 0.45
extract_classMethod · 0.45

Calls 1

textMethod · 0.45

Tested by

no test coverage detected