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

Printing generator warnings based on programming language #150

Open
desaikd opened this issue Oct 16, 2024 · 0 comments
Open

Printing generator warnings based on programming language #150

desaikd opened this issue Oct 16, 2024 · 0 comments
Labels
code generation Improvements for code generation subcommand `generate`

Comments

@desaikd
Copy link
Contributor

desaikd commented Oct 16, 2024

As per the suggestions in this thread:

  • The fact that you have to make this change in two places is a bit of a code smell. It should be possible to do something like let generator = match language { /*...*/ }; outside of the match args.get_one::<String>("schema").
  • If we're going to be unconditionally printing some warnings, perhaps we can print to std err instead of std out, and then we also don't need to worry about coloring them, since the colors often show up as gibberish in text log files.
  • Rather than having multiple println!() in the print warnings functions, why not combine it into one multiline string?
  • Should the generator trait have a print_implementation_notes() function? Then you can get the language specific generator and call the function on that instead of having to include it in the language matching branches.
  • To accomplish this, it might be helpful to have an AnyLanguage enum that can delegate to the correct language (similar to the AnyEncoding enum in ion-rust).

I think all of this can be addressed in a separate PR, though.

Originally posted by @popematt in #148 (comment)

@desaikd desaikd added the code generation Improvements for code generation subcommand `generate` label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code generation Improvements for code generation subcommand `generate`
Projects
None yet
Development

No branches or pull requests

1 participant