mirror of
https://github.com/github/semantic.git
synced 2024-11-23 16:37:50 +03:00
Narrow in on language support for now
This commit is contained in:
parent
a37a737562
commit
abd0bf08af
@ -62,7 +62,7 @@ readBlobsFromGitRepo path oid = liftIO . fmap catMaybes $
|
||||
blobFromTreeEntry :: FilePath -> Git.TreeEntry -> IO (Maybe Blob)
|
||||
blobFromTreeEntry gitDir (Git.TreeEntry Git.NormalMode Git.BlobObject oid path)
|
||||
| lang <- languageForFilePath path
|
||||
, lang /= Unknown
|
||||
, lang `elem` codeNavLanguages
|
||||
= Just . sourceBlob' path lang oid . fromText <$> Git.catFile gitDir oid
|
||||
blobFromTreeEntry _ _ = pure Nothing
|
||||
|
||||
|
@ -8,6 +8,7 @@ module Data.Language
|
||||
, languageForFilePath
|
||||
, languageForType
|
||||
, supportedExts
|
||||
, codeNavLanguages
|
||||
) where
|
||||
|
||||
import Data.Aeson
|
||||
@ -151,3 +152,6 @@ languageForFilePath = languageForType . takeExtension
|
||||
|
||||
supportedExts :: [String]
|
||||
supportedExts = [".go", ".py", ".rb", ".js", ".ts"]
|
||||
|
||||
codeNavLanguages :: [Language]
|
||||
codeNavLanguages = [Go, Ruby, Python, JavaScript, TypeScript]
|
||||
|
Loading…
Reference in New Issue
Block a user