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 authored and GitHub committed 2018-03-08 12:38:30 -08:00
1 parent a49e83ffa7
commit a81f264d70
2 files changed
+5

No files matched your search

+4
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);
+1
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();