Hi All,
I would like to propose the ability to format embedded elixir expressions inside of files / sigils being formatted by a formatter plugin.
Situation at the Moment
Formatter Plugins that format files which contain elixir expressions inside do not currently have a way to call the formatter again on the nested expression.
Example Usage
<div>
{gettext(~M"It's my cat's {year, selectordinal, one {#st} two {#nd} few {#rd} other {#th}} birthday!")}
</div>
The HTML should be formatted by the surface formatter, the M sigil by the cldr messages formatter.
I expect to see similar questions in formatter plugins like
heex_formatter.
Possible Solution
It would be nice if there was an API, that would allow passing embedded elixir expressions back into the formatter.
One way to achieve that, would be to pass a function to Mix.Tasks.Format.format/2 into opts.
Thanks,
Jony