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

Method build_function_signature

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

Build function signature from declaration

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

Source from the content-addressed store, hash-verified

944
945 /// Build function signature from declaration
946 fn build_function_signature(&self, node: &Node, source: &str) -> String {
947 let start = node.start_byte();
948
949 // Find the body to exclude it from signature
950 let body_start = node
951 .child_by_field_name("body")
952 .map(|b| b.start_byte())
953 .unwrap_or(node.end_byte());
954
955 let sig = &source[start..body_start];
956
957 // Clean up: remove newlines and extra whitespace
958 sig.lines()
959 .map(|l| l.trim())
960 .collect::<Vec<_>>()
961 .join(" ")
962 .trim()
963 .to_string()
964 }
965
966 /// Build arrow function signature
967 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