-
Notifications
You must be signed in to change notification settings - Fork 12.8k
use process.stdout.write on server instead of fs.write #5408
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
Conversation
} | ||
else { | ||
canWrite = false; | ||
process.stdout.write(new Buffer(s, "utf8"), () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to create a new buffer each time or can you avoid allocating one per call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider also moving the callback out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the common practice and standard buffer API. In theory we can pool then though in practice I'll start doing this only if I have convincing numbers
👍 |
we will need to port this to release-1.7 |
Just curious, what is the VSCode regression? |
@zhengbli code in VSCode that read data from the stdout of the |
@vladima got it. Thanks for the explanation! Though I need to test the fix on a OSX machine, which I don't have at hand. I'll test it when I get back to office tomorrow evening. |
let's get this in first as this is blocking VSCode, and then we can update the fix if the original issue was not fixed. |
reasonable. If this fix works for vscode on windows, mac, and Linux then 👍 |
use process.stdout.write on server instead of fs.write
Confirmed the fix works on both Mac and Windows for sublime text. |
fixes VSCode regression introduced in #5354.
pinging @zhengbli, can you check if this solution still solves #2758 and microsoft/TypeScript-Sublime-Plugin#379