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

Method signature_of

codegraph-kernel/src/dart.rs:455–482  ·  view source on GitHub ↗

getSignature (dart.ts:189-208).

(&self, node: Node<'t>)

Source from the content-addressed store, hash-verified

453
454 /// getSignature (dart.ts:189-208).
455 fn signature_of(&self, node: Node<'t>) -> Option<String> {
456 let sig = self.inner_signature(node);
457 let mut c1 = sig.walk();
458 let params = sig
459 .named_children(&mut c1)
460 .find(|c| c.kind() == "formal_parameter_list");
461 let mut c2 = sig.walk();
462 let ret = sig
463 .named_children(&mut c2)
464 .find(|c| matches!(c.kind(), "type_identifier" | "void_type"));
465 if params.is_none() && ret.is_none() {
466 return None;
467 }
468 let mut result = String::new();
469 if let Some(r) = ret {
470 result.push_str(self.text(r));
471 result.push(' ');
472 }
473 if let Some(p) = params {
474 result.push_str(self.text(p));
475 }
476 let trimmed = result.trim();
477 if trimmed.is_empty() {
478 None
479 } else {
480 Some(trimmed.to_string())
481 }
482 }
483
484 /// getVisibility (dart.ts:209-222) — `_` prefix = private; every
485 /// constructor is public (the unwrap misses ctor signatures / the name

Callers 2

extract_functionMethod · 0.45
extract_methodMethod · 0.45

Calls 2

inner_signatureMethod · 0.80
textMethod · 0.45

Tested by

no test coverage detected