Extract an interface declaration
(
&self,
node: &Node,
source: &str,
file_path: &str,
exported: bool,
)
| 836 | |
| 837 | /// Extract an interface declaration |
| 838 | fn extract_interface( |
| 839 | &self, |
| 840 | node: &Node, |
| 841 | source: &str, |
| 842 | file_path: &str, |
| 843 | exported: bool, |
| 844 | ) -> Option<Entity> { |
| 845 | let name_node = node.child_by_field_name("name")?; |
| 846 | let name = self.node_text(&name_node, source)?; |
| 847 | |
| 848 | // Build signature with extends if present |
| 849 | let extends = self.get_interface_extends(node, source); |
| 850 | let signature = if extends.is_empty() { |
| 851 | format!("interface {}", name) |
| 852 | } else { |
| 853 | format!("interface {} extends {}", name, extends) |
| 854 | }; |
| 855 | |
| 856 | Some( |
| 857 | Entity::new( |
| 858 | name, |
| 859 | EntityKind::Interface, |
| 860 | file_path, |
| 861 | node.start_position().row as u32 + 1, |
| 862 | node.end_position().row as u32 + 1, |
| 863 | ) |
| 864 | .with_column(node.start_position().column as u32) |
| 865 | .with_signature(signature) |
| 866 | .with_exported(exported), |
| 867 | ) |
| 868 | } |
| 869 | |
| 870 | /// Extract a type alias declaration |
| 871 | fn extract_type_alias( |
no test coverage detected