()
| 126 | } |
| 127 | |
| 128 | loadProgramIfNeeded(): ts.Program { |
| 129 | if (!this.currentProgram || this.programDirty) { |
| 130 | this.updatingProgram = true; |
| 131 | |
| 132 | const oldProgram = this.currentProgram; |
| 133 | |
| 134 | this.listener?.onProgramWillChange(); |
| 135 | |
| 136 | this.currentProgram = ts.createProgram( |
| 137 | this.sourceFileManager.getScriptFileNames(), |
| 138 | this.compilerOptions, |
| 139 | new CompilerHost(this.fileManager, this.sourceFileManager), |
| 140 | oldProgram, |
| 141 | ); |
| 142 | |
| 143 | this.updatingProgram = false; |
| 144 | this.programDirty = false; |
| 145 | |
| 146 | this.listener?.onProgramChanged(); |
| 147 | } |
| 148 | |
| 149 | return this.currentProgram; |
| 150 | } |
| 151 | |
| 152 | private setProgramDirty(): void { |
| 153 | if (!this.updatingProgram) { |
no test coverage detected