1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 17:04:47 +03:00

Simplify effectivePath/Language

This commit is contained in:
Timothy Clem 2017-12-09 18:30:52 -08:00
parent 2315a27e8f
commit c3b6e260cb

View File

@ -89,10 +89,8 @@ diffBlobPair renderer blobs
SExpressionDiffRenderer -> run ( parse parser >=> pure . fmap keepCategory) diffSyntaxTerms (const renderSExpressionDiff)
| otherwise = throwError (SomeException (NoParserForLanguage effectivePath effectiveLanguage))
where (effectivePath, effectiveLanguage) = case blobs of
This Blob { blobLanguage = Just lang, blobPath = path } -> (path, Just lang)
That Blob { blobLanguage = Just lang, blobPath = path } -> (path, Just lang)
These _ Blob { blobLanguage = lang, blobPath = path } -> (path, lang)
where effectiveLanguage = languageForBlobPair blobs
effectivePath = pathForBlobPair blobs
qualify language | OldToCDiffRenderer <- renderer = guard (language `elem` aLaCarteLanguages) *> Just language
| otherwise = Just language