@@ -76,7 +76,7 @@ import GHC (ClsInst,
76
76
pprInstance , setTargets ,
77
77
typeKind )
78
78
#if MIN_VERSION_ghc(9,2,0)
79
- import GHC (Fixity , pushLogHookM )
79
+ import GHC (Fixity )
80
80
#else
81
81
import GHC (setLogAction )
82
82
#endif
@@ -110,9 +110,6 @@ import Language.LSP.Types hiding
110
110
SemanticTokenRelative (length ))
111
111
import Language.LSP.Types.Lens (end , line )
112
112
import Language.LSP.VFS (virtualFileText )
113
- import System.FilePath (takeFileName )
114
- import System.IO (hClose )
115
- import UnliftIO.Temporary (withSystemTempFile )
116
113
117
114
#if MIN_VERSION_ghc(9,2,0)
118
115
#elif MIN_VERSION_ghc(9,0,0)
@@ -227,7 +224,7 @@ runEvalCmd plId st EvalParams{..} =
227
224
(Just (textToStringBuffer mdlText, now))
228
225
229
226
-- Setup environment for evaluation
230
- hscEnv' <- ExceptT $ fmap join $ withSystemTempFile (takeFileName fp) $ \ logFilename logHandle -> liftIO . gStrictTry . evalGhcEnv session $ do
227
+ hscEnv' <- ExceptT $ fmap join $ liftIO . gStrictTry . evalGhcEnv session $ do
231
228
env <- getSession
232
229
233
230
-- Install the module pragmas and options
@@ -278,27 +275,6 @@ runEvalCmd plId st EvalParams{..} =
278
275
}
279
276
#endif
280
277
281
- -- set up a custom log action
282
- #if MIN_VERSION_ghc(9,2,0)
283
- -- NOTE: I removed that, it was breaking the eval plugin, sometimes
284
- -- I don't know why, I don't even understand what is the purpose of theses lines.
285
- -- I just copied them from the previous version and tried to
286
- -- adapt them to the new GHC 9.2 API.
287
- --
288
- -- But tests are fine without this.
289
- -- So, what have I missed?
290
- --
291
- -- pushLogHookM . const $ \_df _wr _sev _span _doc ->
292
- -- defaultLogActionHPutStrDoc _df False logHandle _doc
293
- -- TODO: check the True
294
- #elif MIN_VERSION_ghc(9,0,0)
295
- setLogAction $ \ _df _wr _sev _span _doc ->
296
- defaultLogActionHPutStrDoc _df logHandle _doc
297
- #else
298
- setLogAction $ \ _df _wr _sev _span _style _doc ->
299
- defaultLogActionHPutStrDoc _df logHandle _doc _style
300
- #endif
301
-
302
278
-- Load the module with its current content (as the saved module might not be up to date)
303
279
-- BUG: this fails for files that requires preprocessors (e.g. CPP) for ghc < 8.8
304
280
-- see https://gitlab.haskell.org/ghc/ghc/-/issues/17066
@@ -311,8 +287,7 @@ runEvalCmd plId st EvalParams{..} =
311
287
dbg " LOAD RESULT" $ asS loadResult
312
288
case loadResult of
313
289
Failed -> liftIO $ do
314
- hClose logHandle
315
- err <- readFile logFilename
290
+ let err = " "
316
291
dbg " load ERR" err
317
292
return $ Left err
318
293
Succeeded -> do
0 commit comments