Every root (project or local) providing the top-level name `head`, by kind.
(head: string, index: PythonModuleIndex)
| 869 | |
| 870 | /** Every root (project or local) providing the top-level name `head`, by kind. */ |
| 871 | function pythonRootHeads(head: string, index: PythonModuleIndex): { concrete: string[]; namespace: string[] } { |
| 872 | let heads = index.headsByName.get(head); |
| 873 | if (!heads) { |
| 874 | heads = { concrete: [], namespace: [] }; |
| 875 | for (const root of [...index.projectRoots, ...index.localRoots.keys()]) { |
| 876 | const kind = pythonHeadKind(root, head, index); |
| 877 | if (kind) heads[kind].push(root); |
| 878 | } |
| 879 | index.headsByName.set(head, heads); |
| 880 | } |
| 881 | return heads; |
| 882 | } |
| 883 | |
| 884 | /** |
| 885 | * Resolve a Python import specifier to the file of the module it names — |
no test coverage detected