Open pvginkel opened 10 months ago
Right now there is no formatting applied to expressions that appear within a raw interpolated string.
From what I recall, the original interpolated strings did not allow line breaks in any expressions within them. So CSharpier was forcing those expressions to be flat. When raw interpolated strings were first supported in CSharpier, they were treated the same way which would have resulted in
var v = $"""
abcde abcde abcde abcde abcde {string.Join(", ", new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 })}
""";
And then when I was getting raw strings to indent correctly, the side effect was that I removed all formatting from the expressions in them.
Long story short, I believe it should be possible to get expressions within raw strings to format.
Raw string literals, by their multiline nature, are currently the largest unformatted (well, manually formatted) pieces of code in our codebase. I briefly looked into the current implementation but I'm afraid the logic for raw literals is quite beyond my expertise to implement this formatting myself in a PR. @belav is this something still on your radar?
Input:
See output.
Output:
Expected behavior:
Not sure :). Maybe this?
or
I just don't think the current formatting is ideal.
Btw this is changed behavior from 0.26.0. I think until the current version it wouldn't even warp this code, not sure.