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