@@ -53,7 +53,7 @@ instance Pretty LspServerLog where
53
53
-- (1) reads from stdin;
54
54
-- (2) writes to stdout; and
55
55
-- (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 ()
57
57
runServer =
58
58
runServerWithHandles
59
59
ioLogger
@@ -81,7 +81,7 @@ runServerWithHandles ::
81
81
-> Handle
82
82
-- ^ Handle to write output to.
83
83
-> ServerDefinition config
84
- -> IO Int -- exit code
84
+ -> IO ()
85
85
runServerWithHandles ioLogger logger hin hout serverDefinition = do
86
86
87
87
hSetBuffering hin NoBuffering
@@ -111,7 +111,7 @@ runServerWith ::
111
111
-> (BS. ByteString -> IO () )
112
112
-- ^ Function to provide output to.
113
113
-> ServerDefinition config
114
- -> IO Int -- exit code
114
+ -> IO ()
115
115
runServerWith ioLogger logger clientIn clientOut serverDefinition = do
116
116
117
117
ioLogger <& Starting `WithSeverity ` Info
@@ -134,11 +134,10 @@ runServerWith ioLogger logger clientIn clientOut serverDefinition = do
134
134
sendMsg
135
135
recvMsg
136
136
137
- _ <- forkIO serverIn
138
137
-- Bind all the threads together so that any of them terminating will terminate everything
139
138
_ <- 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]
142
142
143
143
ioLogger <& Stopping `WithSeverity ` Info
144
- return 0
0 commit comments