From e63e1e0f3581f575a6d75caecae3edfe102c9459 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Sat, 6 Apr 2024 21:55:26 +0100 Subject: [PATCH] stop doing action before handler after shutdown --- lsp/src/Language/LSP/Server/Processing.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lsp/src/Language/LSP/Server/Processing.hs b/lsp/src/Language/LSP/Server/Processing.hs index 2608772c..69530679 100644 --- a/lsp/src/Language/LSP/Server/Processing.hs +++ b/lsp/src/Language/LSP/Server/Processing.hs @@ -449,14 +449,15 @@ handle' :: TClientMessage meth -> m () handle' logger mAction m msg = do - maybe (return ()) (\f -> f msg) mAction + shutdown <- isShuttingDown + + when (not shutdown) $ maybe (return ()) (\f -> f msg) mAction dynReqHandlers <- getsState resRegistrationsReq dynNotHandlers <- getsState resRegistrationsNot env <- getLspEnv let Handlers{reqHandlers, notHandlers} = resHandlers env - shutdown <- isShuttingDown case splitClientMethod m of -- See Note [Shutdown]