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

Method signature_of

codegraph-kernel/src/scala.rs:441–457  ·  view source on GitHub ↗

getSignature (scala.ts:110-117) — first-match-wins fields: curried defs keep only the first list; a type_parameters node carrying field `parameters` wins over the value list.

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

Source from the content-addressed store, hash-verified

439 /// defs keep only the first list; a type_parameters node carrying field
440 /// `parameters` wins over the value list.
441 fn signature_of(&self, node: Node<'t>) -> Option<String> {
442 let params = node.child_by_field_name("parameters");
443 let ret = node.child_by_field_name("return_type");
444 if params.is_none() && ret.is_none() {
445 return None;
446 }
447 let mut sig = params.map(|p| self.text(p).to_string()).unwrap_or_default();
448 if let Some(r) = ret {
449 sig.push_str(": ");
450 sig.push_str(self.text(r));
451 }
452 if sig.is_empty() {
453 None
454 } else {
455 Some(sig)
456 }
457 }
458
459 /// extractScalaReturnType (scala.ts:56-67).
460 fn return_type_of(&self, node: Node<'t>) -> Option<String> {

Callers 1

Calls 2

mapMethod · 0.80
textMethod · 0.65

Tested by

no test coverage detected