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

Method visit_use

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

Source from the content-addressed store, hash-verified

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