Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Remove 8.4 CPP #834

Merged
merged 3 commits into from
Sep 27, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/Development/IDE/Core/Compile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ import Development.IDE.Types.Location

import Language.Haskell.LSP.Types (DiagnosticTag(..))

#if MIN_GHC_API_VERSION(8,6,0)
import LoadIface (loadModuleInterface)
#endif

import qualified Parser
import Lexer
Expand Down Expand Up @@ -147,13 +145,9 @@ typecheckModule (IdeDefer defer) hsc pm = do

initPlugins :: GhcMonad m => ModSummary -> m ModSummary
initPlugins modSummary = do
#if MIN_GHC_API_VERSION(8,6,0)
session <- getSession
dflags <- liftIO $ initializePlugins session (ms_hspp_opts modSummary)
return modSummary{ms_hspp_opts = dflags}
#else
return modSummary
#endif

-- | Whether we should run the -O0 simplifier when generating core.
--
Expand Down Expand Up @@ -278,9 +272,7 @@ unnecessaryDeprecationWarningFlags
#if MIN_GHC_API_VERSION(8,10,0)
, Opt_WarnUnusedRecordWildcards
#endif
#if MIN_GHC_API_VERSION(8,6,0)
, Opt_WarnInaccessibleCode
#endif
, Opt_WarnWarningsDeprecations
]

Expand Down Expand Up @@ -662,9 +654,7 @@ removePackageImports pkgs (L l h@HsModule {hsmodImports} ) = L l (h { hsmodImpor
case PackageName . sl_fs <$> ideclPkgQual of
Just pn | pn `elem` pkgs -> L l (i { ideclPkgQual = Nothing })
_ -> L l i
#if MIN_GHC_API_VERSION(8,6,0)
do_one_import l = l
#endif

loadHieFile :: Compat.NameCacheUpdater -> FilePath -> IO GHC.HieFile
loadHieFile ncu f = do
Expand Down Expand Up @@ -709,7 +699,6 @@ getDocsBatch :: GhcMonad m
-> [Name]
-> m [Either String (Maybe HsDocString, Map.Map Int HsDocString)]
getDocsBatch _mod _names =
#if MIN_GHC_API_VERSION(8,6,0)
withSession $ \hsc_env -> liftIO $ do
((_warns,errs), res) <- initTc hsc_env HsSrcFile False _mod fakeSpan $ forM _names $ \name ->
case nameModule_maybe name of
Expand All @@ -733,9 +722,6 @@ getDocsBatch _mod _names =
case nameSrcLoc n of
RealSrcLoc {} -> False
UnhelpfulLoc {} -> True
#else
return []
#endif

fakeSpan :: RealSrcSpan
fakeSpan = realSrcLocSpan $ mkRealSrcLoc (fsLit "<ghcide>") 1 1
Expand Down
4 changes: 2 additions & 2 deletions src/Development/IDE/Core/Rules.hs
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ getDocMapRule =

-- When possible, rely on the haddocks embedded in our interface files
-- This creates problems on ghc-lib, see comment on 'getDocumentationTryGhc'
#if MIN_GHC_API_VERSION(8,6,0) && !defined(GHC_LIB)
#if !defined(GHC_LIB)
let parsedDeps = []
#else
parsedDeps <- uses_ GetParsedModule tdeps
Expand Down Expand Up @@ -822,7 +822,7 @@ getModSummaryRule = do

getModIfaceRule :: Rules ()
getModIfaceRule = defineEarlyCutoff $ \GetModIface f -> do
#if MIN_GHC_API_VERSION(8,6,0) && !defined(GHC_LIB)
#if !defined(GHC_LIB)
fileOfInterest <- use_ IsFileOfInterest f
case fileOfInterest of
IsFOI _ -> do
Expand Down
Loading