Skip to content

Commit a81f264

Browse files
authored
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.
1 parent a49e83f commit a81f264

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/compiler/tsc.ts

+4
Original file line numberDiff line numberDiff line change
@@ -399,4 +399,8 @@ if (ts.Debug.isDebugging) {
399399
if (ts.sys.tryEnableSourceMapsForHost && /^development$/i.test(ts.sys.getEnvironmentVariable("NODE_ENV"))) {
400400
ts.sys.tryEnableSourceMapsForHost();
401401
}
402+
declare var process: any;
403+
if (process && process.stdout && process.stdout._handle && process.stdout._handle.setBlocking) {
404+
process.stdout._handle.setBlocking(true);
405+
}
402406
ts.executeCommandLine(ts.sys.args);

src/server/server.ts

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

0 commit comments

Comments
 (0)