(sourceFile: ts.SourceFile)
| 75 | const printer = createPrinter(plugins.map(p => p.printer).filter(isNonNull)); |
| 76 | |
| 77 | const processSourceFile = (sourceFile: ts.SourceFile) => { |
| 78 | if (options.tstlVerbose) { |
| 79 | console.log(`Transforming ${sourceFile.fileName}`); |
| 80 | } |
| 81 | |
| 82 | performance.startSection("transpile"); |
| 83 | |
| 84 | const { file, diagnostics: transformDiagnostics } = transformSourceFile(program, sourceFile, visitorMap); |
| 85 | diagnostics.push(...transformDiagnostics); |
| 86 | |
| 87 | performance.endSection("transpile"); |
| 88 | |
| 89 | if (!options.noEmit && !options.emitDeclarationOnly) { |
| 90 | performance.startSection("print"); |
| 91 | if (options.tstlVerbose) { |
| 92 | console.log(`Printing ${sourceFile.fileName}`); |
| 93 | } |
| 94 | |
| 95 | const printResult = printer(program, emitHost, sourceFile.fileName, file); |
| 96 | transpiledFiles.push({ |
| 97 | sourceFiles: [sourceFile], |
| 98 | fileName: path.normalize(sourceFile.fileName), |
| 99 | luaAst: file, |
| 100 | ...printResult, |
| 101 | }); |
| 102 | performance.endSection("print"); |
| 103 | } |
| 104 | }; |
| 105 | |
| 106 | const transformers = getTransformers(program, diagnostics, customTransformers, processSourceFile); |
| 107 |
no test coverage detected