@@ -76,17 +76,17 @@ import GHC (ClsInst,
76
76
parseName , pprFamInst ,
77
77
pprInstance , setTargets ,
78
78
typeKind )
79
- #if MIN_VERSION_ghc(9,2,0)
80
- import GHC ( Fixity )
81
- #endif
79
+
80
+
81
+
82
82
import qualified GHC.LanguageExtensions.Type as LangExt (Extension (.. ))
83
83
84
84
import Development.IDE.Core.FileStore (setSomethingModified )
85
85
import Development.IDE.Types.Shake (toKey )
86
86
import Ide.Plugin.Config (Config )
87
- #if MIN_VERSION_ghc(9,2,0)
88
- import GHC.Types.SrcLoc ( UnhelpfulSpanReason ( UnhelpfulInteractive ))
89
- #endif
87
+
88
+
89
+
90
90
import Ide.Plugin.Eval.Code (Statement , asStatements ,
91
91
evalSetup , myExecStmt ,
92
92
propSetup , resultRange ,
@@ -110,13 +110,13 @@ import Language.LSP.Types hiding
110
110
import Language.LSP.Types.Lens (end , line )
111
111
import Language.LSP.VFS (virtualFileText )
112
112
113
- #if MIN_VERSION_ghc(9,2,0)
114
- #elif MIN_VERSION_ghc(9,0,0)
115
- import GHC.Driver.Session ( unitDatabases , unitState )
116
- import GHC.Types.SrcLoc ( UnhelpfulSpanReason ( UnhelpfulInteractive ))
117
- #else
113
+
114
+
115
+
116
+
117
+
118
118
import DynFlags
119
- #endif
119
+
120
120
121
121
122
122
{- | Code Lens provider
@@ -251,15 +251,15 @@ runEvalCmd plId st EvalParams{..} =
251
251
. flip xopt_unset LangExt. MonomorphismRestriction
252
252
$ idflags
253
253
setInteractiveDynFlags $ df'
254
- #if MIN_VERSION_ghc(9,0,0)
255
- {
256
- packageFlags =
257
- packageFlags
258
- df
259
- , useColor = Never
260
- , canUseColor = False
261
- }
262
- #else
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
263
{ pkgState =
264
264
pkgState
265
265
df
@@ -272,7 +272,7 @@ runEvalCmd plId st EvalParams{..} =
272
272
, useColor = Never
273
273
, canUseColor = False
274
274
}
275
- #endif
275
+
276
276
277
277
-- Load the module with its current content (as the saved module might not be up to date)
278
278
-- BUG: this fails for files that requires preprocessors (e.g. CPP) for ghc < 8.8
@@ -358,8 +358,9 @@ runTests EvalConfig{..} e@(_st, _) tests = do
358
358
dbg " TEST RESULTS" rs
359
359
360
360
let checkedResult = testCheck eval_cfg_diff (section, test) rs
361
+ let resultLines = concatMap T. lines checkedResult
361
362
362
- let edit = asEdit (sectionFormat section) test (map pad checkedResult )
363
+ let edit = asEdit (sectionFormat section) test (map pad resultLines )
363
364
dbg " TEST EDIT" edit
364
365
return edit
365
366
@@ -511,11 +512,11 @@ evals mark_exception (st, fp) df stmts = do
511
512
void $ runDecls stmt
512
513
return Nothing
513
514
pf = initParserOpts df
514
- #if !MIN_VERSION_ghc(9,0,0)
515
+
515
516
unhelpfulReason = " <interactive>"
516
- #else
517
- unhelpfulReason = UnhelpfulInteractive
518
- #endif
517
+
518
+
519
+
519
520
exec stmt l =
520
521
let opts = execOptions{execSourceFile = fp, execLineNumber = l}
521
522
in myExecStmt stmt opts
@@ -690,9 +691,9 @@ doTypeCmd dflags arg = do
690
691
691
692
parseExprMode :: Text -> (TcRnExprMode , T. Text )
692
693
parseExprMode rawArg = case T. break isSpace rawArg of
693
- #if !MIN_VERSION_ghc(9,2,0)
694
+
694
695
(" +v" , rest) -> (TM_NoInst , T. strip rest)
695
- #endif
696
+
696
697
(" +d" , rest) -> (TM_Default , T. strip rest)
697
698
_ -> (TM_Inst , rawArg)
698
699
0 commit comments