diff --git a/src/Semantic/Graph.hs b/src/Semantic/Graph.hs index d64da9dfb..4fb0867b6 100644 --- a/src/Semantic/Graph.hs +++ b/src/Semantic/Graph.hs @@ -19,6 +19,7 @@ import System.FilePath.Posix import qualified Data.ByteString.Char8 as B import Path import Data.Record +import Data.Language graph :: (Members '[Distribute WrappedTask, Files, Task, Exc SomeException, Telemetry] effs) => Maybe FilePath @@ -45,12 +46,14 @@ graph maybeRootDir renderer Blob{..} where packageName = name . BC.pack . dropExtensions . takeFileName -graphPackage :: (Show (Record location), Ord (Record location), Members '[Distribute WrappedTask, Files, Task, Exc SomeException, Telemetry] effs) +graphPackage :: (Members '[Distribute WrappedTask, Files, Task, Exc SomeException, Telemetry] effs) => GraphRenderer output -> Path Abs Dir - -> SomeAnalysisParser '[ Analysis.Evaluatable, Analysis.Declarations1, FreeVariables1, Functor, Eq1, Ord1, Show1 ] (Record location) + -> Maybe Language -> Eff effs ByteString -graphPackage renderer rootDir (SomeAnalysisParser parser exts preludePath) = do +graphPackage renderer rootDir blobLanguage + | Just (SomeAnalysisParser parser exts preludePath) <- someAnalysisParser + (Proxy :: Proxy '[ Analysis.Evaluatable, Analysis.Declarations1, FreeVariables1, Functor, Eq1, Ord1, Show1 ]) <$> blobLanguage = do paths <- listFiles (toFilePath rootDir) exts prelude <- traverse (parseModule parser Nothing) preludePath let packageName = name . B.pack . toFilePath $ dirname rootDir