Show more relevant bindings in typed holes
This commit is contained in:
parent
75b838bab6
commit
72679c619c
@ -32,7 +32,7 @@ checkSyntax files = withErrorHandler sessionName $ do
|
||||
check :: [FilePath] -- ^ The target files.
|
||||
-> GhcMod (Either String String)
|
||||
check fileNames = do
|
||||
withLogger setAllWaringFlags $ do
|
||||
withLogger (setAllWaringFlags . setNoMaxRelevantBindings) $ do
|
||||
setTargetFiles fileNames
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE ScopedTypeVariables, RecordWildCards #-}
|
||||
{-# LANGUAGE ScopedTypeVariables, RecordWildCards, CPP #-}
|
||||
|
||||
module Language.Haskell.GhcMod.GHCApi (
|
||||
withGHC
|
||||
@ -11,6 +11,7 @@ module Language.Haskell.GhcMod.GHCApi (
|
||||
, withCmdFlags
|
||||
, setNoWaringFlags
|
||||
, setAllWaringFlags
|
||||
, setNoMaxRelevantBindings
|
||||
) where
|
||||
|
||||
import Language.Haskell.GhcMod.CabalApi
|
||||
@ -195,6 +196,15 @@ setNoWaringFlags df = df { warningFlags = Gap.emptyWarnFlags}
|
||||
setAllWaringFlags :: DynFlags -> DynFlags
|
||||
setAllWaringFlags df = df { warningFlags = allWarningFlags }
|
||||
|
||||
-- | Set 'DynFlags' equivalent to "-fno-max-relevant-bindings".
|
||||
setNoMaxRelevantBindings :: DynFlags -> DynFlags
|
||||
#if __GLASGOW_HASKELL__ >= 708
|
||||
setNoMaxRelevantBindings df = df { maxRelevantBinds = Nothing }
|
||||
#else
|
||||
setNoMaxRelevantBindings = id
|
||||
#endif
|
||||
|
||||
|
||||
allWarningFlags :: Gap.WarnFlags
|
||||
allWarningFlags = unsafePerformIO $ do
|
||||
mlibdir <- getSystemLibDir
|
||||
|
Loading…
Reference in New Issue
Block a user