1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 21:16:12 +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 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 :: (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 where
removeImports :: HasField fields (Maybe Declaration) => Entry (Record fields) -> Bool extraDeclarations :: HasField fields (Maybe Declaration) => Entry (Record fields) -> Bool
removeImports entry = case getDeclaration (entryPayload entry) of extraDeclarations entry = case getDeclaration (entryPayload entry) of
Just ImportDeclaration{..} -> False Just ImportDeclaration{..} -> False
Just CallReference{..} -> False
_ -> True _ -> True
renderToCTerm :: (HasField fields (Maybe Declaration), HasField fields Span, Foldable f, Functor f) => Blob -> Term f (Record fields) -> Summaries renderToCTerm :: (HasField fields (Maybe Declaration), HasField fields Span, Foldable f, Functor f) => Blob -> Term f (Record fields) -> Summaries