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

Add an option to disable "// Generated from ..." content (in C#) #720

Open
MihaMarkic opened this issue Oct 15, 2024 · 2 comments
Open

Add an option to disable "// Generated from ..." content (in C#) #720

MihaMarkic opened this issue Oct 15, 2024 · 2 comments

Comments

@MihaMarkic
Copy link

I'm seeing in all c# generated classes the comment // Generated from [FULLPATH] near the top of each file.
This is bad from at least two angles:

  • I don't want to show my local directory structure to everybody
  • it causes source control to think that file has been modified even if it has been only generated on a different computer (other content is the same)

And I'm not seeing an option to disable this auto generated part of comment (or is there?).
Hence, please avoid generating that line all together or add an option for disabling it.

Of course, assuming this comment comes from the tool, not ANTL4 c# generator. But even in the later case I assume there is an option to avoid it.

@MihaMarkic
Copy link
Author

Looking at ANTLR4 tool C# template it seems that the comments are hardcoded. I'll keep this issue open for a little bit longer and if I can't find an option to disable comments, I'll close it.

@MihaMarkic
Copy link
Author

Would it be possible to set directory to project directory (or to directory where .g4 file is) and use relative path to .g4 file(s)? This way the //generated from... would contain relative path that doesn't change and also doesn't expose one's directory structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant