Build an interface signature string.
(&self, node: &Node, source: &str)
| 470 | |
| 471 | /// Build an interface signature string. |
| 472 | fn build_interface_signature(&self, node: &Node, source: &str) -> Option<String> { |
| 473 | let name_node = node.child_by_field_name("name")?; |
| 474 | let name = self.node_text(&name_node, source); |
| 475 | |
| 476 | let vis = self.get_visibility(node, source); |
| 477 | |
| 478 | let mut parts = Vec::new(); |
| 479 | if !vis.is_empty() { |
| 480 | parts.push(vis.trim().to_string()); |
| 481 | } |
| 482 | parts.push("interface".to_string()); |
| 483 | parts.push(name); |
| 484 | |
| 485 | // Check for type parameters |
| 486 | if let Some(type_params) = node.child_by_field_name("type_parameters") { |
| 487 | parts.push(self.node_text(&type_params, source)); |
| 488 | } |
| 489 | |
| 490 | // Check for extends |
| 491 | if let Some(extends) = node.child_by_field_name("extends") { |
| 492 | let ext_text = self.node_text(&extends, source); |
| 493 | if !ext_text.is_empty() { |
| 494 | parts.push(format!("extends {}", ext_text)); |
| 495 | } |
| 496 | } |
| 497 | |
| 498 | Some(parts.join(" ")) |
| 499 | } |
| 500 | |
| 501 | /// Build a method signature string. |
| 502 | fn build_method_signature(&self, node: &Node, source: &str) -> Option<String> { |
no test coverage detected