(&mut self, kind: &'static str, name: &str, node: Node<'t>, signature: Option<&str>)
| 178 | // body-extension is dead (no resolveBody hook). |
| 179 | |
| 180 | fn create_node(&mut self, kind: &'static str, name: &str, node: Node<'t>, signature: Option<&str>) -> Option<u32> { |
| 181 | if name.is_empty() { |
| 182 | return None; |
| 183 | } |
| 184 | let start_line = self.line_of(node); |
| 185 | let column = self.col_of(node); |
| 186 | let id = self.node_id_allocator.generate(self.file_path, kind, name, start_line, column); |
| 187 | |
| 188 | // buildQualifiedName (tree-sitter.ts:1447-1460): non-file stack names |
| 189 | // joined `::` (namespacePrefix is always empty for R). |
| 190 | let qualified = { |
| 191 | let mut parts: Vec<&str> = Vec::new(); |
| 192 | for s in &self.stack { |
| 193 | if s.kind != "file" { |
| 194 | parts.push(&s.name); |
| 195 | } |
| 196 | } |
| 197 | let mut qn = parts.join("::"); |
| 198 | if !qn.is_empty() { |
| 199 | qn.push_str("::"); |
| 200 | } |
| 201 | qn.push_str(name); |
| 202 | qn |
| 203 | }; |
| 204 | |
| 205 | let name_ref = self.arena.put(name); |
| 206 | let qn_ref = self.arena.put(&qualified); |
| 207 | let id_ref = self.arena.put(&id); |
| 208 | let sig_ref = match signature { |
| 209 | Some(s) => self.arena.put(s), |
| 210 | None => NONE_STR, |
| 211 | }; |
| 212 | let row = self.tables.push_node(&NodeRow { |
| 213 | kind: node_kind_index(kind).unwrap(), |
| 214 | visibility: 0, |
| 215 | flags: BoolFlags::default(), |
| 216 | start_line, |
| 217 | end_line: node.end_position().row as u32 + 1, |
| 218 | start_column: self.col_of(node), |
| 219 | end_column: self.end_col_of(node), |
| 220 | name: name_ref, |
| 221 | qualified_name: qn_ref, |
| 222 | id: id_ref, |
| 223 | docstring: NONE_STR, |
| 224 | signature: sig_ref, |
| 225 | decorators: NONE_STR, |
| 226 | type_parameters: NONE_STR, |
| 227 | return_type: NONE_STR, |
| 228 | extra_json: NONE_STR, |
| 229 | }); |
| 230 | |
| 231 | // Containment edge from the stack top (always non-empty — file node). |
| 232 | let parent_row = self.top_row(); |
| 233 | self.tables.push_edge(&EdgeRow { |
| 234 | source_idx: parent_row, |
| 235 | target_idx: row, |
| 236 | kind: edge_kind_index("contains").unwrap(), |
| 237 | provenance: 0, |
no test coverage detected