Skip to content

Commit 2255740

Browse files
committed
Drop conditional glasgow_haskell cpp
1 parent 89e1bf8 commit 2255740

File tree

8 files changed

+10
-48
lines changed

8 files changed

+10
-48
lines changed

ghcide/src/Development/IDE/GHC/Compat/CPP.hs

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ module Development.IDE.GHC.Compat.CPP (
1616
doCpp
1717
) where
1818

19-
import FileCleanup
20-
import Packages
21-
import Panic
22-
import SysTools
23-
import LlvmCodeGen (llvmVersionList)
2419
import Control.Monad
2520
import Data.List (intercalate)
2621
import Data.Maybe
2722
import Data.Version
2823
import DynFlags
24+
import FileCleanup
25+
import LlvmCodeGen (llvmVersionList)
2926
import Module (rtsUnitId, toInstalledUnitId)
27+
import Packages
28+
import Panic
3029
import System.Directory
3130
import System.FilePath
3231
import System.Info
32+
import SysTools
3333

3434
import Development.IDE.GHC.Compat as Compat
3535

ghcide/src/Development/IDE/GHC/Compat/Core.hs

+1-5
Original file line numberDiff line numberDiff line change
@@ -935,11 +935,7 @@ addBootSuffixLocnOut :: GHC.ModLocation -> GHC.ModLocation
935935
addBootSuffixLocnOut = Module.addBootSuffixLocnOut
936936

937937
dataConExTyCoVars :: DataCon -> [TyCoVar]
938-
#if __GLASGOW_HASKELL__ >= 808
939938
dataConExTyCoVars = DataCon.dataConExTyCoVars
940-
#else
941-
dataConExTyCoVars = DataCon.dataConExTyVars
942-
#endif
943939

944940
#if !MIN_VERSION_ghc(9,0,0)
945941
-- Linear Haskell
@@ -953,7 +949,7 @@ unrestricted = id
953949

954950
mkVisFunTys :: [Scaled Type] -> Type -> Type
955951
mkVisFunTys =
956-
#if __GLASGOW_HASKELL__ <= 808
952+
#if __GLASGOW_HASKELL__ == 808
957953
mkFunTys
958954
#else
959955
TcType.mkVisFunTys

ghcide/src/Development/IDE/GHC/Compat/Plugins.hs

