Extract the function signature (first line of the definition).
(
state: &ExtractionState,
node: TsNode<'_>,
_class_context: Option<&str>,
)
| 458 | |
| 459 | /// Extract the function signature (first line of the definition). |
| 460 | fn extract_function_signature( |
| 461 | state: &ExtractionState, |
| 462 | node: TsNode<'_>, |
| 463 | _class_context: Option<&str>, |
| 464 | ) -> Option<String> { |
| 465 | let text = state.node_text(node); |
| 466 | let first_line = text.lines().next()?.trim().to_string(); |
| 467 | if first_line.is_empty() { |
| 468 | None |
| 469 | } else { |
| 470 | Some(first_line) |
| 471 | } |
| 472 | } |
| 473 | |
| 474 | /// Extract docstrings from `--` or `---` comment lines preceding definitions. |
| 475 | /// |