Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 19a106d

Browse files
committed
Add status update for init cradle
1 parent 671d5ef commit 19a106d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

hie-plugin-api/Haskell/Ide/Engine/ModuleCache.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{-# LANGUAGE MultiParamTypeClasses #-}
66
{-# LANGUAGE FlexibleInstances #-}
77
{-# LANGUAGE TupleSections #-}
8+
{-# LANGUAGE OverloadedStrings #-}
89

910
module Haskell.Ide.Engine.ModuleCache
1011
( modifyCache
@@ -62,7 +63,7 @@ modifyCache f = do
6263
-- then runs the action in the default cradle.
6364
-- Sets the current directory to the cradle root dir
6465
-- in either case
65-
runActionWithContext :: (GHC.GhcMonad m, HasGhcModuleCache m)
66+
runActionWithContext :: (MonadIde m, GHC.GhcMonad m, HasGhcModuleCache m)
6667
=> GHC.DynFlags -> Maybe FilePath -> m a -> m a
6768
runActionWithContext _df Nothing action = do
6869
-- Cradle with no additional flags
@@ -74,7 +75,7 @@ runActionWithContext _df Nothing action = do
7475
runActionWithContext df (Just uri) action = do
7576
getCradle uri (\lc -> loadCradle df lc >> action)
7677

77-
loadCradle :: (HasGhcModuleCache m, GHC.GhcMonad m) => GHC.DynFlags -> LookupCradleResult -> m ()
78+
loadCradle :: (MonadIde m, HasGhcModuleCache m, GHC.GhcMonad m) => GHC.DynFlags -> LookupCradleResult -> m ()
7879
loadCradle _ ReuseCradle = do
7980
traceM ("Reusing cradle")
8081
loadCradle iniDynFlags (NewCradle fp) = do
@@ -87,7 +88,7 @@ loadCradle iniDynFlags (NewCradle fp) = do
8788
traceShowM crdl
8889
liftIO (GHC.newHscEnv iniDynFlags) >>= GHC.setSession
8990
liftIO $ setCurrentDirectory (BIOS.cradleRootDir crdl)
90-
BIOS.initializeFlagsWithCradle fp crdl
91+
withIndefiniteProgress "Initialising Cradle" $ BIOS.initializeFlagsWithCradle fp crdl
9192
setCurrentCradle crdl
9293
loadCradle _iniDynFlags (LoadCradle (CachedCradle crd env)) = do
9394
traceShowM ("Reload Cradle" , crd)

0 commit comments

Comments
 (0)