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

Method visit_open

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

Source from the content-addressed store, hash-verified

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

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