Open
Conversation
600c0cb to
48a8cbc
Compare
183 class LspStdIoWriter(LspStdIoBase):
184 """Language Server stdio Writer"""
185
186 async def write(self) -> None:
187 """Write to a Language Server until it closes"""
188 while not self.stream.closed:
189 message = await self.queue.get()
190 try:
191 body = message.encode("utf-8")
192 response = "Content-Length: {}\r\n\r\n{}".format(len(body), message)
193 await convert_yielded(self._write_one(response.encode("utf-8")))
194 except BrokenPipeError:
195 # self.queue.task_done()
196 # propagate broken pipe errors
197 raise
198 except Exception: # pragma: no cover
199 # catch other (hopefully mild) exceptions
200 self.log.exception("%s couldn't write message: %s", self, response)
201 finally:
202 self.queue.task_done()
203
204 @run_on_executor
205 def _write_one(self, message) -> None:
206 self.stream.write(message)
207 self.stream.flush()Hi @krassowski , I delete the code at line 195 in
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References
Fixes part of #20, and maybe #274. Well, it does not work yet (if I remember correctly), but the tests might come in handy.
Code changes
User-facing changes
Backwards-incompatible changes
Chores