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

Method extract_function_signature

src/extraction/zig_extractor.rs:818–828  ·  view source on GitHub ↗

Extract the function signature (first line of the function declaration).

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

Source from the content-addressed store, hash-verified

816
817 /// Extract the function signature (first line of the function declaration).
818 fn extract_function_signature(state: &ExtractionState, node: TsNode<'_>) -> Option<String> {
819 let text = state.node_text(node);
820 let first_line = text.lines().next()?.trim().to_string();
821 // Strip the opening brace if it's on the same line.
822 let sig = first_line.trim_end_matches('{').trim().to_string();
823 if sig.is_empty() {
824 None
825 } else {
826 Some(sig)
827 }
828 }
829
830 /// Extract the first line as signature for type declarations.
831 fn extract_first_line_signature(state: &ExtractionState, node: TsNode<'_>) -> Option<String> {

Callers

nothing calls this directly

Calls 2

node_textMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected