Every root (project or local) providing the top-level name `head`, by kind.
(head: string, index: PythonModuleIndex)
| 851 | |
| 852 | /** Every root (project or local) providing the top-level name `head`, by kind. */ |
| 853 | function pythonRootHeads(head: string, index: PythonModuleIndex): { concrete: string[]; namespace: string[] } { |
| 854 | let heads = index.headsByName.get(head); |
| 855 | if (!heads) { |
| 856 | heads = { concrete: [], namespace: [] }; |
| 857 | for (const root of [...index.projectRoots, ...index.localRoots.keys()]) { |
| 858 | const kind = pythonHeadKind(root, head, index); |
| 859 | if (kind) heads[kind].push(root); |
| 860 | } |
| 861 | index.headsByName.set(head, heads); |
| 862 | } |
| 863 | return heads; |
| 864 | } |
| 865 | |
| 866 | /** |
| 867 | * Resolve a Python import specifier to the file of the module it names — |
no test coverage detected