@@ -16,7 +16,6 @@ module Haskell.Ide.Engine.Transport.LspStdio
1616 ) where
1717
1818import Control.Concurrent
19- import Control.Concurrent.Async
2019import Control.Concurrent.STM.TChan
2120import qualified Control.FoldDebounce as Debounce
2221import qualified Control.Exception as E
@@ -142,7 +141,7 @@ run scheduler _origDir plugins captureFp = flip E.catches handlers $ do
142141 let diagnosticsQueue tr = forever $ do
143142 inval <- liftIO $ atomically $ readTChan diagIn
144143 Debounce. send tr (coerce . Just $ MostRecent inval)
145-
144+
146145 -- Debounce for (default) 350ms.
147146 debounceDuration <- diagnosticsDebounceDuration . fromMaybe def <$> Core. config lf
148147 tr <- Debounce. new
@@ -153,8 +152,8 @@ run scheduler _origDir plugins captureFp = flip E.catches handlers $ do
153152 -- We launch the dispatcher after that so that the default cradle is
154153 -- recognized properly by ghc-mod
155154 _ <- forkIO $ Scheduler. runScheduler scheduler errorHandler callbackHandler (Just lf)
156- `race_` reactorFunc
157- `race_` diagnosticsQueue tr
155+ _ <- forkIO reactorFunc
156+ _ <- forkIO $ diagnosticsQueue tr
158157 return Nothing
159158
160159 diagnosticProviders :: Map. Map DiagnosticTrigger [(PluginId ,DiagnosticProviderFunc )]
@@ -375,6 +374,7 @@ reactor inp diagIn = do
375374 let
376375 loop :: TrackingNumber -> R void
377376 loop tn = do
377+ liftIO $ U. logs $ " ****** reactor: top of loop"
378378 inval <- liftIO $ atomically $ readTChan inp
379379 liftIO $ U. logs $ " ****** reactor: got message number:" ++ show tn
380380
0 commit comments