From ec1df954a516458e7563980fc72288a46280cbd2 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 7 Mar 2018 14:17:04 -0800 Subject: [PATCH 1/2] 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. --- src/compiler/tsc.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 245d5c2219cf3..3a340f049f862 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -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); From 1fec40a2eec4e73b7f896fdb58e4e9412c2cb931 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 8 Mar 2018 11:32:31 -0800 Subject: [PATCH 2/2] Disable tslint no-unnnecessary-type-assertion-2 It is wrong. It *is* necessary. --- src/server/server.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/server.ts b/src/server/server.ts index f70280c34a3de..2529008c1656b 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -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();