Skip to content

Commit 39a45a2

Browse files
committed
wait for the session to be restarted
1 parent e10d135 commit 39a45a2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ghcide/src/Development/IDE/Core/Shake.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,12 +762,11 @@ delayedAction a = do
762762
shakeRestart :: Recorder (WithPriority Log) -> IdeState -> VFSModified -> String -> [DelayedAction ()] -> IO [Key] -> IO ()
763763
shakeRestart recorder IdeState{..} vfs reason acts ioActionBetweenShakeSession = do
764764
barrier <- newBarrier
765-
atomically $ writeTQueue (shakeOpQueue $ shakeExtras) $
765+
atomically $ writeTQueue (shakeOpQueue $ shakeExtras) $ do
766766
withMVar'
767767
shakeSession
768768
(\runner -> do
769769
(stopTime,()) <- duration $ logErrorAfter 10 $ cancelShakeSession runner
770-
signalBarrier barrier ()
771770
keys <- ioActionBetweenShakeSession
772771
atomically $ modifyTVar' (dirtyKeys shakeExtras) $ \x -> foldl' (flip insertKeySet) x keys
773772
res <- shakeDatabaseProfile shakeDb
@@ -782,6 +781,7 @@ shakeRestart recorder IdeState{..} vfs reason acts ioActionBetweenShakeSession =
782781
-- See https://github.com/haskell/ghcide/issues/79
783782
(\() -> do
784783
(,()) <$> newSession recorder shakeExtras vfs shakeDb acts reason)
784+
signalBarrier barrier ()
785785
waitBarrier barrier
786786
where
787787
logErrorAfter :: Seconds -> IO () -> IO ()

ghcide/src/Development/IDE/Main.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re
341341
}
342342
caps = LSP.resClientCapabilities env
343343
monitoring <- argsMonitoring
344+
344345
ide <- initialise
345346
(cmapWithPrio LogService recorder)
346347
argsDefaultHlsConfig

0 commit comments

Comments
 (0)