Skip to content

Commit

Permalink
and more
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed Jan 12, 2025
1 parent 96b5b9b commit 01528b9
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions src-exe/cabal-plan.hs
Original file line number Diff line number Diff line change
Expand Up @@ -602,32 +602,29 @@ dumpTred patterns plan = case reductionClosureAM plan of
-> DotUnitId
-> StateT (Set DotUnitId) CWriter ()
go2 lvl duid@(DU uid comp) = do
if False
then return ()
else do
seen <- gets (S.member duid)
modify' (S.insert duid)
seen <- gets (S.member duid)
modify' (S.insert duid)

let unit = M.findWithDefault (error "non-existing UnitId") uid pm
let pid = uPId unit
let unit = M.findWithDefault (error "non-existing UnitId") uid pm
let pid = uPId unit

let emphasise'
| uType unit == UnitTypeLocal = underline
| uid `S.member` directDepsOfLocalPackages = emphasise
| otherwise = id
let emphasise'
| uType unit == UnitTypeLocal = underline
| uid `S.member` directDepsOfLocalPackages = emphasise
| otherwise = id

let pid_label = emphasise' $ ccol comp (prettyCompTy pid comp)
let pid_label = emphasise' $ ccol comp (prettyCompTy pid comp)

if seen
then putCTextLn $ linepfx lvl <> pid_label <> fromT Rest
else do
let deps' = M.findWithDefault S.empty duid am
let deps = S.filter showUnit' deps'
if seen
then putCTextLn $ linepfx lvl <> pid_label <> fromT Rest
else do
let deps' = M.findWithDefault S.empty duid am
let deps = S.filter showUnit' deps'

putCTextLn $ linepfx lvl <> pid_label
putCTextLn $ linepfx lvl <> pid_label

for_ (lastAnn $ S.toList deps) $ \(l, depDuid) ->
go2 (lvl ++ [(comp, not l)]) depDuid
for_ (lastAnn $ S.toList deps) $ \(l, depDuid) ->
go2 (lvl ++ [(comp, not l)]) depDuid

ccol :: Maybe CompName -> CText -> CText
ccol Nothing = recolorify White
Expand Down

0 comments on commit 01528b9

Please sign in to comment.