We want to find all units the debuggee is composed of or depends on for two reasons:
- Explicitly expose them for the interactive unit, so imports are resolved to the same unitId the debuggee is compiled against.
- Find out if and what subset of haskell-debugger-view we need to compile in memory.
Currently we do it (in graphUnits) by listing all UnitIds we can find in ModuleGraph, however this misses dependencies of units with only ModuleNodeFixed modules, as no downsweep is needed for those and so no UnitNode is created.
Each home unit comes with a preloadUnits :: [UnitId] field (in its UnitState in HomeUnitEnv) which is implemented as the transitive closure of its dependencies, this is true also for the units with only Fixed modules.
If we can rely on that it seems we could avoid traversing the ModuleGraph at all, whose size will generally exceed the one of HomeUnitGraph.
Be sure to test with a wide variety of project structures.
We want to find all units the debuggee is composed of or depends on for two reasons:
Currently we do it (in
graphUnits) by listing allUnitIds we can find in ModuleGraph, however this misses dependencies of units with onlyModuleNodeFixedmodules, as no downsweep is needed for those and so no UnitNode is created.Each home unit comes with a
preloadUnits :: [UnitId]field (in its UnitState in HomeUnitEnv) which is implemented as the transitive closure of its dependencies, this is true also for the units with only Fixed modules.If we can rely on that it seems we could avoid traversing the
ModuleGraphat all, whose size will generally exceed the one ofHomeUnitGraph.Be sure to test with a wide variety of project structures.