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

Method signature_of

codegraph-kernel/src/scala.rs:439–455  ·  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

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