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

Method visit_instance

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

Source from the content-addressed store, hash-verified

216 }
217
218 fn visit_instance(state: &mut ExtractionState, node: TsNode<'_>) {
219 // instance ClassName Type where ...
220 let sig_text = Self::first_line(state, node).unwrap_or_default();
221 let name = sig_text
222 .trim_start_matches("instance")
223 .split_whitespace()
224 .take(2)
225 .collect::<Vec<_>>()
226 .join(" ");
227 if name.is_empty() {
228 return;
229 }
230
231 let start_line = node.start_position().row as u32;
232 let qualified_name = format!("{}::instance {}", state.file_path, name);
233 let id = generate_node_id(&state.file_path, &NodeKind::Class, &name, start_line);
234
235 Self::emit(
236 state,
237 id,
238 NodeKind::Class,
239 name,
240 qualified_name,
241 node,
242 Some(sig_text),
243 None,
244 );
245 }
246
247 fn visit_import(state: &mut ExtractionState, node: TsNode<'_>) {
248 let text = state.node_text(node);

Callers

nothing calls this directly

Calls 4

first_lineFunction · 0.85
generate_node_idFunction · 0.85
takeMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected