Build a function signature from the return type and declarator.
(&self, node: &Node, source: &str)
| 667 | |
| 668 | /// Build a function signature from the return type and declarator. |
| 669 | fn build_function_signature(&self, node: &Node, source: &str) -> Option<String> { |
| 670 | let full_text = self.node_text(node, source); |
| 671 | // Take everything up to the opening brace |
| 672 | if let Some(brace_pos) = full_text.find('{') { |
| 673 | let sig = full_text[..brace_pos].trim(); |
| 674 | // Collapse whitespace for cleaner signatures |
| 675 | let collapsed: String = sig.split_whitespace().collect::<Vec<_>>().join(" "); |
| 676 | Some(collapsed) |
| 677 | } else { |
| 678 | // No body (prototype / forward declaration) — use full text |
| 679 | let trimmed = full_text.trim().trim_end_matches(';'); |
| 680 | let collapsed: String = trimmed.split_whitespace().collect::<Vec<_>>().join(" "); |
| 681 | Some(collapsed) |
| 682 | } |
| 683 | } |
| 684 | |
| 685 | // ── Helpers ───────────────────────────────────────────────────── |
| 686 |
no test coverage detected