Skip to content

Commit

Permalink
Close Shake session before exit in order to dump Shake profile
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Mar 6, 2021
1 parent ee3a09f commit 6b0d0d4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ghcide/src/Development/IDE/LSP/LanguageServer.hs
Expand Up @@ -200,7 +200,11 @@ cancelHandler cancelRequest = LSP.notificationHandler SCancelRequest $ \Notifica
liftIO $ cancelRequest (SomeLspId _id)

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

modifyOptions :: LSP.Options -> LSP.Options
modifyOptions x = x{ LSP.textDocumentSync = Just $ tweakTDS origTDS
Expand Down

0 comments on commit 6b0d0d4

Please sign in to comment.