@@ -287,8 +287,8 @@ export abstract class BackgroundAnalysisRunnerBase extends BackgroundThreadBase
287
287
private _configOptions : ConfigOptions ;
288
288
private _program : Program ;
289
289
290
- protected _importResolver : ImportResolver ;
291
- protected _logTracker : LogTracker ;
290
+ protected importResolver : ImportResolver ;
291
+ protected logTracker : LogTracker ;
292
292
293
293
protected constructor ( ) {
294
294
super ( workerData as InitializationData ) ;
@@ -298,12 +298,12 @@ export abstract class BackgroundAnalysisRunnerBase extends BackgroundThreadBase
298
298
this . log ( LogLevel . Info , `Background analysis(${ threadId } ) root directory: ${ data . rootDirectory } ` ) ;
299
299
300
300
this . _configOptions = new ConfigOptions ( data . rootDirectory ) ;
301
- this . _importResolver = this . createImportResolver ( this . fs , this . _configOptions , this . createHost ( ) ) ;
301
+ this . importResolver = this . createImportResolver ( this . fs , this . _configOptions , this . createHost ( ) ) ;
302
302
303
303
const console = this . getConsole ( ) ;
304
- this . _logTracker = new LogTracker ( console , `BG(${ threadId } )` ) ;
304
+ this . logTracker = new LogTracker ( console , `BG(${ threadId } )` ) ;
305
305
306
- this . _program = new Program ( this . _importResolver , this . _configOptions , console , this . _logTracker ) ;
306
+ this . _program = new Program ( this . importResolver , this . _configOptions , console , this . logTracker ) ;
307
307
308
308
// Create the extensions bound to the program for this background thread
309
309
Extensions . createProgramExtensions ( this . _program , {
@@ -391,22 +391,18 @@ export abstract class BackgroundAnalysisRunnerBase extends BackgroundThreadBase
391
391
}
392
392
393
393
case 'setImportResolver' : {
394
- this . _importResolver = this . createImportResolver ( this . fs , this . _configOptions , this . createHost ( ) ) ;
394
+ this . importResolver = this . createImportResolver ( this . fs , this . _configOptions , this . createHost ( ) ) ;
395
395
396
- this . program . setImportResolver ( this . _importResolver ) ;
396
+ this . program . setImportResolver ( this . importResolver ) ;
397
397
break ;
398
398
}
399
399
400
400
case 'setConfigOptions' : {
401
401
this . _configOptions = createConfigOptionsFrom ( msg . data ) ;
402
402
403
- this . _importResolver = this . createImportResolver (
404
- this . fs ,
405
- this . _configOptions ,
406
- this . _importResolver . host
407
- ) ;
403
+ this . importResolver = this . createImportResolver ( this . fs , this . _configOptions , this . importResolver . host ) ;
408
404
this . program . setConfigOptions ( this . _configOptions ) ;
409
- this . program . setImportResolver ( this . _importResolver ) ;
405
+ this . program . setImportResolver ( this . importResolver ) ;
410
406
break ;
411
407
}
412
408
@@ -425,7 +421,7 @@ export abstract class BackgroundAnalysisRunnerBase extends BackgroundThreadBase
425
421
const { executionRoot } = msg . data ;
426
422
const execEnv = this . _configOptions . getExecutionEnvironments ( ) . find ( ( e ) => e . root === executionRoot ) ;
427
423
if ( execEnv ) {
428
- this . _importResolver . ensurePartialStubPackages ( execEnv ) ;
424
+ this . importResolver . ensurePartialStubPackages ( execEnv ) ;
429
425
}
430
426
break ;
431
427
}
@@ -470,7 +466,7 @@ export abstract class BackgroundAnalysisRunnerBase extends BackgroundThreadBase
470
466
case 'invalidateAndForceReanalysis' : {
471
467
// Make sure the import resolver doesn't have invalid
472
468
// cached entries.
473
- this . _importResolver . invalidateCache ( ) ;
469
+ this . importResolver . invalidateCache ( ) ;
474
470
475
471
// Mark all files with one or more errors dirty.
476
472
this . program . markAllFilesDirty ( /* evenIfContentsAreSame */ true , /* indexingNeeded */ msg . data ) ;
@@ -479,12 +475,8 @@ export abstract class BackgroundAnalysisRunnerBase extends BackgroundThreadBase
479
475
480
476
case 'restart' : {
481
477
// recycle import resolver
482
- this . _importResolver = this . createImportResolver (
483
- this . fs ,
484
- this . _configOptions ,
485
- this . _importResolver . host
486
- ) ;
487
- this . program . setImportResolver ( this . _importResolver ) ;
478
+ this . importResolver = this . createImportResolver ( this . fs , this . _configOptions , this . importResolver . host ) ;
479
+ this . program . setImportResolver ( this . importResolver ) ;
488
480
break ;
489
481
}
490
482
0 commit comments