Skip to content
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

Closed
ghost opened this issue Jun 21, 2015 · 2 comments
Closed

Generated diagnostics file doesn't explain its source. #3591

ghost opened this issue Jun 21, 2015 · 2 comments
Labels
Help Wanted You can do this Infrastructure Issue relates to TypeScript team infrastructure Suggestion An idea for TypeScript

Comments

@ghost
Copy link

ghost commented Jun 21, 2015

Background:

The generate-diagnostics build step takes JSON-encoded diagnostics data and transforms it into TypeScript to define the Diagnostics 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 a Diagnostics 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?

@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Help Wanted You can do this labels Jun 22, 2015
@RyanCavanaugh
Copy link
Member

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.

@RyanCavanaugh RyanCavanaugh added this to the Community milestone Jun 22, 2015
@CyrusNajmabadi
Copy link
Contributor

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.

   -- Cyrus

From: Ryan Cavanaugh [mailto:notifications@github.com]
Sent: Sunday, June 21, 2015 7:21 PM
To: Microsoft/TypeScript
Subject: Re: [TypeScript] Generated diagnostics file doesn't explain its source. (#3591)

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.


Reply to this email directly or view it on GitHubhttps://github.com//issues/3591#issuecomment-113982748.

@mhegazy mhegazy added the Infrastructure Issue relates to TypeScript team infrastructure label Feb 22, 2016
NaridaL added a commit to NaridaL/TypeScript that referenced this issue Sep 21, 2017
Added following line to generated output:
"// generated from 'src/diagnosticMessages.json' by 'scripts/processDiagnosticMessages.ts'\r\n" +

Fixes microsoft#3591
NaridaL added a commit to NaridaL/TypeScript that referenced this issue Sep 22, 2017
Added following line to generated output:
"// generated from 'src/diagnosticMessages.json' by 'scripts/processDiagnosticMessages.ts'\r\n" +

Fixes microsoft#3591
mhegazy pushed a commit that referenced this issue Nov 8, 2017
Added following line to generated output:
"// generated from 'src/diagnosticMessages.json' by 'scripts/processDiagnosticMessages.ts'\r\n" +

Fixes #3591
@mhegazy mhegazy removed this from the Community milestone Apr 26, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Help Wanted You can do this Infrastructure Issue relates to TypeScript team infrastructure Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants