mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
Add support for extraFileExtensions on WatchCompilerHost (#37726)
To support typescript-eslint/typescript-eslint#1813
This commit is contained in:
@@ -566,45 +566,43 @@ namespace ts {
|
||||
}
|
||||
|
||||
function createWatchOfConfigFile(
|
||||
sys: System,
|
||||
system: System,
|
||||
cb: ExecuteCommandLineCallbacks,
|
||||
reportDiagnostic: DiagnosticReporter,
|
||||
configParseResult: ParsedCommandLine,
|
||||
optionsToExtend: CompilerOptions,
|
||||
watchOptionsToExtend: WatchOptions | undefined,
|
||||
) {
|
||||
const watchCompilerHost = createWatchCompilerHostOfConfigFile(
|
||||
configParseResult.options.configFilePath!,
|
||||
const watchCompilerHost = createWatchCompilerHostOfConfigFile({
|
||||
configFileName: configParseResult.options.configFilePath!,
|
||||
optionsToExtend,
|
||||
watchOptionsToExtend,
|
||||
sys,
|
||||
/*createProgram*/ undefined,
|
||||
system,
|
||||
reportDiagnostic,
|
||||
createWatchStatusReporter(sys, configParseResult.options)
|
||||
); // TODO: GH#18217
|
||||
updateWatchCompilationHost(sys, cb, watchCompilerHost);
|
||||
reportWatchStatus: createWatchStatusReporter(system, configParseResult.options)
|
||||
});
|
||||
updateWatchCompilationHost(system, cb, watchCompilerHost);
|
||||
watchCompilerHost.configFileParsingResult = configParseResult;
|
||||
return createWatchProgram(watchCompilerHost);
|
||||
}
|
||||
|
||||
function createWatchOfFilesAndCompilerOptions(
|
||||
sys: System,
|
||||
system: System,
|
||||
cb: ExecuteCommandLineCallbacks,
|
||||
reportDiagnostic: DiagnosticReporter,
|
||||
rootFiles: string[],
|
||||
options: CompilerOptions,
|
||||
watchOptions: WatchOptions | undefined,
|
||||
) {
|
||||
const watchCompilerHost = createWatchCompilerHostOfFilesAndCompilerOptions(
|
||||
const watchCompilerHost = createWatchCompilerHostOfFilesAndCompilerOptions({
|
||||
rootFiles,
|
||||
options,
|
||||
watchOptions,
|
||||
sys,
|
||||
/*createProgram*/ undefined,
|
||||
system,
|
||||
reportDiagnostic,
|
||||
createWatchStatusReporter(sys, options)
|
||||
);
|
||||
updateWatchCompilationHost(sys, cb, watchCompilerHost);
|
||||
reportWatchStatus: createWatchStatusReporter(system, options)
|
||||
});
|
||||
updateWatchCompilationHost(system, cb, watchCompilerHost);
|
||||
return createWatchProgram(watchCompilerHost);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user