-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
module Development.IDE.GHC.Compat.Plugins (
55
Plugin(..),
66
defaultPlugin,
7-
#if __GLASGOW_HASKELL__ >= 808
87
PluginWithArgs(..),
9-
#endif
108
applyPluginsParsedResultAction,
119
initializePlugins,
1210

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ module Development.IDE.Graph.Internal.Types where
1212

1313
import Control.Applicative
1414
import Control.Monad.Catch
15-
#if __GLASGOW_HASKELL__ < 808
16-
import Control.Concurrent.STM.Stats (TVar, atomically)
17-
#else
18-
import GHC.Conc (TVar, atomically)
19-
#endif
2015
import Control.Monad.IO.Class
2116
import Control.Monad.Trans.Reader
2217
import Data.Aeson (FromJSON, ToJSON)
@@ -31,6 +26,7 @@ import Data.List (intercalate)
3126
import Data.Maybe
3227
import Data.Typeable
3328
import Development.IDE.Graph.Classes
29+
import GHC.Conc (TVar, atomically)
3430
import GHC.Generics (Generic)
3531
import qualified ListT
3632
import qualified StmContainers.Map as SMap

plugins/hls-tactics-plugin/src/Wingman/LanguageServer.hs

+3-5
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ import Development.IDE.Types.Logger (Recorder, cmapWithPrio, WithPriority, Prett
6868
import qualified Development.IDE.Core.Shake as Shake
6969

7070

71-
newtype Log
71+
newtype Log
7272
= LogShake Shake.Log
7373
deriving Show
7474

7575
instance Pretty Log where
76-
pretty = \case
76+
pretty = \case
7777
LogShake shakeLog -> pretty shakeLog
7878

7979
tacticDesc :: T.Text -> T.Text
@@ -425,9 +425,7 @@ buildPatHy prov (fromPatCompat -> p0) =
425425
mkDerivedConHypothesis prov con args $ zip [0..] [pgt, pgt5]
426426
RecCon r ->
427427
mkDerivedRecordHypothesis prov con args r
428-
#if __GLASGOW_HASKELL__ >= 808
429428
SigPat _ p _ -> buildPatHy prov p
430-
#endif
431429
#if __GLASGOW_HASKELL__ == 808
432430
XPat p -> buildPatHy prov $ unLoc p
433431
#endif
@@ -585,7 +583,7 @@ wingmanRules recorder plId = do
585583
#endif
586584
| isHole occ ->
587585
maybeToList $ srcSpanToRange span
588-
#if __GLASGOW_HASKELL__ <= 808
586+
#if __GLASGOW_HASKELL__ == 808
589587
L span (EWildPat _) ->
590588
maybeToList $ srcSpanToRange span
591589
#endif

plugins/hls-tactics-plugin/src/Wingman/LanguageServer/TacticProviders.hs

-12
Original file line numberDiff line numberDiff line change
@@ -150,25 +150,13 @@ commandProvider Refine =
150150
requireHoleSort (== Hole) $
151151
provide Refine ""
152152
commandProvider BeginMetaprogram =
153-
requireGHC88OrHigher $
154153
requireHoleSort (== Hole) $
155154
provide BeginMetaprogram ""
156155
commandProvider RunMetaprogram =
157-
requireGHC88OrHigher $
158156
withMetaprogram $ \mp ->
159157
provide RunMetaprogram mp
160158

161159

162-
requireGHC88OrHigher :: TacticProvider -> TacticProvider
163-
#if __GLASGOW_HASKELL__ >= 808
164-
requireGHC88OrHigher tp tpd =
165-
tp tpd
166-
#else
167-
requireGHC88OrHigher _ _=
168-
mempty
169-
#endif
170-
171-
172160
------------------------------------------------------------------------------
173161
-- | Return an empty list if the given predicate doesn't hold over the length
174162
guardLength :: (Int -> Bool) -> [a] -> [a]

plugins/hls-tactics-plugin/src/Wingman/StaticPlugin.hs

-8
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ import GHC.LanguageExtensions.Type (Extension(EmptyCase, QuasiQuotes))
1414

1515
import Ide.Types
1616

17-
#if __GLASGOW_HASKELL__ >= 808
1817
import Data.Data
1918
import Generics.SYB
2019
#if __GLASGOW_HASKELL__ >= 900
2120
import GHC.Driver.Plugins (purePlugin)
2221
#else
2322
import Plugins (purePlugin)
2423
#endif
25-
#endif
2624

2725
staticPlugin :: DynFlagsModifications
2826
staticPlugin = mempty
@@ -34,13 +32,9 @@ staticPlugin = mempty
3432
{ refLevelHoleFits = Just 0
3533
, maxRefHoleFits = Just 0
3634
, maxValidHoleFits = Just 0
37-
#if __GLASGOW_HASKELL__ >= 808
3835
, staticPlugins = staticPlugins df <> [metaprogrammingPlugin]
39-
#endif
4036
}
41-
#if __GLASGOW_HASKELL__ >= 808
4237
, dynFlagsModifyParser = enableQuasiQuotes
43-
#endif
4438
}
4539

4640

@@ -71,7 +65,6 @@ allowEmptyCaseButWithWarning =
7165
flip xopt_set EmptyCase . flip wopt_set Opt_WarnIncompletePatterns
7266

7367

74-
#if __GLASGOW_HASKELL__ >= 808
7568
metaprogrammingPlugin :: StaticPlugin
7669
metaprogrammingPlugin =
7770
StaticPlugin $ PluginWithArgs pluginDefinition []
@@ -101,7 +94,6 @@ addMetaprogrammingSyntax =
10194
L ss (MetaprogramSyntax mp) ->
10295
L ss $ mkMetaprogram ss mp
10396
(x :: LHsExpr GhcPs) -> x
104-
#endif
10597

10698
metaprogramHoleName :: OccName
10799
metaprogramHoleName = mkVarOcc "_$metaprogram"

plugins/hls-tactics-plugin/test/CodeAction/RunMetaprogramSpec.hs

-6
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,11 @@ import Wingman.Types
1111
spec :: Spec
1212
spec = do
1313
let metaTest l c f =
14-
#if __GLASGOW_HASKELL__ >= 808
1514
goldenTest RunMetaprogram "" l c f
16-
#else
17-
pure ()
18-
#endif
1915

20-
#if __GLASGOW_HASKELL__ >= 808
2116
describe "beginMetaprogram" $ do
2217
goldenTest BeginMetaprogram "" 1 7 "MetaBegin"
2318
goldenTest BeginMetaprogram "" 1 9 "MetaBeginNoWildify"
24-
#endif
2519

2620
describe "golden" $ do
2721
metaTest 6 11 "MetaMaybeAp"

0 commit comments

Comments
 (0)