mirror of
https://github.com/github/semantic.git
synced 2024-11-27 12:57:49 +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 :: FilePath -> Git.TreeEntry -> IO (Maybe Blob)
|
||||||
blobFromTreeEntry gitDir (Git.TreeEntry Git.NormalMode Git.BlobObject oid path)
|
blobFromTreeEntry gitDir (Git.TreeEntry Git.NormalMode Git.BlobObject oid path)
|
||||||
| lang <- languageForFilePath path
|
| lang <- languageForFilePath path
|
||||||
, lang /= Unknown
|
, lang `elem` codeNavLanguages
|
||||||
= Just . sourceBlob' path lang oid . fromText <$> Git.catFile gitDir oid
|
= Just . sourceBlob' path lang oid . fromText <$> Git.catFile gitDir oid
|
||||||
blobFromTreeEntry _ _ = pure Nothing
|
blobFromTreeEntry _ _ = pure Nothing
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ module Data.Language
|
|||||||
, languageForFilePath
|
, languageForFilePath
|
||||||
, languageForType
|
, languageForType
|
||||||
, supportedExts
|
, supportedExts
|
||||||
|
, codeNavLanguages
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@ -151,3 +152,6 @@ languageForFilePath = languageForType . takeExtension
|
|||||||
|
|
||||||
supportedExts :: [String]
|
supportedExts :: [String]
|
||||||
supportedExts = [".go", ".py", ".rb", ".js", ".ts"]
|
supportedExts = [".go", ".py", ".rb", ".js", ".ts"]
|
||||||
|
|
||||||
|
codeNavLanguages :: [Language]
|
||||||
|
codeNavLanguages = [Go, Ruby, Python, JavaScript, TypeScript]
|
||||||
|
Loading…
Reference in New Issue
Block a user