Call process.stdout._handle.setBlocking(true) (#22389)

* Call process.stdout._handle.setBlocking(true)

This prevents output from being truncated when the compiler can output
errors to stdout faster than it can receive them. This may slow down
performance for compilations for many errors, but those were already
quite slow.

* Disable tslint no-unnnecessary-type-assertion-2

It is wrong. It *is* necessary.
This commit is contained in:
Nathan Shively-Sanders 2018-03-08 12:38:30 -08:00 committed by GitHub
parent a49e83ffa7
commit a81f264d70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -399,4 +399,8 @@ if (ts.Debug.isDebugging) {
if (ts.sys.tryEnableSourceMapsForHost && /^development$/i.test(ts.sys.getEnvironmentVariable("NODE_ENV"))) {
ts.sys.tryEnableSourceMapsForHost();
}
declare var process: any;
if (process && process.stdout && process.stdout._handle && process.stdout._handle.setBlocking) {
process.stdout._handle.setBlocking(true);
}
ts.executeCommandLine(ts.sys.args);

View File

@ -991,6 +991,7 @@ namespace ts.server {
ioSession.logError(err, "unknown");
});
// See https://github.com/Microsoft/TypeScript/issues/11348
// tslint:disable-next-line no-unnecessary-type-assertion-2
(process as any).noAsar = true;
// Start listening
ioSession.listen();