@@ -192,6 +192,8 @@ data SessionState = SessionState
192192 -- ^ The capabilities that the server has dynamically registered with us so
193193 -- far
194194 , curProgressSessions :: ! (Set. Set ProgressToken )
195+ , ignoringLogNotifications :: Bool
196+ , ignoringConfigurationRequests :: Bool
195197 }
196198
197199class Monad m => HasState s m where
@@ -277,7 +279,7 @@ runSession' serverIn serverOut mServerProc serverHandler config caps rootDir exi
277279 mainThreadId <- myThreadId
278280
279281 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)
281283 runSession' ses = initVFS $ \ vfs -> runSessionMonad context (initState vfs) ses
282284
283285 errorHandler = throwTo mainThreadId :: SessionException -> IO ()
@@ -306,7 +308,7 @@ runSession' serverIn serverOut mServerProc serverHandler config caps rootDir exi
306308
307309updateStateC :: ConduitM FromServerMessage FromServerMessage (StateT SessionState (ReaderT SessionContext IO )) ()
308310updateStateC = awaitForever $ \ msg -> do
309- context <- ask @ SessionContext
311+ state <- get @ SessionState
310312 updateState msg
311313 case msg of
312314 FromServerMess SMethod_WindowWorkDoneProgressCreate req ->
@@ -334,7 +336,7 @@ updateStateC = awaitForever $ \msg -> do
334336
335337 _ -> sendMessage @ _ @ (TResponseError Method_WorkspaceConfiguration ) $ TResponseError (InL LSPErrorCodes_RequestFailed ) " No configuration" Nothing
336338 _ -> pure ()
337- unless ((ignoreLogNotifications (config context) && isLogNotification msg) || (ignoreConfigurationRequests (config context) && isConfigRequest msg)) $
339+ unless ((ignoringLogNotifications state && isLogNotification msg) || (ignoringConfigurationRequests state && isConfigRequest msg)) $
338340 yield msg
339341
340342 where
0 commit comments