resharper-structured-logging icon indicating copy to clipboard operation
resharper-structured-logging copied to clipboard

"Convert to compile-time constant message template" loses the track of parameters if a message contains single-quotes

Open VyacheslavPritykin opened this issue 1 year ago • 0 comments

The "Convert to compile-time constant message template" feature transforms these lines:

var aaa = 123;
var bbb = 456;
_logger.LogInformation($"A: '{aaa}', B: {bbb}");
_logger.LogInformation($"A: ''''''' {aaa}");

into these:

var aaa = 123;
var bbb = 456;
_logger.LogInformation("A: \'Aaaa}\', B:Bbbbb}", aaa, bbb);
_logger.LogInformation("A: \'\'\'\'\Aaa\' {Aaa}", aaa);

The gif: 2024-10-24 18 17 17

VyacheslavPritykin avatar Oct 24 '24 16:10 VyacheslavPritykin