Skip to content

Commit 65fa86c

Browse files
committed
Log when reactor thread exits
1 parent 5cc51de commit 65fa86c

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

ghcide/src/Development/IDE/LSP/LanguageServer.hs

+11-9
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,17 @@ runLanguageServer options inH outH getHieDbLoc defaultConfig onConfigurationChan
182182
) $ \(e :: SomeException) -> do
183183
exceptionInHandler e
184184
k $ ResponseError InternalError (T.pack $ show e) Nothing
185-
_ <- flip forkFinally handleServerException $ untilMVar lifetime $ runWithDb logger dbLoc $ \hiedb hieChan -> do
186-
putMVar dbMVar (hiedb,hieChan)
187-
forever $ do
188-
msg <- readChan clientMsgChan
189-
-- We dispatch notifications synchronously and requests asynchronously
190-
-- This is to ensure that all file edits and config changes are applied before a request is handled
191-
case msg of
192-
ReactorNotification act -> handle exceptionInHandler act
193-
ReactorRequest _id act k -> void $ async $ checkCancelled _id act k
185+
_ <- flip forkFinally handleServerException $ do
186+
untilMVar lifetime $ runWithDb logger dbLoc $ \hiedb hieChan -> do
187+
putMVar dbMVar (hiedb,hieChan)
188+
forever $ do
189+
msg <- readChan clientMsgChan
190+
-- We dispatch notifications synchronously and requests asynchronously
191+
-- This is to ensure that all file edits and config changes are applied before a request is handled
192+
case msg of
193+
ReactorNotification act -> handle exceptionInHandler act
194+
ReactorRequest _id act k -> void $ async $ checkCancelled _id act k
195+
logInfo logger "Reactor thread stopped"
194196
pure $ Right (env,ide)
195197

196198

0 commit comments

Comments
 (0)