diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 33d8322c2afbe..d286eaf3118a0 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1463,7 +1463,8 @@ namespace ts { optionsToExtend: CompilerOptions, host: ParseConfigFileHost, extendedConfigCache?: Map, - watchOptionsToExtend?: WatchOptions + watchOptionsToExtend?: WatchOptions, + extraFileExtensions?: readonly FileExtensionInfo[], ): ParsedCommandLine | undefined { const configFileText = tryReadFile(configFileName, fileName => host.readFile(fileName)); if (!isString(configFileText)) { @@ -1483,7 +1484,7 @@ namespace ts { optionsToExtend, getNormalizedAbsolutePath(configFileName, cwd), /*resolutionStack*/ undefined, - /*extraFileExtension*/ undefined, + extraFileExtensions, extendedConfigCache, watchOptionsToExtend ); diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 2eb32e240528a..c9e428468e579 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -413,23 +413,49 @@ namespace ts { system.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); } + export interface CreateWatchCompilerHostInput { + system: System; + createProgram?: CreateProgram; + reportDiagnostic?: DiagnosticReporter; + reportWatchStatus?: WatchStatusReporter; + } + + export interface CreateWatchCompilerHostOfConfigFileInput extends CreateWatchCompilerHostInput { + configFileName: string; + optionsToExtend?: CompilerOptions; + watchOptionsToExtend?: WatchOptions; + extraFileExtensions?: readonly FileExtensionInfo[]; + } /** * Creates the watch compiler host from system for config file in watch mode */ - export function createWatchCompilerHostOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions | undefined, watchOptionsToExtend: WatchOptions | undefined, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): WatchCompilerHostOfConfigFile { + export function createWatchCompilerHostOfConfigFile({ + configFileName, optionsToExtend, watchOptionsToExtend, extraFileExtensions, + system, createProgram, reportDiagnostic, reportWatchStatus + }: CreateWatchCompilerHostOfConfigFileInput): WatchCompilerHostOfConfigFile { const diagnosticReporter = reportDiagnostic || createDiagnosticReporter(system); const host = createWatchCompilerHost(system, createProgram, diagnosticReporter, reportWatchStatus) as WatchCompilerHostOfConfigFile; host.onUnRecoverableConfigFileDiagnostic = diagnostic => reportUnrecoverableDiagnostic(system, diagnosticReporter, diagnostic); host.configFileName = configFileName; host.optionsToExtend = optionsToExtend; host.watchOptionsToExtend = watchOptionsToExtend; + host.extraFileExtensions = extraFileExtensions; return host; } + export interface CreateWatchCompilerHostOfFilesAndCompilerOptionsInput extends CreateWatchCompilerHostInput { + rootFiles: string[]; + options: CompilerOptions; + watchOptions: WatchOptions | undefined; + projectReferences?: readonly ProjectReference[]; + } /** * Creates the watch compiler host from system for compiling root files and options in watch mode */ - export function createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles: string[], options: CompilerOptions, watchOptions: WatchOptions | undefined, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, projectReferences?: readonly ProjectReference[]): WatchCompilerHostOfFilesAndCompilerOptions { + export function createWatchCompilerHostOfFilesAndCompilerOptions({ + rootFiles, options, watchOptions, projectReferences, + system, createProgram, reportDiagnostic, reportWatchStatus + }: CreateWatchCompilerHostOfFilesAndCompilerOptionsInput): WatchCompilerHostOfFilesAndCompilerOptions { const host = createWatchCompilerHost(system, createProgram, reportDiagnostic || createDiagnosticReporter(system), reportWatchStatus) as WatchCompilerHostOfFilesAndCompilerOptions; host.rootFiles = rootFiles; host.options = options; diff --git a/src/compiler/watchPublic.ts b/src/compiler/watchPublic.ts index f8aa32188bbcd..d7b9f3b058795 100644 --- a/src/compiler/watchPublic.ts +++ b/src/compiler/watchPublic.ts @@ -149,6 +149,8 @@ namespace ts { watchOptionsToExtend?: WatchOptions; + extraFileExtensions?: readonly FileExtensionInfo[] + /** * Used to generate source file names from the config file and its include, exclude, files rules * and also to cache the directory stucture @@ -191,14 +193,32 @@ namespace ts { /** * Create the watch compiler host for either configFile or fileNames and its options */ - export function createWatchCompilerHost(configFileName: string, optionsToExtend: CompilerOptions | undefined, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, watchOptionsToExtend?: WatchOptions): WatchCompilerHostOfConfigFile; + export function createWatchCompilerHost(configFileName: string, optionsToExtend: CompilerOptions | undefined, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): WatchCompilerHostOfConfigFile; export function createWatchCompilerHost(rootFiles: string[], options: CompilerOptions, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, projectReferences?: readonly ProjectReference[], watchOptions?: WatchOptions): WatchCompilerHostOfFilesAndCompilerOptions; - export function createWatchCompilerHost(rootFilesOrConfigFileName: string | string[], options: CompilerOptions | undefined, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, projectReferencesOrWatchOptionsToExtend?: readonly ProjectReference[] | WatchOptions, watchOptions?: WatchOptions): WatchCompilerHostOfFilesAndCompilerOptions | WatchCompilerHostOfConfigFile { + export function createWatchCompilerHost(rootFilesOrConfigFileName: string | string[], options: CompilerOptions | undefined, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, projectReferencesOrWatchOptionsToExtend?: readonly ProjectReference[] | WatchOptions, watchOptionsOrExtraFileExtensions?: WatchOptions | readonly FileExtensionInfo[]): WatchCompilerHostOfFilesAndCompilerOptions | WatchCompilerHostOfConfigFile { if (isArray(rootFilesOrConfigFileName)) { - return createWatchCompilerHostOfFilesAndCompilerOptions(rootFilesOrConfigFileName, options!, watchOptions, system, createProgram, reportDiagnostic, reportWatchStatus, projectReferencesOrWatchOptionsToExtend as readonly ProjectReference[]); // TODO: GH#18217 + return createWatchCompilerHostOfFilesAndCompilerOptions({ + rootFiles: rootFilesOrConfigFileName, + options: options!, + watchOptions: watchOptionsOrExtraFileExtensions as WatchOptions, + projectReferences: projectReferencesOrWatchOptionsToExtend as readonly ProjectReference[], + system, + createProgram, + reportDiagnostic, + reportWatchStatus, + }); } else { - return createWatchCompilerHostOfConfigFile(rootFilesOrConfigFileName, options, projectReferencesOrWatchOptionsToExtend as WatchOptions, system, createProgram, reportDiagnostic, reportWatchStatus); + return createWatchCompilerHostOfConfigFile({ + configFileName: rootFilesOrConfigFileName, + optionsToExtend: options, + watchOptionsToExtend: projectReferencesOrWatchOptionsToExtend as WatchOptions, + extraFileExtensions: watchOptionsOrExtraFileExtensions as readonly FileExtensionInfo[], + system, + createProgram, + reportDiagnostic, + reportWatchStatus, + }); } } @@ -237,7 +257,7 @@ namespace ts { const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); const currentDirectory = host.getCurrentDirectory(); - const { configFileName, optionsToExtend: optionsToExtendForConfigFile = {}, watchOptionsToExtend, createProgram } = host; + const { configFileName, optionsToExtend: optionsToExtendForConfigFile = {}, watchOptionsToExtend, extraFileExtensions, createProgram } = host; let { rootFiles: rootFileNames, options: compilerOptions, watchOptions, projectReferences } = host; let configFileSpecs: ConfigFileSpecs; let configFileParsingDiagnostics: Diagnostic[] | undefined; @@ -614,7 +634,7 @@ namespace ts { } function parseConfigFile() { - setConfigFileParsingResult(getParsedCommandLineOfConfigFile(configFileName, optionsToExtendForConfigFile, parseConfigFileHost, /*extendedConfigCache*/ undefined, watchOptionsToExtend)!); // TODO: GH#18217 + setConfigFileParsingResult(getParsedCommandLineOfConfigFile(configFileName, optionsToExtendForConfigFile, parseConfigFileHost, /*extendedConfigCache*/ undefined, watchOptionsToExtend, extraFileExtensions)!); // TODO: GH#18217 } function setConfigFileParsingResult(configFileParseResult: ParsedCommandLine) { diff --git a/src/executeCommandLine/executeCommandLine.ts b/src/executeCommandLine/executeCommandLine.ts index 7d5b434b8e684..96cf7e5f04452 100644 --- a/src/executeCommandLine/executeCommandLine.ts +++ b/src/executeCommandLine/executeCommandLine.ts @@ -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); } diff --git a/src/testRunner/unittests/reuseProgramStructure.ts b/src/testRunner/unittests/reuseProgramStructure.ts index bcc8a12adf6fb..562e76c181b8b 100644 --- a/src/testRunner/unittests/reuseProgramStructure.ts +++ b/src/testRunner/unittests/reuseProgramStructure.ts @@ -937,12 +937,20 @@ namespace ts { } function verifyProgramWithoutConfigFile(system: System, rootFiles: string[], options: CompilerOptions) { - const program = createWatchProgram(createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, /*watchOptions*/ undefined, system)).getCurrentProgram().getProgram(); + const program = createWatchProgram(createWatchCompilerHostOfFilesAndCompilerOptions({ + rootFiles, + options, + watchOptions: undefined, + system + })).getCurrentProgram().getProgram(); verifyProgramIsUptoDate(program, duplicate(rootFiles), duplicate(options)); } function verifyProgramWithConfigFile(system: System, configFileName: string) { - const program = createWatchProgram(createWatchCompilerHostOfConfigFile(configFileName, {}, /*watchOptionsToExtend*/ undefined, system)).getCurrentProgram().getProgram(); + const program = createWatchProgram(createWatchCompilerHostOfConfigFile({ + configFileName, + system + })).getCurrentProgram().getProgram(); const { fileNames, options } = parseConfigFileWithSystem(configFileName, {}, /*watchOptionsToExtend*/ undefined, system, notImplemented)!; // TODO: GH#18217 verifyProgramIsUptoDate(program, fileNames, options); } @@ -1081,7 +1089,12 @@ namespace ts { const rootFiles = [module1.path, module2.path, module3.path]; const system = createTestSystem([module1, module2, module3]); const options = {}; - const program = createWatchProgram(createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, /*watchOptions*/ undefined, system)).getCurrentProgram().getProgram(); + const program = createWatchProgram(createWatchCompilerHostOfFilesAndCompilerOptions({ + rootFiles, + options, + watchOptions: undefined, + system + })).getCurrentProgram().getProgram(); verifyProgramIsUptoDate(program, duplicate(rootFiles), duplicate(options)); }); @@ -1112,7 +1125,12 @@ namespace ts { const newRootFiles = [module1.path, module2.path, module3.path]; const system = createTestSystem([module1, module2, module3]); const options = {}; - const program = createWatchProgram(createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, /*watchOptions*/ undefined, system)).getCurrentProgram().getProgram(); + const program = createWatchProgram(createWatchCompilerHostOfFilesAndCompilerOptions({ + rootFiles, + options, + watchOptions: undefined, + system + })).getCurrentProgram().getProgram(); verifyProgramIsNotUptoDate(program, duplicate(newRootFiles), duplicate(options)); }); it("has one root file replaced by another", () => { @@ -1132,7 +1150,12 @@ namespace ts { const newRootFiles = [module2.path, module3.path]; const system = createTestSystem([module1, module2, module3]); const options = {}; - const program = createWatchProgram(createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, /*watchOptions*/ undefined, system)).getCurrentProgram().getProgram(); + const program = createWatchProgram(createWatchCompilerHostOfFilesAndCompilerOptions({ + rootFiles, + options, + watchOptions: undefined, + system + })).getCurrentProgram().getProgram(); verifyProgramIsNotUptoDate(program, duplicate(newRootFiles), duplicate(options)); }); }); diff --git a/src/testRunner/unittests/tscWatch/helpers.ts b/src/testRunner/unittests/tscWatch/helpers.ts index e2634153378a6..f778c98cedf34 100644 --- a/src/testRunner/unittests/tscWatch/helpers.ts +++ b/src/testRunner/unittests/tscWatch/helpers.ts @@ -33,13 +33,13 @@ namespace ts.tscWatch { export type Watch = WatchOfConfigFile | WatchOfFilesAndCompilerOptions; - export function createWatchOfConfigFile(configFileName: string, host: WatchedSystem, optionsToExtend?: CompilerOptions, watchOptionsToExtend?: WatchOptions) { - const compilerHost = createWatchCompilerHostOfConfigFile(configFileName, optionsToExtend || {}, watchOptionsToExtend, host); + export function createWatchOfConfigFile(configFileName: string, system: WatchedSystem, optionsToExtend?: CompilerOptions, watchOptionsToExtend?: WatchOptions) { + const compilerHost = createWatchCompilerHostOfConfigFile({ configFileName, optionsToExtend, watchOptionsToExtend, system }); return createWatchProgram(compilerHost); } - export function createWatchOfFilesAndCompilerOptions(rootFiles: string[], host: WatchedSystem, options: CompilerOptions = {}, watchOptions?: WatchOptions) { - const compilerHost = createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, watchOptions, host); + export function createWatchOfFilesAndCompilerOptions(rootFiles: string[], system: WatchedSystem, options: CompilerOptions = {}, watchOptions?: WatchOptions) { + const compilerHost = createWatchCompilerHostOfFilesAndCompilerOptions({ rootFiles, options, watchOptions, system }); return createWatchProgram(compilerHost); } diff --git a/src/testRunner/unittests/tscWatch/sourceOfProjectReferenceRedirect.ts b/src/testRunner/unittests/tscWatch/sourceOfProjectReferenceRedirect.ts index d293602f4a791..4a831626e4e22 100644 --- a/src/testRunner/unittests/tscWatch/sourceOfProjectReferenceRedirect.ts +++ b/src/testRunner/unittests/tscWatch/sourceOfProjectReferenceRedirect.ts @@ -17,7 +17,10 @@ namespace ts.tscWatch { solutionBuilder.close(); sys.clearOutput(); } - const host = createWatchCompilerHostOfConfigFile(config, {}, /*watchOptionsToExtend*/ undefined, sys); + const host = createWatchCompilerHostOfConfigFile({ + configFileName: config, + system: sys + }); host.useSourceOfProjectReferenceRedirect = returnTrue; const watch = createWatchProgram(host); checkProgramActualFiles(watch.getCurrentProgram().getProgram(), expectedProgramFiles); diff --git a/src/testRunner/unittests/tscWatch/watchApi.ts b/src/testRunner/unittests/tscWatch/watchApi.ts index 8d33825fa7461..6dcf1b30f7b35 100644 --- a/src/testRunner/unittests/tscWatch/watchApi.ts +++ b/src/testRunner/unittests/tscWatch/watchApi.ts @@ -20,7 +20,10 @@ namespace ts.tscWatch { it("verify that module resolution with json extension works when returned without extension", () => { const files = [libFile, mainFile, config, settingsJson]; const host = createWatchedSystem(files, { currentDirectory: projectRoot }); - const compilerHost = createWatchCompilerHostOfConfigFile(config.path, {}, /*watchOptionsToExtend*/ undefined, host); + const compilerHost = createWatchCompilerHostOfConfigFile({ + configFileName: config.path, + system: host + }); const parsedCommandResult = parseJsonConfigFileContent(configFileJson, host, config.path); compilerHost.resolveModuleNames = (moduleNames, containingFile) => moduleNames.map(m => { const result = resolveModuleName(m, containingFile, parsedCommandResult.options, compilerHost); @@ -58,7 +61,11 @@ namespace ts.tscWatch { const reportWatchStatus: WatchStatusReporter = (_, __, ___, errorCount) => { watchedErrorCount = errorCount; }; - const compilerHost = createWatchCompilerHostOfConfigFile(config.path, {}, /*watchOptionsToExtend*/ undefined, host, /*createProgram*/ undefined, /*reportDiagnostic*/ undefined, reportWatchStatus); + const compilerHost = createWatchCompilerHostOfConfigFile({ + configFileName: config.path, + system: host, + reportWatchStatus + }); createWatchProgram(compilerHost); assert.equal(watchedErrorCount, 2, "The error count was expected to be 2 for the file change"); }); @@ -86,4 +93,34 @@ namespace ts.tscWatch { checkProgramActualFiles(watch.getProgram().getProgram(), [mainFile.path, barPath, libFile.path]); }); }); + + describe("unittests:: tsc-watch:: watchAPI:: when watchHost can add extraFileExtensions to process", () => { + it("verifies that extraFileExtensions are supported to get the program with other extensions", () => { + const config: File = { + path: `${projectRoot}/tsconfig.json`, + content: "{}" + }; + const mainFile: File = { + path: `${projectRoot}/main.ts`, + content: "const x = 10;" + }; + const otherFile: File = { + path: `${projectRoot}/other.vue`, + content: "" + }; + const sys = createWatchedSystem([config, mainFile, otherFile, libFile]); + const watchCompilerHost = createWatchCompilerHost( + config.path, + { allowNonTsExtensions: true }, + sys, + /*createProgram*/ undefined, + /*reportDiagnostics*/ undefined, + /*reportWatchStatus*/ undefined, + /*watchOptionsToExtend*/ undefined, + [{ extension: ".vue", isMixedContent: true, scriptKind: ScriptKind.Deferred }] + ); + const watch = createWatchProgram(watchCompilerHost); + checkProgramActualFiles(watch.getProgram().getProgram(), [mainFile.path, otherFile.path, libFile.path]); + }); + }); } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 545fac4f8a159..0ba337629e70b 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -3860,7 +3860,7 @@ declare namespace ts { /** * Reads the config file, reports errors if any and exits if the config file cannot be found */ - export function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost, extendedConfigCache?: Map, watchOptionsToExtend?: WatchOptions): ParsedCommandLine | undefined; + export function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost, extendedConfigCache?: Map, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): ParsedCommandLine | undefined; /** * Read tsconfig.json file * @param fileName The path to the config file @@ -4785,6 +4785,7 @@ declare namespace ts { /** Options to extend */ optionsToExtend?: CompilerOptions; watchOptionsToExtend?: WatchOptions; + extraFileExtensions?: readonly FileExtensionInfo[]; /** * Used to generate source file names from the config file and its include, exclude, files rules * and also to cache the directory stucture @@ -4812,7 +4813,7 @@ declare namespace ts { /** * Create the watch compiler host for either configFile or fileNames and its options */ - function createWatchCompilerHost(configFileName: string, optionsToExtend: CompilerOptions | undefined, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, watchOptionsToExtend?: WatchOptions): WatchCompilerHostOfConfigFile; + function createWatchCompilerHost(configFileName: string, optionsToExtend: CompilerOptions | undefined, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): WatchCompilerHostOfConfigFile; function createWatchCompilerHost(rootFiles: string[], options: CompilerOptions, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, projectReferences?: readonly ProjectReference[], watchOptions?: WatchOptions): WatchCompilerHostOfFilesAndCompilerOptions; /** * Creates the watch from the host for root files and compiler options diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 45bb3f9913c8d..06e81bd224a91 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -3860,7 +3860,7 @@ declare namespace ts { /** * Reads the config file, reports errors if any and exits if the config file cannot be found */ - export function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost, extendedConfigCache?: Map, watchOptionsToExtend?: WatchOptions): ParsedCommandLine | undefined; + export function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost, extendedConfigCache?: Map, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): ParsedCommandLine | undefined; /** * Read tsconfig.json file * @param fileName The path to the config file @@ -4785,6 +4785,7 @@ declare namespace ts { /** Options to extend */ optionsToExtend?: CompilerOptions; watchOptionsToExtend?: WatchOptions; + extraFileExtensions?: readonly FileExtensionInfo[]; /** * Used to generate source file names from the config file and its include, exclude, files rules * and also to cache the directory stucture @@ -4812,7 +4813,7 @@ declare namespace ts { /** * Create the watch compiler host for either configFile or fileNames and its options */ - function createWatchCompilerHost(configFileName: string, optionsToExtend: CompilerOptions | undefined, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, watchOptionsToExtend?: WatchOptions): WatchCompilerHostOfConfigFile; + function createWatchCompilerHost(configFileName: string, optionsToExtend: CompilerOptions | undefined, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): WatchCompilerHostOfConfigFile; function createWatchCompilerHost(rootFiles: string[], options: CompilerOptions, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, projectReferences?: readonly ProjectReference[], watchOptions?: WatchOptions): WatchCompilerHostOfFilesAndCompilerOptions; /** * Creates the watch from the host for root files and compiler options