Skip to content

Commit cd49ec4

Browse files
committed
Close Shake session before exit in order to dump Shake profile
1 parent d96c52d commit cd49ec4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: ghcide/src/Development/IDE/LSP/LanguageServer.hs

+5-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ cancelHandler cancelRequest = LSP.notificationHandler SCancelRequest $ \Notifica
200200
liftIO $ cancelRequest (SomeLspId _id)
201201

202202
exitHandler :: IO () -> LSP.Handlers (ServerM c)
203-
exitHandler exit = LSP.notificationHandler SExit (const $ liftIO exit)
203+
exitHandler exit = LSP.notificationHandler SExit $ const $ do
204+
(_, ide) <- ask
205+
-- flush out the Shake session to record a Shake profile if applicable
206+
liftIO $ restartShakeSession (shakeExtras ide) []
207+
liftIO exit
204208

205209
modifyOptions :: LSP.Options -> LSP.Options
206210
modifyOptions x = x{ LSP.textDocumentSync = Just $ tweakTDS origTDS

0 commit comments

Comments
 (0)