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