-
Notifications
You must be signed in to change notification settings - Fork 5
Description
We currently have no way of splitting a long string into smaller strings, without having to do runtime concatenation and hope that it'll optimize.
This was mostly fine until #255, but with #255 we now format interpolated expressions, and that means if I have a long string with interpolations, it gets broken into multiple lines in weird ways.
If we allow splitting a literal into multiple literals in a way that is guaranteed to generate a single string (no runtime concatenation), users can split long strings with interpolations into shorter ones manually to have nicely formatted strings.
My current thinking is that we can allow juxtaposition of string literals. (1) it requires no new syntax (2) it's a well known syntax, supported by many languages (3) it's easy to parse.
The footgun of ["a" "b", "c"] (note the missing comma) may be avoided if we format merge short strings and format this example as ["ab", "c"]. (this assumes that all Fir code will be formatted always)