diff --git a/Language/Haskell/GhcMod/Debug.hs b/Language/Haskell/GhcMod/Debug.hs index 82685f3..c12c93c 100644 --- a/Language/Haskell/GhcMod/Debug.hs +++ b/Language/Haskell/GhcMod/Debug.hs @@ -30,10 +30,10 @@ debugInfo = cradle >>= \c -> convert' =<< do ] where simpleCompilerOption = options >>= \op -> - return $ CompilerOptions (ghcOpts op) [] [] + return $ CompilerOptions (ghcUserOptions op) [] [] fromCabalFile c = options >>= \opts -> do pkgDesc <- parseCabalFile $ fromJust $ cradleCabalFile c - liftIO $ getCompilerOptions (ghcOpts opts) c pkgDesc + liftIO $ getCompilerOptions (ghcUserOptions opts) c pkgDesc ---------------------------------------------------------------- diff --git a/Language/Haskell/GhcMod/Logger.hs b/Language/Haskell/GhcMod/Logger.hs index 17aa82a..4962628 100644 --- a/Language/Haskell/GhcMod/Logger.hs +++ b/Language/Haskell/GhcMod/Logger.hs @@ -64,7 +64,7 @@ withLogger :: IOish m -> GhcModT m (Either String String) withLogger setDF body = ghandle sourceError $ do logref <- liftIO newLogRef - wflags <- filter ("-fno-warn" `isPrefixOf`) . ghcOpts <$> options + wflags <- filter ("-fno-warn" `isPrefixOf`) . ghcUserOptions <$> options withDynFlags (setLogger logref . setDF) $ withCmdFlags wflags $ do body diff --git a/Language/Haskell/GhcMod/Monad.hs b/Language/Haskell/GhcMod/Monad.hs index 25214eb..713d799 100644 --- a/Language/Haskell/GhcMod/Monad.hs +++ b/Language/Haskell/GhcMod/Monad.hs @@ -201,7 +201,7 @@ initializeFlagsWithCradle opt c where mCradleFile = cradleCabalFile c cabal = isJust mCradleFile - ghcopts = ghcOpts opt + ghcopts = ghcUserOptions opt withCabal = do pkgDesc <- parseCabalFile $ fromJust mCradleFile compOpts <- liftIO $ getCompilerOptions ghcopts c pkgDesc diff --git a/Language/Haskell/GhcMod/Types.hs b/Language/Haskell/GhcMod/Types.hs index b92b32c..b224059 100644 --- a/Language/Haskell/GhcMod/Types.hs +++ b/Language/Haskell/GhcMod/Types.hs @@ -28,7 +28,8 @@ newtype LineSeparator = LineSeparator String data Options = Options { outputStyle :: OutputStyle , hlintOpts :: [String] - , ghcOpts :: [GHCOption] + -- | GHC command line options set on the @ghc-mod@ command line + , ghcUserOptions:: [GHCOption] -- | If 'True', 'browse' also returns operators. , operators :: Bool -- | If 'True', 'browse' also returns types. @@ -44,7 +45,7 @@ defaultOptions :: Options defaultOptions = Options { outputStyle = PlainStyle , hlintOpts = [] - , ghcOpts = [] + , ghcUserOptions= [] , operators = False , detailed = False , qualified = False diff --git a/src/GHCMod.hs b/src/GHCMod.hs index 0e75f2c..84b8bbf 100644 --- a/src/GHCMod.hs +++ b/src/GHCMod.hs @@ -63,7 +63,7 @@ argspec = [ Option "l" ["tolisp"] (ReqArg (\h opts -> opts { hlintOpts = h : hlintOpts opts }) "hlintOpt") "hlint options" , Option "g" ["ghcOpt"] - (ReqArg (\g opts -> opts { ghcOpts = g : ghcOpts opts }) "ghcOpt") + (ReqArg (\g opts -> opts { ghcUserOptions = g : ghcUserOptions opts }) "ghcOpt") "GHC options" , Option "o" ["operators"] (NoArg (\opts -> opts { operators = True })) diff --git a/src/GHCModi.hs b/src/GHCModi.hs index c6e2541..f651a3a 100644 --- a/src/GHCModi.hs +++ b/src/GHCModi.hs @@ -58,7 +58,7 @@ argspec = [ Option "b" ["boundary"] (NoArg (\opts -> opts { outputStyle = LispStyle })) "print as a list of Lisp" , Option "g" [] - (ReqArg (\s opts -> opts { ghcOpts = s : ghcOpts opts }) "flag") "specify a ghc flag" + (ReqArg (\s opts -> opts { ghcUserOptions = s : ghcUserOptions opts }) "flag") "specify a ghc flag" ] usage :: String