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

Method visit_function

src/extraction/haskell_extractor.rs:129–149  ·  view source on GitHub ↗
(state: &mut ExtractionState, node: TsNode<'_>)

Source from the content-addressed store, hash-verified

127 }
128
129 fn visit_function(state: &mut ExtractionState, node: TsNode<'_>) {
130 // tree-sitter-haskell: function has a `name` field or first child is the variable name.
131 let name = Self::extract_function_name(state, node);
132 let Some(name) = name else { return };
133
134 let sig = Self::first_line(state, node);
135 let start_line = node.start_position().row as u32;
136 let qualified_name = format!("{}::{}", state.file_path, name);
137 let id = generate_node_id(&state.file_path, &NodeKind::Function, &name, start_line);
138
139 Self::emit(
140 state,
141 id,
142 NodeKind::Function,
143 name,
144 qualified_name,
145 node,
146 sig,
147 None,
148 );
149 }
150
151 fn visit_bind(state: &mut ExtractionState, node: TsNode<'_>) {
152 // `bind` is a pattern binding — skip signatures, only emit function-shaped binds.

Callers

nothing calls this directly

Calls 2

first_lineFunction · 0.85
generate_node_idFunction · 0.85

Tested by

no test coverage detected