(state: &mut ExtractionState, node: TsNode<'_>)
| 152 | } |
| 153 | |
| 154 | fn visit_ns(state: &mut ExtractionState, node: TsNode<'_>) { |
| 155 | // (ns my.namespace ...) |
| 156 | let Some(name) = Self::nth_sym(state, node, 1) else { |
| 157 | return; |
| 158 | }; |
| 159 | let start_line = node.start_position().row as u32; |
| 160 | let qualified_name = format!("{}::{}", state.file_path, name); |
| 161 | let id = generate_node_id(&state.file_path, &NodeKind::Module, &name, start_line); |
| 162 | |
| 163 | let graph_node = Node { |
| 164 | id: id.clone(), |
| 165 | kind: NodeKind::Module, |
| 166 | name: name.clone(), |
| 167 | qualified_name, |
| 168 | file_path: state.file_path.clone(), |
| 169 | start_line, |
| 170 | attrs_start_line: start_line, |
| 171 | end_line: node.end_position().row as u32, |
| 172 | start_column: node.start_position().column as u32, |
| 173 | end_column: node.end_position().column as u32, |
| 174 | signature: None, |
| 175 | docstring: None, |
| 176 | visibility: Visibility::Pub, |
| 177 | is_async: false, |
| 178 | branches: 0, |
| 179 | loops: 0, |
| 180 | returns: 0, |
| 181 | max_nesting: 0, |
| 182 | unsafe_blocks: 0, |
| 183 | unchecked_calls: 0, |
| 184 | assertions: 0, |
| 185 | updated_at: state.timestamp, |
| 186 | parent_id: None, |
| 187 | }; |
| 188 | state.nodes.push(graph_node); |
| 189 | |
| 190 | if let Some(parent_id) = state.parent_node_id() { |
| 191 | state.edges.push(Edge { |
| 192 | source: parent_id.to_string(), |
| 193 | target: id.clone(), |
| 194 | kind: EdgeKind::Contains, |
| 195 | line: Some(start_line), |
| 196 | }); |
| 197 | } |
| 198 | |
| 199 | state.node_stack.push((name, id)); |
| 200 | Self::visit_children(state, node); |
| 201 | state.node_stack.pop(); |
| 202 | } |
| 203 | |
| 204 | fn visit_defn(state: &mut ExtractionState, node: TsNode<'_>, is_macro: bool) { |
| 205 | // (defn name [args] "docstring" body) |
nothing calls this directly
no test coverage detected