MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / root_module

Method root_module

codegraph-kernel/src/rustlang.rs:806–816  ·  view source on GitHub ↗

getRootModule (languages/rust.ts:124).

(&self, n: Node)

Source from the content-addressed store, hash-verified

804
805 /// getRootModule (languages/rust.ts:124).
806 fn root_module(&self, n: Node) -> String {
807 stack_guard!();
808 let Some(first) = n.named_child(0) else {
809 return self.text(n).to_string();
810 };
811 match first.kind() {
812 "identifier" | "crate" | "super" | "self" => self.text(first).to_string(),
813 "scoped_identifier" => self.root_module(first),
814 _ => self.text(first).to_string(),
815 }
816 }
817
818 /// emitRustUseBindingRefs (tree-sitter.ts:3451) — one FULL-path `imports`
819 /// ref per binding; `Path as Alias` links the source path; leaves that are

Callers 1

extract_importMethod · 0.80

Calls 1

textMethod · 0.65

Tested by

no test coverage detected