getRootModule (languages/rust.ts:124).
(&self, n: Node)
| 793 | |
| 794 | /// getRootModule (languages/rust.ts:124). |
| 795 | fn root_module(&self, n: Node) -> String { |
| 796 | stack_guard!(); |
| 797 | let Some(first) = n.named_child(0) else { |
| 798 | return self.text(n).to_string(); |
| 799 | }; |
| 800 | match first.kind() { |
| 801 | "identifier" | "crate" | "super" | "self" => self.text(first).to_string(), |
| 802 | "scoped_identifier" => self.root_module(first), |
| 803 | _ => self.text(first).to_string(), |
| 804 | } |
| 805 | } |
| 806 | |
| 807 | /// emitRustUseBindingRefs (tree-sitter.ts:3451) — one FULL-path `imports` |
| 808 | /// ref per binding; `Path as Alias` links the source path; leaves that are |