(state: &ExtractionState, node: TsNode<'_>)
| 512 | } |
| 513 | |
| 514 | fn extract_docstring(state: &ExtractionState, node: TsNode<'_>) -> Option<String> { |
| 515 | let prev = node.prev_named_sibling()?; |
| 516 | if prev.kind() == "attribute" { |
| 517 | let text = state.node_text(prev); |
| 518 | if text.contains("@doc") || text.contains("@ocaml.doc") { |
| 519 | return Some(text.trim_matches('[').trim_matches(']').trim().to_string()); |
| 520 | } |
| 521 | } |
| 522 | None |
| 523 | } |
| 524 | |
| 525 | fn first_line(state: &ExtractionState, node: TsNode<'_>) -> Option<String> { |
| 526 | let text = state.node_text(node); |