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

Method build_function_signature

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

Build function signature from declaration

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

Source from the content-addressed store, hash-verified

961
962 /// Build function signature from declaration
963 fn build_function_signature(&self, node: &Node, source: &str) -> String {
964 let start = node.start_byte();
965
966 // Find the body to exclude it from signature
967 let body_start = node
968 .child_by_field_name("body")
969 .map(|b| b.start_byte())
970 .unwrap_or(node.end_byte());
971
972 let sig = &source[start..body_start];
973
974 // Clean up: remove newlines and extra whitespace
975 sig.lines()
976 .map(|l| l.trim())
977 .collect::<Vec<_>>()
978 .join(" ")
979 .trim()
980 .to_string()
981 }
982
983 /// Build arrow function signature
984 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