Skip to content

Commit a747f73

Browse files
committed
format with fourmolu
1 parent a447a4f commit a747f73

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

lsp/src/Language/LSP/Server/Control.hs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ module Language.LSP.Server.Control (
1212
import Colog.Core (LogAction (..), Severity (..), WithSeverity (..), (<&))
1313
import Colog.Core qualified as L
1414
import Control.Applicative ((<|>))
15-
import Control.Concurrent.Async (withAsync, wait, cancel, race)
1615
import Control.Concurrent (threadDelay)
16+
import Control.Concurrent.Async (cancel, race, wait, withAsync)
1717
import Control.Concurrent.STM.TChan
1818
import Control.Exception (catchJust, throwIO)
1919
import Control.Monad.IO.Class
@@ -157,7 +157,7 @@ runServerWith ioLogger logger clientIn clientOut serverDefinition = do
157157
-- Wait up to 3 seconds for the sender to finish; cancel if it doesn't.
158158
r <- race (wait _sendAsync) (threadDelay 3_000_000)
159159
case r of
160-
Left _ -> pure ()
160+
Left _ -> pure ()
161161
Right _ -> ioLogger <& SenderShutdownTimeout `WithSeverity` Warning
162162
ioLogger <& ServerStopped `WithSeverity` Info
163163
return res
@@ -196,13 +196,15 @@ ioLoop ioLogger logger clientIn serverDefinition vfs sendMsg = do
196196
where
197197
go r = do
198198
b <- isExiting
199-
if b then pure 0 else do
200-
res <- parseOne logger clientIn r
201-
case res of
202-
Nothing -> pure 1
203-
Just (msg, remainder) -> do
204-
Processing.processMessage pLogger $ BSL.fromStrict msg
205-
go (parse parser remainder)
199+
if b
200+
then pure 0
201+
else do
202+
res <- parseOne logger clientIn r
203+
case res of
204+
Nothing -> pure 1
205+
Just (msg, remainder) -> do
206+
Processing.processMessage pLogger $ BSL.fromStrict msg
207+
go (parse parser remainder)
206208

207209
parser = do
208210
try contentType <|> return ()

0 commit comments

Comments
 (0)