有没有办法阻止Resharper重新格式化评论?我想把我的评论放在使用制表符自我对齐的代码后面。像:
private static IEnumerable<string> GetOperands(string grammar)
=> grammar.Replace(GetOpcode(grammar), "") // remove operand from grammar
.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries) // operands are split with a ,
.Select(s => s.Trim()); // remove any whitespace
然而,当我进行代码清理时,Resharper将其格式化为:
private static IEnumerable<string> GetOperands(string grammar)
=> grammar.Replace(GetOpcode(grammar), "") // remove operand from grammar
.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries) // operands are split with a ,
.Select(s => s.Trim()); // remove any whitespace
(我认为)不会增加可读性。