Skip to content

Commit 0b9f8b4

Browse files
authoredJan 28, 2022
Fix confusing file name in generated diagnostics file (microsoft#46821)
* Fix confusing file name in generated diagnostics file * Change "by" to "in"
1 parent 2d501b1 commit 0b9f8b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎scripts/processDiagnosticMessages.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function main(): void {
4141
const outputFilesDir = path.dirname(inputFilePath);
4242
const thisFilePathRel = path.relative(process.cwd(), outputFilesDir);
4343

44-
const infoFileOutput = buildInfoFileOutput(diagnosticMessages, "./diagnosticInformationMap.generated.ts", thisFilePathRel);
44+
const infoFileOutput = buildInfoFileOutput(diagnosticMessages, `./${path.basename(inputFilePath)}`, thisFilePathRel);
4545
checkForUniqueCodes(diagnosticMessages);
4646
writeFile("diagnosticInformationMap.generated.ts", infoFileOutput);
4747

@@ -62,7 +62,7 @@ function checkForUniqueCodes(diagnosticTable: InputDiagnosticMessageTable) {
6262
function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, inputFilePathRel: string, thisFilePathRel: string): string {
6363
let result =
6464
"// <auto-generated />\r\n" +
65-
"// generated from '" + inputFilePathRel + "' by '" + thisFilePathRel.replace(/\\/g, "/") + "'\r\n" +
65+
"// generated from '" + inputFilePathRel + "' in '" + thisFilePathRel.replace(/\\/g, "/") + "'\r\n" +
6666
"/* @internal */\r\n" +
6767
"namespace ts {\r\n" +
6868
" function diag(code: number, category: DiagnosticCategory, key: string, message: string, reportsUnnecessary?: {}, elidedInCompatabilityPyramid?: boolean, reportsDeprecated?: {}): DiagnosticMessage {\r\n" +

0 commit comments

Comments
 (0)