clean up Gap.
This commit is contained in:
parent
adb4addd54
commit
662842a085
@ -5,7 +5,6 @@ module Language.Haskell.GhcMod.Gap (
|
|||||||
, mkTarget
|
, mkTarget
|
||||||
, withStyle
|
, withStyle
|
||||||
, setLogAction
|
, setLogAction
|
||||||
, supportedExtensions
|
|
||||||
, getSrcSpan
|
, getSrcSpan
|
||||||
, getSrcFile
|
, getSrcFile
|
||||||
, withContext
|
, withContext
|
||||||
@ -25,10 +24,6 @@ module Language.Haskell.GhcMod.Gap (
|
|||||||
, errorMsgSpan
|
, errorMsgSpan
|
||||||
, typeForUser
|
, typeForUser
|
||||||
, deSugar
|
, deSugar
|
||||||
#if __GLASGOW_HASKELL__ >= 702
|
|
||||||
#else
|
|
||||||
, module Pretty
|
|
||||||
#endif
|
|
||||||
, showDocWith
|
, showDocWith
|
||||||
, GapThing(..)
|
, GapThing(..)
|
||||||
, fromTyThing
|
, fromTyThing
|
||||||
@ -59,6 +54,7 @@ import Var (varType)
|
|||||||
import qualified InstEnv
|
import qualified InstEnv
|
||||||
import qualified Pretty
|
import qualified Pretty
|
||||||
import qualified StringBuffer as SB
|
import qualified StringBuffer as SB
|
||||||
|
|
||||||
#if __GLASGOW_HASKELL__ >= 708
|
#if __GLASGOW_HASKELL__ >= 708
|
||||||
import FamInstEnv
|
import FamInstEnv
|
||||||
import ConLike (ConLike(..))
|
import ConLike (ConLike(..))
|
||||||
@ -71,14 +67,6 @@ import TcRnTypes
|
|||||||
import GHC hiding (ClsInst)
|
import GHC hiding (ClsInst)
|
||||||
#else
|
#else
|
||||||
import GHC hiding (Instance)
|
import GHC hiding (Instance)
|
||||||
#endif
|
|
||||||
|
|
||||||
#if __GLASGOW_HASKELL__ < 702
|
|
||||||
import CoreMonad (liftIO)
|
|
||||||
import Pretty
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if __GLASGOW_HASKELL__ < 706
|
|
||||||
import Control.Arrow hiding ((<+>))
|
import Control.Arrow hiding ((<+>))
|
||||||
import Data.Convertible
|
import Data.Convertible
|
||||||
#endif
|
#endif
|
||||||
@ -131,16 +119,6 @@ showDocWith _ = Pretty.showDocWith
|
|||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
supportedExtensions :: [String]
|
|
||||||
#if __GLASGOW_HASKELL__ >= 700
|
|
||||||
supportedExtensions = supportedLanguagesAndExtensions
|
|
||||||
#else
|
|
||||||
supportedExtensions = supportedLanguages
|
|
||||||
#endif
|
|
||||||
|
|
||||||
----------------------------------------------------------------
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
getSrcSpan :: SrcSpan -> Maybe (Int,Int,Int,Int)
|
getSrcSpan :: SrcSpan -> Maybe (Int,Int,Int,Int)
|
||||||
#if __GLASGOW_HASKELL__ >= 702
|
#if __GLASGOW_HASKELL__ >= 702
|
||||||
getSrcSpan (RealSrcSpan spn)
|
getSrcSpan (RealSrcSpan spn)
|
||||||
@ -173,16 +151,16 @@ toStringBuffer = liftIO . stringToStringBuffer . unlines
|
|||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
fOptions :: [String]
|
fOptions :: [String]
|
||||||
#if __GLASGOW_HASKELL__ >= 704
|
#if __GLASGOW_HASKELL__ >= 706
|
||||||
|
fOptions = [option | (option,_,_) <- fFlags]
|
||||||
|
#elif __GLASGOW_HASKELL__ >= 704
|
||||||
fOptions = [option | (option,_,_) <- fFlags]
|
fOptions = [option | (option,_,_) <- fFlags]
|
||||||
++ [option | (option,_,_) <- fWarningFlags]
|
++ [option | (option,_,_) <- fWarningFlags]
|
||||||
++ [option | (option,_,_) <- fLangFlags]
|
++ [option | (option,_,_) <- fLangFlags]
|
||||||
#elif __GLASGOW_HASKELL__ == 702
|
#else
|
||||||
fOptions = [option | (option,_,_,_) <- fFlags]
|
fOptions = [option | (option,_,_,_) <- fFlags]
|
||||||
++ [option | (option,_,_,_) <- fWarningFlags]
|
++ [option | (option,_,_,_) <- fWarningFlags]
|
||||||
++ [option | (option,_,_,_) <- fLangFlags]
|
++ [option | (option,_,_,_) <- fLangFlags]
|
||||||
#else
|
|
||||||
fOptions = [option | (option,_,_) <- fFlags]
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
module Language.Haskell.GhcMod.Lang where
|
module Language.Haskell.GhcMod.Lang where
|
||||||
|
|
||||||
import qualified Language.Haskell.GhcMod.Gap as Gap
|
import DynFlags (supportedLanguagesAndExtensions)
|
||||||
import Language.Haskell.GhcMod.Types
|
import Language.Haskell.GhcMod.Types
|
||||||
|
|
||||||
-- | Listing language extensions.
|
-- | Listing language extensions.
|
||||||
|
|
||||||
listLanguages :: Options -> IO String
|
listLanguages :: Options -> IO String
|
||||||
listLanguages opt = return $ convert opt Gap.supportedExtensions
|
listLanguages opt = return $ convert opt supportedLanguagesAndExtensions
|
||||||
|
Loading…
Reference in New Issue
Block a user