From 0b9f8b4aa21ab52d6e4c3d084616527ea92da86c Mon Sep 17 00:00:00 2001 From: Alvin Ramskogler <62756994+blaumeise20@users.noreply.github.com> Date: Sat, 29 Jan 2022 00:08:19 +0100 Subject: [PATCH] Fix confusing file name in generated diagnostics file (#46821) * Fix confusing file name in generated diagnostics file * Change "by" to "in" --- scripts/processDiagnosticMessages.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/processDiagnosticMessages.ts b/scripts/processDiagnosticMessages.ts index 53d1ca75db8..fd5f825b848 100644 --- a/scripts/processDiagnosticMessages.ts +++ b/scripts/processDiagnosticMessages.ts @@ -41,7 +41,7 @@ function main(): void { const outputFilesDir = path.dirname(inputFilePath); const thisFilePathRel = path.relative(process.cwd(), outputFilesDir); - const infoFileOutput = buildInfoFileOutput(diagnosticMessages, "./diagnosticInformationMap.generated.ts", thisFilePathRel); + const infoFileOutput = buildInfoFileOutput(diagnosticMessages, `./${path.basename(inputFilePath)}`, thisFilePathRel); checkForUniqueCodes(diagnosticMessages); writeFile("diagnosticInformationMap.generated.ts", infoFileOutput); @@ -62,7 +62,7 @@ function checkForUniqueCodes(diagnosticTable: InputDiagnosticMessageTable) { function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, inputFilePathRel: string, thisFilePathRel: string): string { let result = "// \r\n" + - "// generated from '" + inputFilePathRel + "' by '" + thisFilePathRel.replace(/\\/g, "/") + "'\r\n" + + "// generated from '" + inputFilePathRel + "' in '" + thisFilePathRel.replace(/\\/g, "/") + "'\r\n" + "/* @internal */\r\n" + "namespace ts {\r\n" + " function diag(code: number, category: DiagnosticCategory, key: string, message: string, reportsUnnecessary?: {}, elidedInCompatabilityPyramid?: boolean, reportsDeprecated?: {}): DiagnosticMessage {\r\n" +