@@ -16,7 +16,6 @@ import Control.Concurrent.MVar (newEmptyMVar,
16
16
putMVar , tryReadMVar )
17
17
import Control.Concurrent.STM.Stats (dumpSTMStats )
18
18
import Control.Exception.Safe (SomeException ,
19
- catchAny ,
20
19
displayException )
21
20
import Control.Monad.Extra (concatMapM , unless ,
22
21
when )
@@ -32,7 +31,7 @@ import Data.List.Extra (intercalate,
32
31
import Data.Maybe (catMaybes , isJust )
33
32
import qualified Data.Text as T
34
33
import Development.IDE (Action ,
35
- Priority (Debug , Error ),
34
+ Priority (Debug ),
36
35
Rules , hDuplicateTo' )
37
36
import Development.IDE.Core.Debouncer (Debouncer ,
38
37
newAsyncDebouncer )
@@ -72,9 +71,9 @@ import qualified Development.IDE.Plugin.HLS.GhcIde as GhcIde
72
71
import qualified Development.IDE.Plugin.Test as Test
73
72
import Development.IDE.Session (SessionLoadingOptions ,
74
73
getHieDbLoc ,
74
+ getInitialGhcLibDirDefault ,
75
75
loadSessionWithOptions ,
76
- retryOnSqliteBusy ,
77
- setInitialDynFlags )
76
+ retryOnSqliteBusy )
78
77
import qualified Development.IDE.Session as Session
79
78
import Development.IDE.Types.Location (NormalizedUri ,
80
79
toNormalizedFilePath' )
@@ -329,13 +328,6 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re
329
328
getIdeState env rootPath withHieDb threadQueue = do
330
329
t <- ioT
331
330
logWith recorder Info $ LogLspStartDuration t
332
- -- We want to set the global DynFlags right now, so that we can use
333
- -- `unsafeGlobalDynFlags` even before the project is configured
334
- _mlibdir <-
335
- setInitialDynFlags (cmapWithPrio LogSession recorder) rootPath argsSessionLoadingOptions
336
- -- TODO: should probably catch/log/rethrow at top level instead
337
- `catchAny` (\ e -> logWith recorder Error (LogSetInitialDynFlagsException e) >> pure Nothing )
338
-
339
331
sessionLoader <- loadSessionWithOptions (cmapWithPrio LogSession recorder) argsSessionLoadingOptions rootPath (tLoaderQueue threadQueue)
340
332
config <- LSP. runLspT env LSP. getConfig
341
333
let def_options = argsIdeOptions config sessionLoader
@@ -435,7 +427,7 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re
435
427
let root = argsProjectRoot
436
428
dbLoc <- getHieDbLoc root
437
429
hPutStrLn stderr $ " Using hiedb at: " ++ dbLoc
438
- mlibdir <- setInitialDynFlags (cmapWithPrio LogSession recorder) root def
430
+ mlibdir <- getInitialGhcLibDirDefault (cmapWithPrio LogSession recorder) root
439
431
rng <- newStdGen
440
432
case mlibdir of
441
433
Nothing -> exitWith $ ExitFailure 1
0 commit comments