Extract a module/namespace declaration
(
&self,
node: &Node,
source: &str,
file_path: &str,
exported: bool,
)
| 951 | |
| 952 | /// Extract a module/namespace declaration |
| 953 | fn extract_module( |
| 954 | &self, |
| 955 | node: &Node, |
| 956 | source: &str, |
| 957 | file_path: &str, |
| 958 | exported: bool, |
| 959 | ) -> Option<Entity> { |
| 960 | let name_node = node.child_by_field_name("name")?; |
| 961 | let name = self.node_text(&name_node, source)?; |
| 962 | |
| 963 | let signature = format!("namespace {}", name); |
| 964 | |
| 965 | Some( |
| 966 | Entity::new( |
| 967 | name, |
| 968 | EntityKind::Module, |
| 969 | file_path, |
| 970 | node.start_position().row as u32 + 1, |
| 971 | node.end_position().row as u32 + 1, |
| 972 | ) |
| 973 | .with_column(node.start_position().column as u32) |
| 974 | .with_signature(signature) |
| 975 | .with_exported(exported), |
| 976 | ) |
| 977 | } |
| 978 | |
| 979 | // ========================================================================= |
| 980 | // Helper methods for building signatures |
no test coverage detected