MCPcopy Index your code
hub / github.com/nodejs/node / createWatchCompilerHost

Function createWatchCompilerHost

test/fixtures/snapshot/typescript.js:123221–123232  ·  view source on GitHub ↗

* Creates the watch compiler host that can be extended with config file or root file names and options host

(system, createProgram, reportDiagnostic, reportWatchStatus)

Source from the content-addressed store, hash-verified

123219 * Creates the watch compiler host that can be extended with config file or root file names and options host
123220 */
123221 function createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus) {
123222 if (system === void 0) { system = ts.sys; }
123223 var write = function (s) { return system.write(s + system.newLine); };
123224 var result = createProgramHost(system, createProgram);
123225 ts.copyProperties(result, createWatchHost(system, reportWatchStatus));
123226 result.afterProgramCreate = function (builderProgram) {
123227 var compilerOptions = builderProgram.getCompilerOptions();
123228 var newLine = ts.getNewLineCharacter(compilerOptions, function () { return system.newLine; });
123229 emitFilesAndReportErrors(builderProgram, reportDiagnostic, write, function (errorCount) { return result.onWatchStatusChange(ts.createCompilerDiagnostic(getWatchErrorSummaryDiagnosticMessage(errorCount), errorCount), newLine, compilerOptions, errorCount); });
123230 };
123231 return result;
123232 }
123233 /**
123234 * Report error and exit
123235 */

Calls 4

createProgramHostFunction · 0.85
createWatchHostFunction · 0.85
emitFilesAndReportErrorsFunction · 0.85

Tested by

no test coverage detected