emit-rs / emit

Developer-first diagnostics for Rust applications
https://emit-rs.io
Apache License 2.0
128 stars 2 forks source link

Representation of format args in templates #66

Open KodrAus opened 3 months ago

KodrAus commented 3 months ago

emit uses an attribute like #[emit::fmt(":?")] to set a custom formatter for an interpolated property based on standard Rust formatting sigils. These attributes aren't currently round-tripped through formatted templates in any way. This isn't an issue yet because there's no runtime template parsing, but if that's ever introduced it'll be a problem then.

KodrAus commented 2 months ago

We've got another issue preventing us from supporting runtime-parsed templates. #[emit(key)] allows templates to have non-identifier names, like user.name. When formatted back into a template, it would look like:

"Hello, {user.name}"

which isn't a parsable template on its own.