Skip to content

Commit

Permalink
Trying to address stylish-haskell parse errors
Browse files Browse the repository at this point in the history
  • Loading branch information
andys8 committed Sep 15, 2022
1 parent 357c681 commit 69edc9c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
13 changes: 7 additions & 6 deletions ghcide/src/Development/IDE/GHC/Compat/Env.hs
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,21 @@ import HscTypes as Env
import Module
#endif

#if MIN_VERSION_ghc(9,3,0)
hsc_EPS :: HscEnv -> UnitEnv
hsc_EPS = hsc_unit_env
#endif

#if MIN_VERSION_ghc(9,0,0)
#if !MIN_VERSION_ghc(9,2,0)
#if MIN_VERSION_ghc(9,0,0)
import qualified Data.Set as Set
#endif
#endif

#if !MIN_VERSION_ghc(9,2,0)
import Data.IORef
#endif

#if MIN_VERSION_ghc(9,3,0)
hsc_EPS :: HscEnv -> UnitEnv
hsc_EPS = hsc_unit_env
#endif

#if !MIN_VERSION_ghc(9,2,0)
type UnitEnv = ()
newtype Logger = Logger { log_action :: LogAction }
Expand Down
18 changes: 8 additions & 10 deletions ghcide/src/Development/IDE/GHC/Compat/Plugins.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ module Development.IDE.GHC.Compat.Plugins (
#if MIN_VERSION_ghc(9,2,0)
import qualified GHC.Driver.Env as Env
#endif
import GHC.Driver.Plugins (Plugin (..),
import GHC.Driver.Plugins (ParsedResult (..),
Plugin (..),
PluginWithArgs (..),
PsMessages (..),
StaticPlugin (..),
#if MIN_VERSION_ghc(9,3,0)
staticPlugins,
ParsedResult(..),
PsMessages(..),
#endif
defaultPlugin, withPlugins)
defaultPlugin,
staticPlugins, withPlugins)
import qualified GHC.Runtime.Loader as Loader
#elif MIN_VERSION_ghc(8,8,0)
import qualified DynamicLoading as Loader
Expand All @@ -48,11 +46,11 @@ applyPluginsParsedResultAction env dflags ms hpm_annotations parsed = do
-- Apply parsedResultAction of plugins
let applyPluginAction p opts = parsedResultAction p opts ms
#if MIN_VERSION_ghc(9,3,0)
fmap (hpm_module . parsedResultModule) $
fmap (hpm_module . parsedResultModule)
#else
fmap hpm_module $
fmap hpm_module
#endif
runHsc env $ withPlugins
$ runHsc env $ withPlugins
#if MIN_VERSION_ghc(9,3,0)
(Env.hsc_plugins env)
#elif MIN_VERSION_ghc(9,2,0)
Expand Down

0 comments on commit 69edc9c

Please # to comment.