@@ -53,7 +53,7 @@ instance Pretty LspServerLog where
5353-- (1) reads from stdin;
5454-- (2) writes to stdout; and
5555-- (3) logs to stderr and to the client, with some basic filtering.
56- runServer :: forall config . ServerDefinition config -> IO Int
56+ runServer :: forall config . ServerDefinition config -> IO ()
5757runServer =
5858 runServerWithHandles
5959 ioLogger
@@ -81,7 +81,7 @@ runServerWithHandles ::
8181 -> Handle
8282 -- ^ Handle to write output to.
8383 -> ServerDefinition config
84- -> IO Int -- exit code
84+ -> IO ()
8585runServerWithHandles ioLogger logger hin hout serverDefinition = do
8686
8787 hSetBuffering hin NoBuffering
@@ -111,7 +111,7 @@ runServerWith ::
111111 -> (BS. ByteString -> IO () )
112112 -- ^ Function to provide output to.
113113 -> ServerDefinition config
114- -> IO Int -- exit code
114+ -> IO ()
115115runServerWith ioLogger logger clientIn clientOut serverDefinition = do
116116
117117 ioLogger <& Starting `WithSeverity ` Info
@@ -134,11 +134,10 @@ runServerWith ioLogger logger clientIn clientOut serverDefinition = do
134134 sendMsg
135135 recvMsg
136136
137- _ <- forkIO serverIn
138137 -- Bind all the threads together so that any of them terminating will terminate everything
139138 _ <- Async. withAsync serverOut $ \ a1 ->
140- Async. withAsync processingLoop $ \ a3 ->
141- Async. waitAny [a1, a3]
139+ Async. withAsync serverIn $ \ a2 ->
140+ Async. withAsync processingLoop $ \ a3 ->
141+ Async. waitAny [a1, a2, a3]
142142
143143 ioLogger <& Stopping `WithSeverity ` Info
144- return 0
0 commit comments