(&mut self, kind: &'static str, name: &str, node: Node<'t>, extra: Extra)
| 261 | // --- createNode (tree-sitter.ts:1308) --------------------------------- |
| 262 | |
| 263 | fn create_node(&mut self, kind: &'static str, name: &str, node: Node<'t>, extra: Extra) -> Option<u32> { |
| 264 | if name.is_empty() { |
| 265 | return None; |
| 266 | } |
| 267 | let start_line = self.line_of(node); |
| 268 | let id = ids::node_id(self.file_path, kind, name, start_line); |
| 269 | |
| 270 | let qualified = { |
| 271 | let mut parts: Vec<&str> = Vec::new(); |
| 272 | for s in &self.stack { |
| 273 | if s.kind != "file" { |
| 274 | parts.push(&s.name); |
| 275 | } |
| 276 | } |
| 277 | let mut qn = parts.join("::"); |
| 278 | if !qn.is_empty() { |
| 279 | qn.push_str("::"); |
| 280 | } |
| 281 | qn.push_str(name); |
| 282 | qn |
| 283 | }; |
| 284 | |
| 285 | // endLine extension (:1322-1334) — LIVE for dart: a function/method |
| 286 | // node's endLine extends to its sibling function_body's end. |
| 287 | let mut end_line = node.end_position().row as u32 + 1; |
| 288 | if let Some(ext) = extra.end_line_override { |
| 289 | if ext > end_line { |
| 290 | end_line = ext; |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | let name_ref = self.arena.put(name); |
| 295 | let qn_ref = self.arena.put(&qualified); |
| 296 | let id_ref = self.arena.put(&id); |
| 297 | let doc_ref = opt_str(&mut self.arena, extra.docstring.as_deref()); |
| 298 | let sig_ref = opt_str(&mut self.arena, extra.signature.as_deref()); |
| 299 | let ret_ref = opt_str(&mut self.arena, extra.return_type.as_deref()); |
| 300 | let mut flags = BoolFlags::default(); |
| 301 | if let Some(v) = extra.is_async { |
| 302 | flags.set(FLAG_IS_ASYNC, v); |
| 303 | } |
| 304 | if let Some(v) = extra.is_static { |
| 305 | flags.set(FLAG_IS_STATIC, v); |
| 306 | } |
| 307 | let row = self.tables.push_node(&NodeRow { |
| 308 | kind: node_kind_index(kind).unwrap(), |
| 309 | visibility: extra.visibility, |
| 310 | flags, |
| 311 | start_line, |
| 312 | end_line, |
| 313 | start_column: self.col_of(node), |
| 314 | end_column: self.end_col_of(node), |
| 315 | name: name_ref, |
| 316 | qualified_name: qn_ref, |
| 317 | id: id_ref, |
| 318 | docstring: doc_ref, |
| 319 | signature: sig_ref, |
| 320 | decorators: NONE_STR, |
no test coverage detected