File tree 1 file changed +7
-3
lines changed
ghcide/src/Development/IDE/LSP
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ runLanguageServer options inH outH getHieDbLoc defaultConfig onConfigurationChan
93
93
[ ideHandlers
94
94
, cancelHandler cancelRequest
95
95
, exitHandler exit
96
+ , shutdownHandler
96
97
]
97
98
-- Cancel requests are special since they need to be handled
98
99
-- out of order to be useful. Existing handlers are run afterwards.
@@ -185,13 +186,16 @@ cancelHandler :: (SomeLspId -> IO ()) -> LSP.Handlers (ServerM c)
185
186
cancelHandler cancelRequest = LSP. notificationHandler SCancelRequest $ \ NotificationMessage {_params= CancelParams {_id}} ->
186
187
liftIO $ cancelRequest (SomeLspId _id)
187
188
188
- exitHandler :: IO () -> LSP. Handlers (ServerM c )
189
- exitHandler exit = LSP. notificationHandler SExit $ const $ do
189
+ shutdownHandler :: LSP. Handlers (ServerM c )
190
+ shutdownHandler = LSP. requestHandler SShutdown $ \ _ resp -> do
190
191
(_, ide) <- ask
191
192
liftIO $ logDebug (ideLogger ide) " Received exit message"
192
193
-- flush out the Shake session to record a Shake profile if applicable
193
194
liftIO $ shakeShut ide
194
- liftIO exit
195
+ resp $ Right Empty
196
+
197
+ exitHandler :: IO () -> LSP. Handlers (ServerM c )
198
+ exitHandler exit = LSP. notificationHandler SExit $ const $ liftIO exit
195
199
196
200
modifyOptions :: LSP. Options -> LSP. Options
197
201
modifyOptions x = x{ LSP. textDocumentSync = Just $ tweakTDS origTDS
You can’t perform that action at this time.
0 commit comments