getRootModule (languages/rust.ts:124).
(&self, n: Node)
| 698 | |
| 699 | /// getRootModule (languages/rust.ts:124). |
| 700 | fn root_module(&self, n: Node) -> String { |
| 701 | let Some(first) = n.named_child(0) else { |
| 702 | return self.text(n).to_string(); |
| 703 | }; |
| 704 | match first.kind() { |
| 705 | "identifier" | "crate" | "super" | "self" => self.text(first).to_string(), |
| 706 | "scoped_identifier" => self.root_module(first), |
| 707 | _ => self.text(first).to_string(), |
| 708 | } |
| 709 | } |
| 710 | |
| 711 | /// emitRustUseBindingRefs (tree-sitter.ts:3451) — one FULL-path `imports` |
| 712 | /// ref per binding; `Path as Alias` links the source path; leaves that are |