diff --git a/src/Data/File.hs b/src/Data/File.hs index ecfc80c3b..5f2c4be06 100644 --- a/src/Data/File.hs +++ b/src/Data/File.hs @@ -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 diff --git a/src/Data/Language.hs b/src/Data/Language.hs index 072c7e7d3..f6c28a880 100644 --- a/src/Data/Language.hs +++ b/src/Data/Language.hs @@ -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]