(&mut self, kind: &'static str, name: &str, node: Node<'t>, extra: Extra)
| 403 | // --- createNode ------------------------------------------------------------ |
| 404 | |
| 405 | fn create_node(&mut self, kind: &'static str, name: &str, node: Node<'t>, extra: Extra) -> Option<u32> { |
| 406 | if name.is_empty() { |
| 407 | return None; |
| 408 | } |
| 409 | let start_line = self.line_of(node); |
| 410 | let column = self.col_of(node); |
| 411 | let id = self.node_id_allocator.generate(self.file_path, kind, name, start_line, column); |
| 412 | // endLine extension via resolveBody — LIVE for kotlin function/method |
| 413 | // kinds (in-range for this grammar, so practically a no-op — but the |
| 414 | // hook is part of the contract). |
| 415 | let mut end_line = node.end_position().row as u32 + 1; |
| 416 | if kind == "function" || kind == "method" { |
| 417 | if let Some(body) = self.resolve_body(node) { |
| 418 | let be = body.end_position().row as u32 + 1; |
| 419 | if be > end_line { |
| 420 | end_line = be; |
| 421 | } |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | let qualified = match &extra.qualified_override { |
| 426 | Some(qn) => qn.clone(), |
| 427 | None => { |
| 428 | let mut parts: Vec<&str> = Vec::new(); |
| 429 | for s in &self.stack { |
| 430 | if s.kind != "file" { |
| 431 | parts.push(&s.name); |
| 432 | } |
| 433 | } |
| 434 | let mut qn = parts.join("::"); |
| 435 | if !qn.is_empty() { |
| 436 | qn.push_str("::"); |
| 437 | } |
| 438 | qn.push_str(name); |
| 439 | qn |
| 440 | } |
| 441 | }; |
| 442 | |
| 443 | let mut flags = BoolFlags::default(); |
| 444 | if let Some(v) = extra.is_async { |
| 445 | flags.set(FLAG_IS_ASYNC, v); |
| 446 | } |
| 447 | if let Some(v) = extra.is_static { |
| 448 | flags.set(FLAG_IS_STATIC, v); |
| 449 | } |
| 450 | // extractModifiers merge (tree-sitter.ts:1355) — runs for EVERY |
| 451 | // created node: expect/actual platform modifiers → decorators. |
| 452 | let mods = self.extract_modifiers(node); |
| 453 | let dec_ref: StrRef = match &mods { |
| 454 | Some(list) if !list.is_empty() => self.arena.put_list(list), |
| 455 | _ => NONE_STR, |
| 456 | }; |
| 457 | let name_ref = self.arena.put(name); |
| 458 | let qn_ref = self.arena.put(&qualified); |
| 459 | let id_ref = self.arena.put(&id); |
| 460 | let doc_ref = opt_str(&mut self.arena, extra.docstring.as_deref()); |
| 461 | let sig_ref = opt_str(&mut self.arena, extra.signature.as_deref()); |
| 462 | let ret_ref = opt_str(&mut self.arena, extra.return_type.as_deref()); |
no test coverage detected