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

Function pythonHeadKind

src/resolution/import-resolver.ts:1110–1114  ·  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

1108
1109/** How `root` provides the top-level name `head`: concretely, as a namespace portion, or not at all. */
1110function pythonHeadKind(root: string, head: string, index: PythonModuleIndex): 'concrete' | 'namespace' | null {
1111 const base = joinRel(root, head);
1112 if (pythonModuleAt(base, index)) return 'concrete';
1113 return index.dirs.has(base) ? 'namespace' : null;
1114}
1115
1116/** Every root (project or local) providing the top-level name `head`, by kind. */
1117function 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