ghc-mod list should take care of sandboxes
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
module Language.Haskell.GhcMod.List (listModules, listMods) where
|
||||
|
||||
import Control.Applicative
|
||||
import Control.Monad (void)
|
||||
import Data.List
|
||||
import GHC
|
||||
import Language.Haskell.GhcMod.GHCApi
|
||||
@@ -11,13 +12,13 @@ import UniqFM
|
||||
----------------------------------------------------------------
|
||||
|
||||
-- | Listing installed modules.
|
||||
listModules :: Options -> IO String
|
||||
listModules opt = convert opt . nub . sort <$> withGHCDummyFile (listMods opt)
|
||||
listModules :: Options -> Cradle -> IO String
|
||||
listModules opt cradle = convert opt . nub . sort <$> withGHCDummyFile (listMods opt cradle)
|
||||
|
||||
-- | Listing installed modules.
|
||||
listMods :: Options -> Ghc [String]
|
||||
listMods opt = do
|
||||
initializeFlags opt
|
||||
listMods :: Options -> Cradle -> Ghc [String]
|
||||
listMods opt cradle = do
|
||||
void $ initializeFlagsWithCradle opt cradle [] False
|
||||
getExposedModules <$> getSessionDynFlags
|
||||
where
|
||||
getExposedModules = map moduleNameString
|
||||
|
||||
Reference in New Issue
Block a user