mirror of
https://github.com/github/semantic.git
synced 2025-01-03 04:51:57 +03:00
Bind the diff info functions at the top level.
This commit is contained in:
parent
b6cc1cfac1
commit
e667657d94
@ -93,12 +93,11 @@ diffTOC blobs diff = removeDupes (diffToTOCSummaries (source <$> blobs) diff) >>
|
||||
|
||||
diffToTOCSummaries :: (StringConv leaf Text, HasDefaultFields fields) => Both Source -> SyntaxDiff leaf fields -> [TOCSummary DiffInfo]
|
||||
diffToTOCSummaries sources = para $ \diff ->
|
||||
let
|
||||
diff' = free (Prologue.fst <$> diff)
|
||||
(beforeInfo, afterInfo) = runJoin $ termToDiffInfo <$> sources
|
||||
let diff' = free (Prologue.fst <$> diff)
|
||||
in case first (toTOCSummaries . mapPatch beforeInfo afterInfo) diff of
|
||||
Free _ -> mapToInSummarizable sources diff' (toList diff >>= snd)
|
||||
Pure summaries -> summaries
|
||||
where (beforeInfo, afterInfo) = runJoin $ termToDiffInfo <$> sources
|
||||
|
||||
-- Mark which leaves are summarizable.
|
||||
toTOCSummaries :: Patch DiffInfo -> [TOCSummary DiffInfo]
|
||||
|
Loading…
Reference in New Issue
Block a user