-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong type on server.start_io #496
Comments
tombh
added a commit
that referenced
this issue
Sep 14, 2024
Although this is strictly an API change, I think it's actually just a fix because passing an actual `TextIO` object causes an error. Fixes: #496
6 tasks
tombh
added a commit
that referenced
this issue
Sep 14, 2024
Although this is strictly an API change, I think it's actually just a fix because passing an actual `TextIO` object causes an error. Fixes: #496
Like this? #497 |
Yes exactly :) Thanks! |
tombh
added a commit
that referenced
this issue
Sep 17, 2024
Although this is strictly an API change, I think it's actually just a fix because passing an actual `TextIO` object causes an error. Fixes: #496
Merged into main ✅ Please let us know if there's any more problems. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The server.start_io method has 2 optional arguments which are typed with TextIO.
Entering an TextIO object crashes the language server.
Entering a BinaryIO object makes everything work.
This seems reasonable as the default case also uses an BinaryIO object (see line 239):
transport = StdOutTransportAdapter(stdin or sys.stdin.buffer, stdout or sys.stdout.buffer)
sys.stdin.buffer has type BinaryIO
Solution:
in server.py change
def start_io(self, stdin: Optional[TextIO] = None, stdout: Optional[TextIO] = None):
to
def start_io(self, stdin: Optional[BinaryIO] = None, stdout: Optional[BinaryIO] = None):
The text was updated successfully, but these errors were encountered: