Clarified file-not-found error for reference paths without extensions (#35956)

* Clarified file-not-found error for reference paths without extensions

* Updated error message to include extensions

* update baselines missed in merge

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
This commit is contained in:
Josh Goldberg
2020-03-17 17:21:23 -04:00
committed by GitHub
parent e60bbac84f
commit 878f447798
9 changed files with 48 additions and 4 deletions

View File

@@ -4324,6 +4324,10 @@
"category": "Error",
"code": 6230
},
"Could not resolve the path '{0}' with the extensions: {1}.": {
"category": "Error",
"code": 6231
},
"Projects to reference": {
"category": "Message",

View File

@@ -1925,7 +1925,7 @@ namespace ts {
diagnostics.push(createDiagnosticForNodeArray(nodes, Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files));
return "skip";
}
// falls through
// falls through
case SyntaxKind.VariableStatement:
// Check modifiers
@@ -2270,7 +2270,7 @@ namespace ts {
}
const sourceFileWithAddedExtension = forEach(supportedExtensions, extension => getSourceFile(fileName + extension));
if (fail && !sourceFileWithAddedExtension) fail(Diagnostics.File_0_not_found, fileName + Extension.Ts);
if (fail && !sourceFileWithAddedExtension) fail(Diagnostics.Could_not_resolve_the_path_0_with_the_extensions_Colon_1, fileName, "'" + supportedExtensions.join("', '") + "'");
return sourceFileWithAddedExtension;
}
}