-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated diagnostics file doesn't explain its source. #3591
Comments
This is just a mimic of C# auto-generated files; there's no implication for tools (just humans). It'd be fine to put some more complex message up there. |
It’s a general convention for how auto-generated files are marked. If you want to add additional information, it would be preferred if you could do it in a comment provided after this line.
From: Ryan Cavanaugh [mailto:notifications@github.com] This is just a mimic of C# auto-generated files; there's no implication for tools (just humans). It'd be fine to put some more complex message up there. — |
Added following line to generated output: "// generated from 'src/diagnosticMessages.json' by 'scripts/processDiagnosticMessages.ts'\r\n" + Fixes microsoft#3591
Added following line to generated output: "// generated from 'src/diagnosticMessages.json' by 'scripts/processDiagnosticMessages.ts'\r\n" + Fixes microsoft#3591
Added following line to generated output: "// generated from 'src/diagnosticMessages.json' by 'scripts/processDiagnosticMessages.ts'\r\n" + Fixes #3591
Background:
The
generate-diagnostics
build step takes JSON-encoded diagnostics data and transforms it into TypeScript to define theDiagnostics
object used throughout the compiler.Problem:
The only indication that this has occurred is a comment at the top of the generated file that says
// <auto-generated />
, but neither the name of the JSON source file nor the name of file containing the code that has generated it (processDiagnosticsMessages.ts) are given. This can make it difficult to figure out the correct file to modify, especially if using a tool that jumps to the definition of aDiagnostics
key. (Relevant: #3549.)Proposed solution:
Include in the comments of the auto-generated file the name of both the generator and the name of the JSON input file it was generated from.
Does the
<auto-generated />
element have any actual significance? I.e., is there a tool making use of it, or was it an ad-hoc way to indicate that the generated file should not be modified? Could we encode these file names as attributes on this element?The text was updated successfully, but these errors were encountered: