Skip to content

Commit 8c1e41a

Browse files
committed
run session build in mask_
1 parent 6355b71 commit 8c1e41a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ghcide/session-loader/Development/IDE/Session.hs

+7-3
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,8 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir = do
799799
IdeOptions{ optCheckProject = getCheckProject} <- getIdeOptions
800800
returnWithVersion $ \file -> do
801801
-- only one cradle consult at a time
802-
async <- UnliftIO.async $ UnliftIO.withMVar cradleLock $ const $ do
802+
803+
UnliftIO.mask_ $ UnliftIO.withMVar cradleLock $ const $ do
803804
-- we need to find a way to get rid of the (files, keys)
804805
_opts@(a, b, _files, _keys) <- use_ HieYaml file
805806
files <- liftIO $ atomically $ swapTVar targetFiles []
@@ -808,9 +809,12 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir = do
808809
liftIO $ when (notNull files || notNull keys) $ do
809810
checkProject <- getCheckProject
810811
-- think of not to restart a second time
811-
restartShakeSession VFSUnmodified "new component" (if checkProject then return (typecheckAll files) else mempty) $ pure keys
812+
async <- UnliftIO.async $ restartShakeSession VFSUnmodified "new component" (if checkProject then return (typecheckAll files) else mempty) $ pure keys
813+
UnliftIO.wait async
812814
pure $ (fmap . fmap) toAbsolutePath (a, b)
813-
UnliftIO.wait async)
815+
816+
-- UnliftIO.wait async
817+
)
814818

815819

816820
-- | Run the specific cradle on a specific FilePath via hie-bios.

0 commit comments

Comments
 (0)