1
1
mirror of https://github.com/github/semantic.git synced 2025-01-01 19:55:34 +03:00

Compose tagsToFile onto a new tagsForTerm function.

This commit is contained in:
Rob Rix 2019-10-23 10:42:13 -04:00
parent 52ada3cdae
commit d2569a8f59
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -68,7 +68,7 @@ parseSymbols blobs = do
pure $ defMessage & P.files .~ toList terms
where
go :: (Member (Error SomeException) sig, Member (Reader PerLanguageModes) sig, Member Parse sig, Carrier sig m) => Blob -> m File
go blob@Blob{..} = catching $ asks toTagsParsers >>= \ p -> parseWith p (pure . renderToSymbols) blob
go blob@Blob{..} = catching $ asks toTagsParsers >>= \ p -> parseWith p (pure . tagsToFile . tagsForTerm) blob
where
catching m = m `catchError` (\(SomeException e) -> pure $ errorFile (show e))
blobLanguage' = blobLanguage blob
@ -80,8 +80,8 @@ parseSymbols blobs = do
& P.errors .~ [defMessage & P.error .~ pack e]
& P.blobOid .~ blobOid
renderToSymbols :: ToTags t => t Loc -> File
renderToSymbols term = tagsToFile (tags (blobLanguage blob) symbolsToSummarize blobSource term)
tagsForTerm :: ToTags t => t Loc -> [Tag]
tagsForTerm term = tags (blobLanguage blob) symbolsToSummarize blobSource term
tagsToFile :: [Tag] -> File
tagsToFile tags = defMessage