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

Method extract_string_child

src/extraction/clojure_extractor.rs:433–448  ·  view source on GitHub ↗

Returns the first `str_lit` child, used for docstrings.

(state: &ExtractionState, node: TsNode<'_>)

Source from the content-addressed store, hash-verified

431
432 /// Returns the first `str_lit` child, used for docstrings.
433 fn extract_string_child(state: &ExtractionState, node: TsNode<'_>) -> Option<String> {
434 let mut cursor = node.walk();
435 if cursor.goto_first_child() {
436 loop {
437 let child = cursor.node();
438 if child.kind() == "str_lit" {
439 let text = state.node_text(child);
440 return Some(text.trim_matches('"').to_string());
441 }
442 if !cursor.goto_next_sibling() {
443 break;
444 }
445 }
446 }
447 None
448 }
449
450 /// Collects call sites from the body of a defn, skipping the first `skip` children.
451 ///

Callers

nothing calls this directly

Calls 2

kindMethod · 0.80
node_textMethod · 0.45

Tested by

no test coverage detected