Revert "use standard findFile instead of hand-rolled one"

This reverts commit b055098127.
This commit is contained in:
Daniel Gröber 2015-05-20 12:05:22 +02:00
parent 079c05ff17
commit a2e4a5d683

View File

@ -37,8 +37,10 @@ import Language.Haskell.GhcMod.GhcPkg
import Language.Haskell.GhcMod.Error
import Language.Haskell.GhcMod.Logging
import Language.Haskell.GhcMod.Types
import Language.Haskell.GhcMod.Utils
import Data.Maybe
import Data.Monoid
import Data.Either
import Data.Foldable (foldrM)
import Data.Traversable (traverse)
@ -313,7 +315,7 @@ resolveModule :: MonadIO m =>
resolveModule env _srcDirs (Right mn) =
liftIO $ traverse canonicalizeModulePath =<< findModulePath env mn
resolveModule env srcDirs (Left fn') = liftIO $ do
mfn <- findFile srcDirs fn'
mfn <- findFile' srcDirs fn'
case mfn of
Nothing -> return Nothing
Just fn'' -> do
@ -325,6 +327,9 @@ resolveModule env srcDirs (Left fn') = liftIO $ do
case mmn of
Nothing -> mkMainModulePath fn
Just mn -> ModulePath mn fn
where
findFile' dirs file =
getFirst . mconcat <$> mapM (fmap First . mightExist . (</>file)) dirs
resolveChEntrypoints ::
FilePath -> ChEntrypoint -> IO [Either FilePath ModuleName]
@ -360,6 +365,7 @@ resolveGmComponents mumns cs = do
else insertUpdated m c
gmsPut s { gmComponents = m' }
return m'
where
foldrM' b fa f = foldrM f b fa
insertUpdated m c = do