@@ -192,6 +192,8 @@ data SessionState = SessionState
192
192
-- ^ The capabilities that the server has dynamically registered with us so
193
193
-- far
194
194
, curProgressSessions :: ! (Set. Set ProgressToken )
195
+ , ignoringLogNotifications :: Bool
196
+ , ignoringConfigurationRequests :: Bool
195
197
}
196
198
197
199
class Monad m => HasState s m where
@@ -277,7 +279,7 @@ runSession' serverIn serverOut mServerProc serverHandler config caps rootDir exi
277
279
mainThreadId <- myThreadId
278
280
279
281
let context = SessionContext serverIn absRootDir messageChan timeoutIdVar reqMap initRsp config caps
280
- initState vfs = SessionState 0 vfs mempty False Nothing mempty (lspConfig config) mempty
282
+ initState vfs = SessionState 0 vfs mempty False Nothing mempty (lspConfig config) mempty (ignoreLogNotifications config) (ignoreConfigurationRequests config)
281
283
runSession' ses = initVFS $ \ vfs -> runSessionMonad context (initState vfs) ses
282
284
283
285
errorHandler = throwTo mainThreadId :: SessionException -> IO ()
@@ -306,7 +308,7 @@ runSession' serverIn serverOut mServerProc serverHandler config caps rootDir exi
306
308
307
309
updateStateC :: ConduitM FromServerMessage FromServerMessage (StateT SessionState (ReaderT SessionContext IO )) ()
308
310
updateStateC = awaitForever $ \ msg -> do
309
- context <- ask @ SessionContext
311
+ state <- get @ SessionState
310
312
updateState msg
311
313
case msg of
312
314
FromServerMess SMethod_WindowWorkDoneProgressCreate req ->
@@ -334,7 +336,7 @@ updateStateC = awaitForever $ \msg -> do
334
336
335
337
_ -> sendMessage @ _ @ (TResponseError Method_WorkspaceConfiguration ) $ TResponseError (InL LSPErrorCodes_RequestFailed ) " No configuration" Nothing
336
338
_ -> pure ()
337
- unless ((ignoreLogNotifications (config context) && isLogNotification msg) || (ignoreConfigurationRequests (config context) && isConfigRequest msg)) $
339
+ unless ((ignoringLogNotifications state && isLogNotification msg) || (ignoringConfigurationRequests state && isConfigRequest msg)) $
338
340
yield msg
339
341
340
342
where
0 commit comments