From 19eb04c51e3b0ff07acd055945a96af9024f5c6e Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 21 Jun 2018 13:33:12 -0400 Subject: [PATCH] :fire: project entry points. --- src/Data/Project.hs | 1 - src/Semantic/Graph.hs | 2 +- src/Semantic/IO.hs | 10 +++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Data/Project.hs b/src/Data/Project.hs index 1c75ccc2e..4dfdbf76d 100644 --- a/src/Data/Project.hs +++ b/src/Data/Project.hs @@ -9,7 +9,6 @@ data Project = Project { projectRootDir :: FilePath , projectFiles :: [File] , projectLanguage :: Language - , projectEntryPoints :: [File] , projectExcludeDirs :: [FilePath] } deriving (Eq, Ord, Show) diff --git a/src/Semantic/Graph.hs b/src/Semantic/Graph.hs index 409182a23..fce7256e7 100644 --- a/src/Semantic/Graph.hs +++ b/src/Semantic/Graph.hs @@ -183,7 +183,7 @@ parsePackage parser project@Project{..} = do -- | Parse all files in a project into 'Module's. parseModules :: Member (Distribute WrappedTask) effs => Parser term -> Project -> Eff effs [Module term] - parseModules parser Project{..} = distributeFor (projectEntryPoints <> projectFiles) (WrapTask . parseModule parser (Just projectRootDir)) + parseModules parser Project{..} = distributeFor projectFiles (WrapTask . parseModule parser (Just projectRootDir)) -- | Parse a file into a 'Module'. parseModule :: (Member Files effs, Member Task effs) => Parser term -> Maybe FilePath -> File -> Eff effs (Module term) diff --git a/src/Semantic/IO.hs b/src/Semantic/IO.hs index 28169b290..c800eb587 100644 --- a/src/Semantic/IO.hs +++ b/src/Semantic/IO.hs @@ -100,12 +100,12 @@ readBlobFromPath file = do readProjectFromPaths :: MonadIO m => Maybe FilePath -> FilePath -> Language -> [FilePath] -> m Project readProjectFromPaths maybeRoot path lang excludeDirs = do isDir <- isDirectory path - let (filterFun, entryPoints, rootDir) = if isDir - then (id, [], fromMaybe path maybeRoot) - else (filter (/= path), [toFile path], fromMaybe (takeDirectory path) maybeRoot) + let rootDir = if isDir + then fromMaybe path maybeRoot + else fromMaybe (takeDirectory path) maybeRoot - paths <- liftIO $ filterFun <$> findFilesInDir rootDir exts excludeDirs - pure $ Project rootDir (toFile <$> paths) lang entryPoints excludeDirs + paths <- liftIO $ findFilesInDir rootDir exts excludeDirs + pure $ Project rootDir (toFile <$> paths) lang excludeDirs where toFile path = File path lang exts = extensionsForLanguage lang