microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 235 forks source link

Bypass the TSServer CRLF bug #767

Closed borodean closed 3 years ago

borodean commented 3 years ago

Addresses https://github.com/microsoft/TypeScript-Sublime-Plugin/issues/765.

The plugin broke in the master branch after adding commit 64991b18ea7185cd8e1294b19f9cbfc8915a2283. After adding it, when NodeCommClient receives a message with an empty header, it tries to read an error from stderr.

TSServer doesn't handle line breaks correctly on Windows (https://github.com/Microsoft/TypeScript/issues/3403). Because of this the messages are parsed incorrectly, and the plugin gets into the very piece of code where it now tries to read an error. Before it used to just quit the function at that point and the parsing problem went unnoticed, but now the plugin is stuck trying to read stderr.

I found the information about the method of solving the problem here: https://github.com/ycm-core/ycmd/pull/503.

Hopefully, this will unblock the new release.

ghost commented 3 years ago

CLA assistant check
All CLA requirements met.

orta commented 3 years ago

Oh! OK, great - I'll give this a run next week, thanks

orta commented 3 years ago

I've given this PR a run locallay and it worked for me on Windows + ST3 - thanks @borodean