* Creates the watch compiler host that can be extended with config file or root file names and options host
(system, createProgram, reportDiagnostic, reportWatchStatus)
| 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 | */ |
no test coverage detected