mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Flatten toTOCSummaries.
This commit is contained in:
parent
948869066c
commit
0ab53b002a
@ -103,15 +103,13 @@ diffTOC blobs diff = removeDupes (diffToTOCSummaries (source <$> blobs) diff) >>
|
|||||||
|
|
||||||
-- Mark which leaves are summarizable.
|
-- Mark which leaves are summarizable.
|
||||||
toTOCSummaries :: Patch DiffInfo -> [TOCSummary DiffInfo]
|
toTOCSummaries :: Patch DiffInfo -> [TOCSummary DiffInfo]
|
||||||
toTOCSummaries patch = toTOCSummaries' patch (afterOrBefore patch)
|
toTOCSummaries patch = case afterOrBefore patch of
|
||||||
where
|
ErrorInfo{..} -> pure $ TOCSummary patch NotSummarizable
|
||||||
toTOCSummaries' patch' diffInfo = case diffInfo of
|
BranchInfo{..} -> flattenPatch patch >>= toTOCSummaries
|
||||||
ErrorInfo{..} -> pure $ TOCSummary patch' NotSummarizable
|
LeafInfo{..} -> pure . TOCSummary patch $ case leafCategory of
|
||||||
BranchInfo{..} -> join $ zipWith toTOCSummaries' (flattenPatch patch') branches
|
C.Function -> Summarizable leafCategory termName leafSourceSpan (patchType patch)
|
||||||
LeafInfo{..} -> pure . TOCSummary patch' $ case leafCategory of
|
C.Method -> Summarizable leafCategory termName leafSourceSpan (patchType patch)
|
||||||
C.Function -> Summarizable leafCategory termName leafSourceSpan (patchType patch')
|
C.SingletonMethod -> Summarizable leafCategory termName leafSourceSpan (patchType patch)
|
||||||
C.Method -> Summarizable leafCategory termName leafSourceSpan (patchType patch')
|
|
||||||
C.SingletonMethod -> Summarizable leafCategory termName leafSourceSpan (patchType patch')
|
|
||||||
_ -> NotSummarizable
|
_ -> NotSummarizable
|
||||||
|
|
||||||
flattenPatch :: Patch DiffInfo -> [Patch DiffInfo]
|
flattenPatch :: Patch DiffInfo -> [Patch DiffInfo]
|
||||||
|
Loading…
Reference in New Issue
Block a user