getSignature (dart.ts:189-208).
(&self, node: Node<'t>)
| 453 | |
| 454 | /// getSignature (dart.ts:189-208). |
| 455 | fn signature_of(&self, node: Node<'t>) -> Option<String> { |
| 456 | let sig = self.inner_signature(node); |
| 457 | let mut c1 = sig.walk(); |
| 458 | let params = sig |
| 459 | .named_children(&mut c1) |
| 460 | .find(|c| c.kind() == "formal_parameter_list"); |
| 461 | let mut c2 = sig.walk(); |
| 462 | let ret = sig |
| 463 | .named_children(&mut c2) |
| 464 | .find(|c| matches!(c.kind(), "type_identifier" | "void_type")); |
| 465 | if params.is_none() && ret.is_none() { |
| 466 | return None; |
| 467 | } |
| 468 | let mut result = String::new(); |
| 469 | if let Some(r) = ret { |
| 470 | result.push_str(self.text(r)); |
| 471 | result.push(' '); |
| 472 | } |
| 473 | if let Some(p) = params { |
| 474 | result.push_str(self.text(p)); |
| 475 | } |
| 476 | let trimmed = result.trim(); |
| 477 | if trimmed.is_empty() { |
| 478 | None |
| 479 | } else { |
| 480 | Some(trimmed.to_string()) |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | /// getVisibility (dart.ts:209-222) — `_` prefix = private; every |
| 485 | /// constructor is public (the unwrap misses ctor signatures / the name |
no test coverage detected