import { Worker } from 'worker_threads' ; import { ImportResolver } from './analyzer/importResolver' ; import { BackgroundAnalysisBase , BackgroundAnalysisRunnerBase } from './backgroundAnalysisBase' ; import { InitializationData } from './backgroundThreadBase' ; import { getCancellationFolderName } from './common/cancellationUtils' ; import { ConfigOptions } from './common/configOptions' ; import { ConsoleInterface } from './common/console' ; import { FileSystem } from './common/fileSystem' ; import { FullAccessHost } from './common/fullAccessHost' ; import { Host } from './common/host' ; export class BackgroundAnalysis extends BackgroundAnalysisBase { constructor ( console ) { super ( console ) ; const initialData = { rootDirectory : ( global as any ) . __rootDirectory as string , cancellationFolderName : getCancellationFolderName ( ) , runner : undefined , } ; const worker = new Worker ( __filename , { workerData : initialData } ) ; this . setup ( worker ) ; } } export class BackgroundAnalysisRunner extends BackgroundAnalysisRunnerBase { constructor ( ) { super ( ) ; } protected override createHost ( ) { return new FullAccessHost ( this . fs ) ; } protected override createImportResolver ( fs , options , host ) { return new ImportResolver ( fs , options , host ) ; } }