(configOptions: ConfigOptions, importMap: ImportMap)
| 384 | } |
| 385 | |
| 386 | doTypeAnalysis(configOptions: ConfigOptions, importMap: ImportMap) { |
| 387 | assert(!this.isParseRequired()); |
| 388 | assert(!this.isSemanticAnalysisRequired()); |
| 389 | assert(this.isTypeAnalysisRequired()); |
| 390 | assert(this._analysisJob.parseResults); |
| 391 | assert(this._analysisJob.nextPhaseToRun === AnalysisPhase.TypeAnalysis); |
| 392 | |
| 393 | const fileInfo = this._buildFileInfo(configOptions, importMap, undefined); |
| 394 | |
| 395 | try { |
| 396 | // Perform static type analysis. |
| 397 | let typeAnalyzer = new TypeAnalyzer(this._analysisJob.parseResults!.parseTree, |
| 398 | fileInfo, this._analysisJob.typeAnalysisPassNumber); |
| 399 | this._analysisJob.typeAnalysisPassNumber++; |
| 400 | |
| 401 | timingStats.typeAnalyzerTime.timeOperation(() => { |
| 402 | // Repeatedly call the analyzer until everything converges. |
| 403 | this._analysisJob.isTypeAnalysisPassNeeded = typeAnalyzer.analyze(); |
| 404 | this._analysisJob.typeAnalysisLastPassDiagnostics = fileInfo.diagnosticSink.diagnostics; |
| 405 | }); |
| 406 | } catch (e) { |
| 407 | let message: string; |
| 408 | if (e instanceof Error) { |
| 409 | message = e.message; |
| 410 | } else { |
| 411 | message = JSON.stringify(e); |
| 412 | } |
| 413 | |
| 414 | this._console.log( |
| 415 | `An internal error occurred while analyzing ${ this.getFilePath() }: ` + message); |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | // This method should be called once type analysis has completed for |
| 420 | // this file and all of its dependent files. |
no test coverage detected