Build function signature from declaration
(&self, node: &Node, source: &str)
| 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 { |