mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Simplify toJSONSummaries.
This commit is contained in:
parent
28d858ce32
commit
c369867230
@ -129,11 +129,9 @@ diffTOC blobs diff = removeDupes (diffToTOCSummaries (source <$> blobs) diff) >>
|
|||||||
isSummarizable _ = False
|
isSummarizable _ = False
|
||||||
|
|
||||||
toJSONSummaries :: TOCSummary DiffInfo -> [JSONSummary]
|
toJSONSummaries :: TOCSummary DiffInfo -> [JSONSummary]
|
||||||
toJSONSummaries TOCSummary{..} = toJSONSummaries' (afterOrBefore summaryPatch)
|
toJSONSummaries TOCSummary{..} = case afterOrBefore summaryPatch of
|
||||||
where
|
ErrorInfo{..} -> [ErrorSummary termName infoSpan]
|
||||||
toJSONSummaries' diffInfo = case diffInfo of
|
LeafInfo{..} -> maybe [] (pure . JSONSummary) parentInfo
|
||||||
ErrorInfo{..} -> [ErrorSummary termName infoSpan]
|
|
||||||
LeafInfo{..} -> maybe [] (pure . JSONSummary) parentInfo
|
|
||||||
|
|
||||||
toTermName :: HasDefaultFields fields => Source -> Term (Syntax Text) (Record fields) -> Text
|
toTermName :: HasDefaultFields fields => Source -> Term (Syntax Text) (Record fields) -> Text
|
||||||
toTermName source = para $ \ (annotation :< syntax) -> case syntax of
|
toTermName source = para $ \ (annotation :< syntax) -> case syntax of
|
||||||
|
Loading…
Reference in New Issue
Block a user