Skip to content

Commit d250dfd

Browse files
committed
Remove a bit more CPP
This could almost be handled by ghc-api-compat, but if it was imported from TyCoPpr, it doesn't work with ghc < 8.10
1 parent bb9558d commit d250dfd

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ module Development.IDE.GHC.Compat(
117117
LogActionCompat,
118118
logActionCompat,
119119

120+
pprSigmaType,
121+
120122
module GHC,
121123
module DynFlags,
122124
initializePlugins,
@@ -139,12 +141,14 @@ import qualified Outputable as Out
139141
import StringBuffer
140142
#if MIN_GHC_API_VERSION(9,0,1)
141143
import qualified Data.Set as S
144+
import GHC.Core.TyCo.Ppr (pprSigmaType)
142145
import GHC.Core.TyCo.Rep (Scaled, scaledThing)
143146
import GHC.Iface.Load
144147
import GHC.Types.Unique.Set (emptyUniqSet)
145148
import qualified SrcLoc
146149
#else
147150
import Module (InstalledUnitId, toInstalledUnitId)
151+
import TcType (pprSigmaType)
148152
#endif
149153
import Compat.HieAst (enrichHie, mkHieFile)
150154
import Compat.HieBin

ghcide/src/Development/IDE/Plugin/TypeLenses.hs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
{-# LANGUAGE CPP #-}
21
{-# LANGUAGE DeriveAnyClass #-}
32
{-# LANGUAGE OverloadedLabels #-}
43
{-# LANGUAGE TypeFamilies #-}
5-
#include "ghc-api-version.h"
64

75
-- | An HLS plugin to provide code lenses for type signatures
86
module Development.IDE.Plugin.TypeLenses (
@@ -80,11 +78,6 @@ import PatSyn (patSynName)
8078
import TcEnv (tcInitTidyEnv)
8179
import TcRnMonad (initTcWithGbl)
8280
import TcRnTypes (TcGblEnv (..))
83-
#if MIN_GHC_API_VERSION(9,0,1)
84-
import GHC.Core.TyCo.Ppr (pprSigmaType)
85-
#else
86-
import TcType (pprSigmaType)
87-
#endif
8881
import Text.Regex.TDFA ((=~), (=~~))
8982

9083
typeLensCommandId :: T.Text

0 commit comments

Comments
 (0)