diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 5d6dc7d6df4..fd750094296 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3956,7 +3956,7 @@ "category": "Error", "code": 6306 }, - "File '{0}' is not in project file list. Projects must list all files or use an 'include' pattern.": { + "File '{0}' is not in project '{1}' file list. Projects must list all files or use an 'include' pattern.": { "category": "Error", "code": 6307 }, @@ -4295,7 +4295,7 @@ "Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'.": { "category": "Error", "code": 7053 - }, + }, "No index signature with a parameter of type '{0}' was found on type '{1}'.": { "category": "Error", "code": 7054 diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 8e4cd48b5ba..f6b379682ec 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -2773,7 +2773,7 @@ namespace ts { // Ignore file that is not emitted if (!sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect)) continue; if (rootPaths.indexOf(file.path) === -1) { - programDiagnostics.add(createCompilerDiagnostic(Diagnostics.File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName)); + programDiagnostics.add(createCompilerDiagnostic(Diagnostics.File_0_is_not_in_project_1_file_list_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName, options.configFilePath || "")); } } } diff --git a/src/testRunner/unittests/config/projectReferences.ts b/src/testRunner/unittests/config/projectReferences.ts index 3acffd7a8c6..8a29760857b 100644 --- a/src/testRunner/unittests/config/projectReferences.ts +++ b/src/testRunner/unittests/config/projectReferences.ts @@ -194,7 +194,7 @@ namespace ts { testProjectReferences(spec, "/primary/tsconfig.json", program => { const errs = program.getOptionsDiagnostics(); - assertHasError("Reports an error about b.ts not being in the list", errs, Diagnostics.File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern); + assertHasError("Reports an error about b.ts not being in the list", errs, Diagnostics.File_0_is_not_in_project_1_file_list_Projects_must_list_all_files_or_use_an_include_pattern); }); }); @@ -344,7 +344,7 @@ namespace ts { }; testProjectReferences(spec, "/alpha/tsconfig.json", (program) => { assertHasError("Issues an error about the rootDir", program.getOptionsDiagnostics(), Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files); - assertHasError("Issues an error about the fileList", program.getOptionsDiagnostics(), Diagnostics.File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern); + assertHasError("Issues an error about the fileList", program.getOptionsDiagnostics(), Diagnostics.File_0_is_not_in_project_1_file_list_Projects_must_list_all_files_or_use_an_include_pattern); }); }); }); diff --git a/src/testRunner/unittests/tsbuild/resolveJsonModule.ts b/src/testRunner/unittests/tsbuild/resolveJsonModule.ts index 3fc50d72ea5..ef2b5a4a674 100644 --- a/src/testRunner/unittests/tsbuild/resolveJsonModule.ts +++ b/src/testRunner/unittests/tsbuild/resolveJsonModule.ts @@ -31,8 +31,9 @@ namespace ts { it("with resolveJsonModule and include only", () => { verifyProjectWithResolveJsonModule("/src/tsconfig_withInclude.json", [ - Diagnostics.File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern, - "/src/src/hello.json" + Diagnostics.File_0_is_not_in_project_1_file_list_Projects_must_list_all_files_or_use_an_include_pattern, + "/src/src/hello.json", + "/src/tsconfig_withInclude.json" ]); });