1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 07:25:44 +03:00

Use fromSource here.

This commit is contained in:
Patrick Thomson 2020-01-24 17:02:04 -05:00
parent 6af70476d0
commit 6e0d1f4fdc

View File

@ -62,7 +62,7 @@ instance FromJSON Blob where
Right pth <- fmap Path.parse (b .: "path") Right pth <- fmap Path.parse (b .: "path")
lang <- b .: "language" lang <- b .: "language"
let lang' = if knownLanguage lang then lang else Language.forPath pth let lang' = if knownLanguage lang then lang else Language.forPath pth
pure (Blob src (Analysis.File.File pth (totalSpan src) lang')) pure (fromSource pth lang' src)
nullBlob :: Blob -> Bool nullBlob :: Blob -> Bool
nullBlob Blob{..} = Source.null blobSource nullBlob Blob{..} = Source.null blobSource