Open idubrov opened 4 years ago
Another potential improvement: print list of modules / some basic stats where #[sourcegen]
attributes were found, to help troubleshooting cases when module is not included by mistake -- which is a common thing when you are setting up new code!
Also: when it cannot process item (for example, was placed in front of invalid item type), should report it as well.
Another thing: if it fails to produce code because generated code is invalid (could happen when generation is driven off other files; for example, generated field name might be invalid Rust identifier), it reports an error in the file that doesn't yet exist.
Sourcegen could really use some help from colors on terminal and, maybe, add some smiley faces, too!
P.S. At very least, error messages should be clean and clear -- currently, when tool fails, it is not obvious that it did so.