Interpolated strings formatting error

Resharper keeps reformatting my interpolated strings weird, and I can't figure out why or how to stop it.  It does this

$@"Hey there {name}, how are you this {timeOfDay}"

and formats it like this

$@"Hey there {name
}, how are you this {timeOfDay

Can anyone tell me why it's putting line breaks in, it's seriously messing up my readability...

Joshua Austill

1 comment

Ok, I figured this out.  It was a combination of a TON of settings.  I had mess with all the {} formatting and turn off all the auto newline stuff.  Now it leaves my interpolated strings alone, but it also leaves the trailing bracket on methods on the last line, like this.

private OhWell()

This leads me to believe that the formatter simply doesn't recognize interpolated strings as such, and simply treats the brackets as code sections, or there is just a small bug  in it.  Either way, this works for me for now, but it will be nice if they ever fix this.

Joshua Austill


Please sign in to leave a comment.