Convert to compile time constant codefix should cover more cases
MichalBrylka opened this issue · 2 comments
Hi,
The "Convert to compile time constant message template" generally works and produces nice results:
Where it falls short is when presented with more challenging (but sadly, more frequent) structured logging bad practice i.e.:
log.InfoFormat("Name:" + name + " age " + age);
No code fix is presented in such case:
While it might be tempting to add support for such bad-practices fixes, I'd propose to alternatively allow R# to use it's own "Convert concatenation to interpolation" action:
Your plugin somehow prohibits this action from displaying in suggestion list
Would it be feasible to allow R# to propose it's own suggestions/code fixes ?
Using "Convert concatenation to interpolation" followed by your code fix would allow many ill-structured logging calls to be mended
Your plugin somehow prohibits this action from displaying in suggestion list
The plugin doesn't prohibit any fixes explicitly.
I get the same results whether the plugin is installed or not.
var s = new Random().Next();
// There is a fix for this
var hello = "Hello" + s + "World";
// There is no fix for this
_logger.LogInformation("Hello" + s + "World");
Closed due to inactivity