Extract an interface declaration
(
&self,
node: &Node,
source: &str,
file_path: &str,
exported: bool,
)
| 819 | |
| 820 | /// Extract an interface declaration |
| 821 | fn extract_interface( |
| 822 | &self, |
| 823 | node: &Node, |
| 824 | source: &str, |
| 825 | file_path: &str, |
| 826 | exported: bool, |
| 827 | ) -> Option<Entity> { |
| 828 | let name_node = node.child_by_field_name("name")?; |
| 829 | let name = self.node_text(&name_node, source)?; |
| 830 | |
| 831 | // Build signature with extends if present |
| 832 | let extends = self.get_interface_extends(node, source); |
| 833 | let signature = if extends.is_empty() { |
| 834 | format!("interface {}", name) |
| 835 | } else { |
| 836 | format!("interface {} extends {}", name, extends) |
| 837 | }; |
| 838 | |
| 839 | Some( |
| 840 | Entity::new( |
| 841 | name, |
| 842 | EntityKind::Interface, |
| 843 | file_path, |
| 844 | node.start_position().row as u32 + 1, |
| 845 | node.end_position().row as u32 + 1, |
| 846 | ) |
| 847 | .with_column(node.start_position().column as u32) |
| 848 | .with_signature(signature) |
| 849 | .with_exported(exported), |
| 850 | ) |
| 851 | } |
| 852 | |
| 853 | /// Extract a type alias declaration |
| 854 | fn extract_type_alias( |
no test coverage detected