Extract the function signature (first line of the function declaration).
(state: &ExtractionState, node: TsNode<'_>)
| 816 | |
| 817 | /// Extract the function signature (first line of the function declaration). |
| 818 | fn extract_function_signature(state: &ExtractionState, node: TsNode<'_>) -> Option<String> { |
| 819 | let text = state.node_text(node); |
| 820 | let first_line = text.lines().next()?.trim().to_string(); |
| 821 | // Strip the opening brace if it's on the same line. |
| 822 | let sig = first_line.trim_end_matches('{').trim().to_string(); |
| 823 | if sig.is_empty() { |
| 824 | None |
| 825 | } else { |
| 826 | Some(sig) |
| 827 | } |
| 828 | } |
| 829 | |
| 830 | /// Extract the first line as signature for type declarations. |
| 831 | fn extract_first_line_signature(state: &ExtractionState, node: TsNode<'_>) -> Option<String> { |