@@ -14,6 +14,7 @@ module Development.IDE.Main
14
14
import Control.Concurrent.Extra (withNumCapabilities )
15
15
import Control.Concurrent.MVar (newEmptyMVar ,
16
16
putMVar , tryReadMVar )
17
+ import Control.Concurrent.STM (TQueue )
17
18
import Control.Concurrent.STM.Stats (dumpSTMStats )
18
19
import Control.Exception.Safe (SomeException ,
19
20
catchAny ,
@@ -308,8 +309,8 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re
308
309
logWith recorder Info $ LogLspStart (pluginId <$> ipMap argsHlsPlugins)
309
310
310
311
ideStateVar <- newEmptyMVar
311
- let getIdeState :: LSP. LanguageContextEnv Config -> Maybe FilePath -> WithHieDb -> IndexQueue -> IO IdeState
312
- getIdeState env rootPath withHieDb hieChan = do
312
+ let getIdeState :: LSP. LanguageContextEnv Config -> Maybe FilePath -> WithHieDb -> IndexQueue -> TQueue ( IO () ) -> IO IdeState
313
+ getIdeState env rootPath withHieDb hieChan progressChan = do
313
314
traverse_ IO. setCurrentDirectory rootPath
314
315
t <- ioT
315
316
logWith recorder Info $ LogLspStartDuration t
@@ -348,6 +349,7 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re
348
349
ideOptions
349
350
withHieDb
350
351
hieChan
352
+ progressChan
351
353
monitoring
352
354
putMVar ideStateVar ide
353
355
pure ide
@@ -371,7 +373,7 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re
371
373
Check argFiles -> do
372
374
dir <- maybe IO. getCurrentDirectory return argsProjectRoot
373
375
dbLoc <- getHieDbLoc dir
374
- runWithDb (cmapWithPrio LogSession recorder) dbLoc $ \ hiedb hieChan -> do
376
+ runWithDb (cmapWithPrio LogSession recorder) dbLoc $ \ hiedb hieChan proChan -> do
375
377
-- GHC produces messages with UTF8 in them, so make sure the terminal doesn't error
376
378
hSetEncoding stdout utf8
377
379
hSetEncoding stderr utf8
@@ -399,7 +401,7 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re
399
401
, optCheckProject = pure False
400
402
, optModifyDynFlags = optModifyDynFlags def_options <> pluginModifyDynflags plugins
401
403
}
402
- ide <- initialise (cmapWithPrio LogService recorder) argsDefaultHlsConfig argsHlsPlugins rules Nothing debouncer ideOptions hiedb hieChan mempty
404
+ ide <- initialise (cmapWithPrio LogService recorder) argsDefaultHlsConfig argsHlsPlugins rules Nothing debouncer ideOptions hiedb hieChan proChan mempty
403
405
shakeSessionInit (cmapWithPrio LogShake recorder) ide
404
406
registerIdeConfiguration (shakeExtras ide) $ IdeConfiguration mempty (hashed Nothing )
405
407
@@ -429,15 +431,15 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re
429
431
Custom (IdeCommand c) -> do
430
432
root <- maybe IO. getCurrentDirectory return argsProjectRoot
431
433
dbLoc <- getHieDbLoc root
432
- runWithDb (cmapWithPrio LogSession recorder) dbLoc $ \ hiedb hieChan -> do
434
+ runWithDb (cmapWithPrio LogSession recorder) dbLoc $ \ hiedb hieChan proChan -> do
433
435
sessionLoader <- loadSessionWithOptions (cmapWithPrio LogSession recorder) argsSessionLoadingOptions " ."
434
436
let def_options = argsIdeOptions argsDefaultHlsConfig sessionLoader
435
437
ideOptions = def_options
436
438
{ optCheckParents = pure NeverCheck
437
439
, optCheckProject = pure False
438
440
, optModifyDynFlags = optModifyDynFlags def_options <> pluginModifyDynflags plugins
439
441
}
440
- ide <- initialise (cmapWithPrio LogService recorder) argsDefaultHlsConfig argsHlsPlugins rules Nothing debouncer ideOptions hiedb hieChan mempty
442
+ ide <- initialise (cmapWithPrio LogService recorder) argsDefaultHlsConfig argsHlsPlugins rules Nothing debouncer ideOptions hiedb hieChan proChan mempty
441
443
shakeSessionInit (cmapWithPrio LogShake recorder) ide
442
444
registerIdeConfiguration (shakeExtras ide) $ IdeConfiguration mempty (hashed Nothing )
443
445
c ide
0 commit comments