From 442649aa4e98e0808f13fe71f8fdd239de33eecb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Jul 2025 16:29:27 +0000 Subject: [PATCH 1/5] Initial plan From d4fb9b4068beba8fae7e125643269c8ea210581e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Jul 2025 16:40:35 +0000 Subject: [PATCH 2/5] Fix --showConfig to work when no input files are found Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com> --- src/compiler/executeCommandLine.ts | 31 +++++++++++-------- src/testRunner/unittests/config/showConfig.ts | 11 +++++-- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/compiler/executeCommandLine.ts b/src/compiler/executeCommandLine.ts index edeb0eb277c57..c42af5d52978e 100644 --- a/src/compiler/executeCommandLine.ts +++ b/src/compiler/executeCommandLine.ts @@ -638,19 +638,24 @@ function executeCommandLineWorker( if (configFileName) { const extendedConfigCache = new Map(); const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, extendedConfigCache, commandLine.watchOptions, sys, reportDiagnostic)!; // TODO: GH#18217 - if (commandLineOptions.showConfig) { - if (configParseResult.errors.length !== 0) { - reportDiagnostic = updateReportDiagnostic( - sys, - reportDiagnostic, - configParseResult.options, - ); - configParseResult.errors.forEach(reportDiagnostic); - return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); - } - // eslint-disable-next-line no-restricted-syntax - sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine); - return sys.exit(ExitStatus.Success); + if (commandLineOptions.showConfig) { + // For --showConfig, filter out "no inputs found" errors since the purpose is to show configuration, not compile + const errorsExcludingNoInputs = configParseResult.errors.filter(error => + error.code !== Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code + ); + + if (errorsExcludingNoInputs.length !== 0) { + reportDiagnostic = updateReportDiagnostic( + sys, + reportDiagnostic, + configParseResult.options, + ); + errorsExcludingNoInputs.forEach(reportDiagnostic); + return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); + } + // eslint-disable-next-line no-restricted-syntax + sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine); + return sys.exit(ExitStatus.Success); } reportDiagnostic = updateReportDiagnostic( sys, diff --git a/src/testRunner/unittests/config/showConfig.ts b/src/testRunner/unittests/config/showConfig.ts index 9000ce035cb62..6afc64776e9f6 100644 --- a/src/testRunner/unittests/config/showConfig.ts +++ b/src/testRunner/unittests/config/showConfig.ts @@ -129,9 +129,14 @@ describe("unittests:: config:: showConfig", () => { include: [ "${configDir}/src/**/*", // eslint-disable-line no-template-curly-in-string ], - files: ["${configDir}/main.ts"], // eslint-disable-line no-template-curly-in-string - }); - + files: ["${configDir}/main.ts"], // eslint-disable-line no-template-curly-in-string + }); + + // Test that --showConfig works even when no input files are found + showTSConfigCorrectly("Show TSConfig with no input files", ["-p", "tsconfig.json"], { + include: ["./*"], + }); + // Bulk validation of all option declarations for (const option of ts.optionDeclarations) { baselineOption(option, /*isCompilerOptions*/ true); From f1c7d72244b20be329994a83735f50b3c13a02c5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Jul 2025 16:57:42 +0000 Subject: [PATCH 3/5] Apply formatting and finalize fix for --showConfig Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com> --- src/compiler/executeCommandLine.ts | 34 +++++++++---------- src/testRunner/unittests/config/showConfig.ts | 16 ++++----- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/compiler/executeCommandLine.ts b/src/compiler/executeCommandLine.ts index c42af5d52978e..fdd6b29a0b7d5 100644 --- a/src/compiler/executeCommandLine.ts +++ b/src/compiler/executeCommandLine.ts @@ -638,24 +638,22 @@ function executeCommandLineWorker( if (configFileName) { const extendedConfigCache = new Map(); const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, extendedConfigCache, commandLine.watchOptions, sys, reportDiagnostic)!; // TODO: GH#18217 - if (commandLineOptions.showConfig) { - // For --showConfig, filter out "no inputs found" errors since the purpose is to show configuration, not compile - const errorsExcludingNoInputs = configParseResult.errors.filter(error => - error.code !== Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code - ); - - if (errorsExcludingNoInputs.length !== 0) { - reportDiagnostic = updateReportDiagnostic( - sys, - reportDiagnostic, - configParseResult.options, - ); - errorsExcludingNoInputs.forEach(reportDiagnostic); - return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); - } - // eslint-disable-next-line no-restricted-syntax - sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine); - return sys.exit(ExitStatus.Success); + if (commandLineOptions.showConfig) { + // For --showConfig, filter out "no inputs found" errors since the purpose is to show configuration, not compile + const errorsExcludingNoInputs = configParseResult.errors.filter(error => error.code !== Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code); + + if (errorsExcludingNoInputs.length !== 0) { + reportDiagnostic = updateReportDiagnostic( + sys, + reportDiagnostic, + configParseResult.options, + ); + errorsExcludingNoInputs.forEach(reportDiagnostic); + return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); + } + // eslint-disable-next-line no-restricted-syntax + sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine); + return sys.exit(ExitStatus.Success); } reportDiagnostic = updateReportDiagnostic( sys, diff --git a/src/testRunner/unittests/config/showConfig.ts b/src/testRunner/unittests/config/showConfig.ts index 6afc64776e9f6..aad7192101865 100644 --- a/src/testRunner/unittests/config/showConfig.ts +++ b/src/testRunner/unittests/config/showConfig.ts @@ -129,14 +129,14 @@ describe("unittests:: config:: showConfig", () => { include: [ "${configDir}/src/**/*", // eslint-disable-line no-template-curly-in-string ], - files: ["${configDir}/main.ts"], // eslint-disable-line no-template-curly-in-string - }); - - // Test that --showConfig works even when no input files are found - showTSConfigCorrectly("Show TSConfig with no input files", ["-p", "tsconfig.json"], { - include: ["./*"], - }); - + files: ["${configDir}/main.ts"], // eslint-disable-line no-template-curly-in-string + }); + + // Test that --showConfig works even when no input files are found + showTSConfigCorrectly("Show TSConfig with no input files", ["-p", "tsconfig.json"], { + include: ["./*"], + }); + // Bulk validation of all option declarations for (const option of ts.optionDeclarations) { baselineOption(option, /*isCompilerOptions*/ true); From eb356308994e2104f296a1b5e847d986c0c1441a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Jul 2025 17:12:05 +0000 Subject: [PATCH 4/5] Refactor --showConfig to write output then issue diagnostics Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com> --- src/compiler/executeCommandLine.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/compiler/executeCommandLine.ts b/src/compiler/executeCommandLine.ts index fdd6b29a0b7d5..3d07bfe9e241e 100644 --- a/src/compiler/executeCommandLine.ts +++ b/src/compiler/executeCommandLine.ts @@ -639,20 +639,17 @@ function executeCommandLineWorker( const extendedConfigCache = new Map(); const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, extendedConfigCache, commandLine.watchOptions, sys, reportDiagnostic)!; // TODO: GH#18217 if (commandLineOptions.showConfig) { - // For --showConfig, filter out "no inputs found" errors since the purpose is to show configuration, not compile - const errorsExcludingNoInputs = configParseResult.errors.filter(error => error.code !== Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code); - - if (errorsExcludingNoInputs.length !== 0) { + // eslint-disable-next-line no-restricted-syntax + sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine); + if (configParseResult.errors.length !== 0) { reportDiagnostic = updateReportDiagnostic( sys, reportDiagnostic, configParseResult.options, ); - errorsExcludingNoInputs.forEach(reportDiagnostic); + configParseResult.errors.forEach(reportDiagnostic); return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); } - // eslint-disable-next-line no-restricted-syntax - sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine); return sys.exit(ExitStatus.Success); } reportDiagnostic = updateReportDiagnostic( From 95b6f6cb6d1c9af51cc4c64d75289a46cea8097e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Jul 2025 17:48:00 +0000 Subject: [PATCH 5/5] Add test baseline for --showConfig with no input files Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com> --- .../Show TSConfig with no input files/tsconfig.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/baselines/reference/config/showConfig/Show TSConfig with no input files/tsconfig.json diff --git a/tests/baselines/reference/config/showConfig/Show TSConfig with no input files/tsconfig.json b/tests/baselines/reference/config/showConfig/Show TSConfig with no input files/tsconfig.json new file mode 100644 index 0000000000000..33428857131df --- /dev/null +++ b/tests/baselines/reference/config/showConfig/Show TSConfig with no input files/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": {}, + "include": [ + "./*" + ] +} pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy