1
1
mirror of https://github.com/github/semantic.git synced 2024-12-31 19:20:19 +03:00

Hide these new declarations

This commit is contained in:
Timothy Clem 2018-01-23 14:25:03 -08:00
parent 7d2e39729b
commit 2019beb82f

View File

@ -166,11 +166,12 @@ renderToCDiff blobs = uncurry Summaries . bimap toMap toMap . List.partition isV
summaryKey = T.pack $ pathKeyForBlobPair blobs
diffTOC :: (HasField fields (Maybe Declaration), HasField fields Span, Foldable f, Functor f) => Diff f (Record fields) (Record fields) -> [TOCSummary]
diffTOC = mapMaybe entrySummary . dedupe . filter removeImports . tableOfContentsBy declaration
diffTOC = mapMaybe entrySummary . dedupe . filter extraDeclarations . tableOfContentsBy declaration
where
removeImports :: HasField fields (Maybe Declaration) => Entry (Record fields) -> Bool
removeImports entry = case getDeclaration (entryPayload entry) of
extraDeclarations :: HasField fields (Maybe Declaration) => Entry (Record fields) -> Bool
extraDeclarations entry = case getDeclaration (entryPayload entry) of
Just ImportDeclaration{..} -> False
Just CallReference{..} -> False
_ -> True
renderToCTerm :: (HasField fields (Maybe Declaration), HasField fields Span, Foldable f, Functor f) => Blob -> Term f (Record fields) -> Summaries