@@ -66,12 +66,12 @@ getImportsParsed dflags (L loc parsed) = do
6666-- | locate a module in the file system. Where we go from *daml to Haskell
6767locateModuleFile :: MonadIO m
6868 => DynFlags
69+ -> [String]
6970 -> (FilePath -> m Bool)
7071 -> ModuleName
7172 -> m (Maybe FilePath)
72−locateModuleFile dflags doesExist modName = do
73− let libPaths = importPaths dflags
74− let candidates = [ prefix </> M.moduleNameSlashes modName <.> "daml" | prefix <- libPaths ]
73+locateModuleFile dflags exts doesExist modName = do
74+ let candidates = [ prefix </> M.moduleNameSlashes modName <.> ext | prefix <- importPaths dflags, ext <- exts]
7575 findM doesExist candidates
7676
7777-- | locate a module in either the file system or the package database. Where we go from *daml to
@@ -79,18 +79,19 @@ locateModuleFile dflags doesExist modName = do
7979locateModule
8080 :: MonadIO m
8181 => DynFlags
82+ -> [String]
8283 -> (FilePath -> m Bool)
8384 -> Located ModuleName
8485 -> Maybe FastString
8586 -> m (Either [FileDiagnostic] Import)
86−locateModule dflags doesExist modName mbPkgName = do
87+locateModule dflags exts doesExist modName mbPkgName = do
8788 case mbPkgName of
8889 -- if a package name is given we only go look for a package
8990 Just _pkgName -> lookupInPackageDB dflags
9091 Nothing -> do
9192 -- first try to find the module as a file. If we can't find it try to find it in the package
9293 -- database.
93− mbFile <- locateModuleFile dflags doesExist $ unLoc modName
94+ mbFile <- locateModuleFile dflags exts doesExist $ unLoc modName
9495 case mbFile of
9596 Nothing -> lookupInPackageDB dflags
9697 Just file -> return $ Right $ FileImport file