(&mut self, kind: &'static str, name: &str, node: Node<'t>, extra: Extra)
| 459 | // --- createNode ------------------------------------------------------------ |
| 460 | |
| 461 | fn create_node(&mut self, kind: &'static str, name: &str, node: Node<'t>, extra: Extra) -> Option<u32> { |
| 462 | if name.is_empty() { |
| 463 | return None; |
| 464 | } |
| 465 | let start_line = self.line_of(node); |
| 466 | let column = self.col_of(node); |
| 467 | let id = self.node_id_allocator.generate(self.file_path, kind, name, start_line, column); |
| 468 | // endLine extension via resolveBody — LIVE for kotlin function/method |
| 469 | // kinds (in-range for this grammar, so practically a no-op — but the |
| 470 | // hook is part of the contract). |
| 471 | let mut end_line = node.end_position().row as u32 + 1; |
| 472 | if kind == "function" || kind == "method" { |
| 473 | if let Some(body) = self.resolve_body(node) { |
| 474 | let be = body.end_position().row as u32 + 1; |
| 475 | if be > end_line { |
| 476 | end_line = be; |
| 477 | } |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | let qualified = match &extra.qualified_override { |
| 482 | Some(qn) => qn.clone(), |
| 483 | None => { |
| 484 | let mut parts: Vec<&str> = Vec::new(); |
| 485 | for s in &self.stack { |
| 486 | if s.kind != "file" { |
| 487 | parts.push(&s.name); |
| 488 | } |
| 489 | } |
| 490 | let mut qn = parts.join("::"); |
| 491 | if !qn.is_empty() { |
| 492 | qn.push_str("::"); |
| 493 | } |
| 494 | qn.push_str(name); |
| 495 | qn |
| 496 | } |
| 497 | }; |
| 498 | |
| 499 | let mut flags = BoolFlags::default(); |
| 500 | if let Some(v) = extra.is_async { |
| 501 | flags.set(FLAG_IS_ASYNC, v); |
| 502 | } |
| 503 | if let Some(v) = extra.is_static { |
| 504 | flags.set(FLAG_IS_STATIC, v); |
| 505 | } |
| 506 | // extractModifiers merge (tree-sitter.ts:1355) — runs for EVERY |
| 507 | // created node: expect/actual platform modifiers → decorators. |
| 508 | let mods = self.extract_modifiers(node); |
| 509 | let dec_ref: StrRef = match &mods { |
| 510 | Some(list) if !list.is_empty() => self.arena.put_list(list), |
| 511 | _ => NONE_STR, |
| 512 | }; |
| 513 | let name_ref = self.arena.put(name); |
| 514 | let qn_ref = self.arena.put(&qualified); |
| 515 | let id_ref = self.arena.put(&id); |
| 516 | let doc_ref = opt_str(&mut self.arena, extra.docstring.as_deref()); |
| 517 | let sig_ref = opt_str(&mut self.arena, extra.signature.as_deref()); |
| 518 | let ret_ref = opt_str(&mut self.arena, extra.return_type.as_deref()); |
no test coverage detected