Skip to content

Commit 7c56c86

Browse files
committed
fix: simplify import handling for GHC version checks
1 parent 3414636 commit 7c56c86

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

ghcide/src/Development/IDE/Core/Compile.hs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,25 +1188,15 @@ getModSummaryFromImports env fp _modTime mContents = do
11881188
implicit_prelude imps
11891189

11901190

1191-
convImport (L _ i) = (
1192-
#if !MIN_VERSION_ghc(9,3,0)
1193-
fmap sl_fs
1194-
#endif
1195-
(ideclPkgQual i)
1196-
, reLoc $ ideclName i)
1191+
convImport (L _ i) = (ideclPkgQual i, reLoc $ ideclName i)
11971192

11981193
msrImports = implicit_imports ++ imps
11991194

1200-
#if MIN_VERSION_ghc(9,3,0)
12011195
rn_pkg_qual = renameRawPkgQual (hsc_unit_env ppEnv)
12021196
rn_imps = fmap (\(pk, lmn@(L _ mn)) -> (rn_pkg_qual mn pk, lmn))
12031197
srcImports = rn_imps $ map convImport src_idecls
12041198
textualImports = rn_imps $ map convImport (implicit_imports ++ ordinary_imps)
12051199
ghc_prim_import = not (null _ghc_prim_imports)
1206-
#else
1207-
srcImports = map convImport src_idecls
1208-
textualImports = map convImport (implicit_imports ++ ordinary_imps)
1209-
#endif
12101200

12111201

12121202
-- Force bits that might keep the string buffer and DynFlags alive unnecessarily

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ import GHC.Settings
2222

2323
-- See Note [Guidelines For Using CPP In GHCIDE Import Statements]
2424

25-
#if !MIN_VERSION_ghc(9,3,0)
26-
import qualified GHC.Driver.Pipeline as Pipeline
27-
#endif
28-
29-
#if MIN_VERSION_ghc(9,3,0) && !MIN_VERSION_ghc(9,5,0)
25+
#if !MIN_VERSION_ghc(9,5,0)
3026
import qualified GHC.Driver.Pipeline.Execute as Pipeline
3127
#endif
3228

0 commit comments

Comments
 (0)