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

Method signature_of

codegraph-kernel/src/tsjs/mod.rs:764–776  ·  view source on GitHub ↗

typescriptExtractor.getSignature / javascriptExtractor.getSignature.

(&self, node: Node)

Source from the content-addressed store, hash-verified

762
763 /// typescriptExtractor.getSignature / javascriptExtractor.getSignature.
764 fn signature_of(&self, node: Node) -> Option<String> {
765 let params = node.child_by_field_name("parameters")?;
766 let mut sig = self.text(params).to_string();
767 if self.variant.is_ts() {
768 if let Some(ret) = node.child_by_field_name("return_type") {
769 let ret_text = self.text(ret);
770 let stripped = ret_text.strip_prefix(':').unwrap_or(ret_text).trim_start();
771 sig.push_str(": ");
772 sig.push_str(stripped);
773 }
774 }
775 Some(sig)
776 }
777
778 /// typescriptExtractor.getVisibility (TS only — JS has no hook).
779 fn visibility_of(&self, node: Node) -> Option<u8> {

Callers 2

extract_functionMethod · 0.45
extract_methodMethod · 0.45

Calls 2

is_tsMethod · 0.80
textMethod · 0.65

Tested by

no test coverage detected