extractImport via csharpExtractor.extractImport: moduleName = first qualified_name child's text, else first identifier's — with the alias quirks (alias-to-qualified keeps generic args on the TARGET text; alias-to-identifier captures the ALIAS name) preserved verbatim.
(&mut self, node: Node<'t>)
| 979 | /// quirks (alias-to-qualified keeps generic args on the TARGET text; |
| 980 | /// alias-to-identifier captures the ALIAS name) preserved verbatim. |
| 981 | fn extract_import(&mut self, node: Node<'t>) { |
| 982 | let import_text = self.text(node).trim().to_string(); |
| 983 | let target = (0..node.named_child_count()) |
| 984 | .filter_map(|i| node.named_child(i)) |
| 985 | .find(|c| c.kind() == "qualified_name") |
| 986 | .or_else(|| { |
| 987 | (0..node.named_child_count()) |
| 988 | .filter_map(|i| node.named_child(i)) |
| 989 | .find(|c| c.kind() == "identifier") |
| 990 | }); |
| 991 | let Some(target) = target else { return }; // hook declined → no node, no ref |
| 992 | let module_name = self.text(target).to_string(); |
| 993 | if module_name.is_empty() { |
| 994 | return; |
| 995 | } |
| 996 | self.create_node( |
| 997 | "import", |
| 998 | &module_name, |
| 999 | node, |
| 1000 | Extra { signature: Some(import_text), ..Extra::default() }, |
| 1001 | ); |
| 1002 | // One generic `imports` ref from the stack top (the namespace node in |
| 1003 | // a namespaced file, else the file node). No per-binding emitter. |
| 1004 | let parent = self.top_row(); |
| 1005 | self.push_ref_at(parent, &module_name.clone(), edge_kind_index("imports").unwrap(), node); |
| 1006 | } |
| 1007 | |
| 1008 | /// extractCall — the C# branch (tree-sitter.ts:4502) + shared tail. |
| 1009 | fn extract_call(&mut self, node: Node<'t>) { |
no test coverage detected