@@ -51,8 +51,10 @@ import qualified Development.IDE.Core.Rules as Rules
5151import Development.IDE.Core.RuleTypes (GenerateCore (GenerateCore ),
5252 GetHieAst (GetHieAst ),
5353 TypeCheck (TypeCheck ))
54- import Development.IDE.Core.Service (initialise ,
55- runAction )
54+ import Development.IDE.Core.Service (ShakeOpQueue ,
55+ initialise ,
56+ runAction ,
57+ runWithShake )
5658import qualified Development.IDE.Core.Service as Service
5759import Development.IDE.Core.Shake (IdeState (shakeExtras ),
5860 IndexQueue ,
@@ -309,8 +311,8 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re
309311 logWith recorder Info $ LogLspStart (pluginId <$> ipMap argsHlsPlugins)
310312
311313 ideStateVar <- newEmptyMVar
312- let getIdeState :: LSP. LanguageContextEnv Config -> Maybe FilePath -> WithHieDb -> IndexQueue -> IO IdeState
313- getIdeState env rootPath withHieDb hieChan = do
314+ let getIdeState :: LSP. LanguageContextEnv Config -> Maybe FilePath -> WithHieDb -> IndexQueue -> ShakeOpQueue -> IO IdeState
315+ getIdeState env rootPath withHieDb hieChan sq = do
314316 traverse_ IO. setCurrentDirectory rootPath
315317 t <- ioT
316318 logWith recorder Info $ LogLspStartDuration t
@@ -349,6 +351,7 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re
349351 ideOptions
350352 withHieDb
351353 hieChan
354+ sq
352355 monitoring
353356 putMVar ideStateVar ide
354357 pure ide
@@ -373,7 +376,7 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re
373376 Check argFiles -> do
374377 dir <- maybe IO. getCurrentDirectory return argsProjectRoot
375378 dbLoc <- getHieDbLoc dir
376- runWithDb (cmapWithPrio LogSession recorder) dbLoc $ \ hiedb hieChan -> do
379+ runWithShake $ \ sq -> runWithDb (cmapWithPrio LogSession recorder) dbLoc $ \ hiedb hieChan -> do
377380 -- GHC produces messages with UTF8 in them, so make sure the terminal doesn't error
378381 hSetEncoding stdout utf8
379382 hSetEncoding stderr utf8
@@ -401,7 +404,7 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re
401404 , optCheckProject = pure False
402405 , optModifyDynFlags = optModifyDynFlags def_options <> pluginModifyDynflags plugins
403406 }
404- ide <- initialise (cmapWithPrio LogService recorder) argsDefaultHlsConfig argsHlsPlugins rules Nothing debouncer ideOptions hiedb hieChan mempty
407+ ide <- initialise (cmapWithPrio LogService recorder) argsDefaultHlsConfig argsHlsPlugins rules Nothing debouncer ideOptions hiedb hieChan sq mempty
405408 shakeSessionInit (cmapWithPrio LogShake recorder) ide
406409 registerIdeConfiguration (shakeExtras ide) $ IdeConfiguration mempty (hashed Nothing )
407410
@@ -431,15 +434,15 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re
431434 Custom (IdeCommand c) -> do
432435 root <- maybe IO. getCurrentDirectory return argsProjectRoot
433436 dbLoc <- getHieDbLoc root
434- runWithDb (cmapWithPrio LogSession recorder) dbLoc $ \ hiedb hieChan -> do
437+ runWithShake $ \ sq -> runWithDb (cmapWithPrio LogSession recorder) dbLoc $ \ hiedb hieChan -> do
435438 sessionLoader <- loadSessionWithOptions (cmapWithPrio LogSession recorder) argsSessionLoadingOptions " ."
436439 let def_options = argsIdeOptions argsDefaultHlsConfig sessionLoader
437440 ideOptions = def_options
438441 { optCheckParents = pure NeverCheck
439442 , optCheckProject = pure False
440443 , optModifyDynFlags = optModifyDynFlags def_options <> pluginModifyDynflags plugins
441444 }
442- ide <- initialise (cmapWithPrio LogService recorder) argsDefaultHlsConfig argsHlsPlugins rules Nothing debouncer ideOptions hiedb hieChan mempty
445+ ide <- initialise (cmapWithPrio LogService recorder) argsDefaultHlsConfig argsHlsPlugins rules Nothing debouncer ideOptions hiedb hieChan sq mempty
443446 shakeSessionInit (cmapWithPrio LogShake recorder) ide
444447 registerIdeConfiguration (shakeExtras ide) $ IdeConfiguration mempty (hashed Nothing )
445448 c ide
0 commit comments