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

Method visit_require

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

Source from the content-addressed store, hash-verified

351 }
352
353 fn visit_require(state: &mut ExtractionState, node: TsNode<'_>) {
354 let text = state.node_text(node);
355 let start_line = node.start_position().row as u32;
356 let id = generate_node_id(&state.file_path, &NodeKind::Use, "require", start_line);
357
358 let graph_node = Node {
359 id: id.clone(),
360 kind: NodeKind::Use,
361 name: "require".to_string(),
362 qualified_name: format!("{}::require", state.file_path),
363 file_path: state.file_path.clone(),
364 start_line,
365 attrs_start_line: start_line,
366 end_line: node.end_position().row as u32,
367 start_column: node.start_position().column as u32,
368 end_column: node.end_position().column as u32,
369 signature: Some(text.trim().to_string()),
370 docstring: None,
371 visibility: Visibility::Private,
372 is_async: false,
373 branches: 0,
374 loops: 0,
375 returns: 0,
376 max_nesting: 0,
377 unsafe_blocks: 0,
378 unchecked_calls: 0,
379 assertions: 0,
380 updated_at: state.timestamp,
381 parent_id: None,
382 };
383 state.nodes.push(graph_node);
384 if let Some(parent_id) = state.parent_node_id() {
385 state.edges.push(Edge {
386 source: parent_id.to_string(),
387 target: id,
388 kind: EdgeKind::Contains,
389 line: Some(start_line),
390 });
391 }
392 }
393
394 /// Returns the text of the first `sym_lit` child.
395 fn first_sym(state: &ExtractionState, node: TsNode<'_>) -> Option<String> {

Callers

nothing calls this directly

Calls 4

generate_node_idFunction · 0.85
pushMethod · 0.80
node_textMethod · 0.45
parent_node_idMethod · 0.45

Tested by

no test coverage detected