Extract a module/namespace declaration
(
&self,
node: &Node,
source: &str,
file_path: &str,
exported: bool,
)
| 923 | |
| 924 | /// Extract a module/namespace declaration |
| 925 | fn extract_module( |
| 926 | &self, |
| 927 | node: &Node, |
| 928 | source: &str, |
| 929 | file_path: &str, |
| 930 | exported: bool, |
| 931 | ) -> Option<Entity> { |
| 932 | let name_node = node.child_by_field_name("name")?; |
| 933 | let name = self.node_text(&name_node, source)?; |
| 934 | |
| 935 | let signature = format!("namespace {}", name); |
| 936 | |
| 937 | Some( |
| 938 | Entity::new( |
| 939 | name, |
| 940 | EntityKind::Module, |
| 941 | file_path, |
| 942 | node.start_position().row as u32 + 1, |
| 943 | node.end_position().row as u32 + 1, |
| 944 | ) |
| 945 | .with_column(node.start_position().column as u32) |
| 946 | .with_signature(signature) |
| 947 | .with_exported(exported), |
| 948 | ) |
| 949 | } |
| 950 | |
| 951 | // ========================================================================= |
| 952 | // Helper methods for building signatures |
no test coverage detected