Skip to content

Commit 07bf4bb

Browse files
committed
Fix ghc 9.8, less CPP
1 parent f9d9759 commit 07bf4bb

File tree

3 files changed

+14
-6
lines changed
  • hls-graph/src/Development/IDE/Graph/Internal
  • plugins

3 files changed

+14
-6
lines changed

hls-graph/src/Development/IDE/Graph/Internal/Types.hs

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ import System.IO.Unsafe
3636
import System.Time.Extra (Seconds)
3737
import UnliftIO (MonadUnliftIO)
3838

39+
#if !MIN_VERSION_base(4,18,0)
40+
import Control.Applicative (liftA2)
41+
#endif
3942

4043
unwrapDynamic :: forall a . Typeable a => Dynamic -> a
4144
unwrapDynamic x = fromMaybe (error msg) $ fromDynamic x

plugins/hls-refactor-plugin/src/Development/IDE/Plugin/Plugins/AddArgument.hs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{-# LANGUAGE CPP #-}
22
module Development.IDE.Plugin.Plugins.AddArgument (plugin) where
33

4-
#if MIN_VERSION_ghc(9,4,0)
5-
import Development.IDE.GHC.ExactPrint (epl)
6-
import GHC.Parser.Annotation (TokenLocation (..))
7-
#endif
84
import Control.Monad (join)
95
import Control.Monad.Trans.Class (lift)
106
import Data.Bifunctor (Bifunctor (..))
@@ -32,12 +28,18 @@ import Language.Haskell.GHC.ExactPrint (TransformT (..),
3228
noAnnSrcSpanDP1,
3329
runTransformT)
3430
import Language.LSP.Protocol.Types
35-
#if !MIN_VERSION_ghc(9,3,0)
31+
32+
#if !MIN_VERSION_ghc(9,4,0)
3633
import GHC (TrailingAnn (..))
3734
import GHC.Hs (IsUnicodeSyntax (..))
3835
import Language.Haskell.GHC.ExactPrint.Transform (d1)
3936
#endif
4037

38+
#if MIN_VERSION_ghc(9,4,0)
39+
import Development.IDE.GHC.ExactPrint (epl)
40+
import GHC.Parser.Annotation (TokenLocation (..))
41+
#endif
42+
4143
-- When GHC tells us that a variable is not bound, it will tell us either:
4244
-- - there is an unbound variable with a given type
4345
-- - there is an unbound variable (GHC provides no type suggestion)

plugins/hls-rename-plugin/src/Ide/Plugin/Rename.hs

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ module Ide.Plugin.Rename (descriptor, E.Log) where
1010
import Compat.HieTypes
1111
import Control.Lens ((^.))
1212
import Control.Monad
13-
import Control.Monad.Except
13+
import Control.Monad.Except (ExceptT, MonadError,
14+
throwError)
15+
import Control.Monad.IO.Class (MonadIO, liftIO)
16+
import Control.Monad.Trans.Class (lift)
1417
import Data.Bifunctor (first)
1518
import Data.Generics
1619
import Data.Hashable

0 commit comments

Comments
 (0)