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

Function pythonHeadKind

src/resolution/import-resolver.ts:846–850  ·  view source on GitHub ↗

How `root` provides the top-level name `head`: concretely, as a namespace portion, or not at all.

(root: string, head: string, index: PythonModuleIndex)

Source from the content-addressed store, hash-verified

844
845/** How `root` provides the top-level name `head`: concretely, as a namespace portion, or not at all. */
846function pythonHeadKind(root: string, head: string, index: PythonModuleIndex): 'concrete' | 'namespace' | null {
847 const base = joinRel(root, head);
848 if (pythonModuleAt(base, index)) return 'concrete';
849 return index.dirs.has(base) ? 'namespace' : null;
850}
851
852/** Every root (project or local) providing the top-level name `head`, by kind. */
853function pythonRootHeads(head: string, index: PythonModuleIndex): { concrete: string[]; namespace: string[] } {

Callers 2

pythonRootHeadsFunction · 0.85
resolvePythonModuleFunction · 0.85

Calls 3

joinRelFunction · 0.85
pythonModuleAtFunction · 0.85
hasMethod · 0.80

Tested by

no test coverage detected