MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / build_function_signature

Method build_function_signature

atomic-semantic/src/parser.rs:991–1009  ·  view source on GitHub ↗

Build function signature from declaration

(&self, node: &Node, source: &str)

Source from the content-addressed store, hash-verified

989
990 /// Build function signature from declaration
991 fn build_function_signature(&self, node: &Node, source: &str) -> String {
992 let start = node.start_byte();
993
994 // Find the body to exclude it from signature
995 let body_start = node
996 .child_by_field_name("body")
997 .map(|b| b.start_byte())
998 .unwrap_or(node.end_byte());
999
1000 let sig = &source[start..body_start];
1001
1002 // Clean up: remove newlines and extra whitespace
1003 sig.lines()
1004 .map(|l| l.trim())
1005 .collect::<Vec<_>>()
1006 .join(" ")
1007 .trim()
1008 .to_string()
1009 }
1010
1011 /// Build arrow function signature
1012 fn build_arrow_function_signature(&self, name: &str, node: &Node, source: &str) -> String {

Callers 1

extract_functionMethod · 0.45

Calls 1

linesMethod · 0.45

Tested by

no test coverage detected