MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / extract_docstring

Method extract_docstring

src/extraction/ocaml_extractor.rs:514–523  ·  view source on GitHub ↗
(state: &ExtractionState, node: TsNode<'_>)

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 3

kindMethod · 0.80
node_textMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected