()
| 137 | this.scheduleFlushOpenQueuedFiles = flushOpenQueuedFiles; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | initialize(): void { |
| 142 | const tsConfigCompilerOptions = this.project.compilerOptions; |
| 143 | // Doing this to make sure we automatically "open" any files referred to in |
| 144 | // tsconfig.compilerOptions.types _if they are present_. |
| 145 | // |
| 146 | // Note: we seem to be using tsconfig.compilerOptions.types in a _very_ |
| 147 | // unexpected way (see docs: https://www.typescriptlang.org/tsconfig#types) |
| 148 | // |
| 149 | // It seems likely that the fact that this lets us make Long.d.ts available globally |
| 150 | // is accidental. |
| 151 | const typesFiles = tsConfigCompilerOptions.types ?? []; |
| 152 | const basePath = (tsConfigCompilerOptions.typeRoots ?? [''])[0]; |
| 153 | const presentTypesFiles = typesFiles |
| 154 | .map((unresolvedTypesFilePath) => path.resolve(basePath, unresolvedTypesFilePath + '.d.ts')) |
| 155 | .filter((f) => this.project.fileExists(f)); |
| 156 | |
| 157 | presentTypesFiles.forEach((typesFilePath) => this.doOpenFile(typesFilePath)); |
| 158 | this.initialized = true; |
| 159 | } |
| 160 |
nothing calls this directly
no test coverage detected