我希望 resharper 按以下方式缩进我的代码:
var modification = shortUrlIndexCollection.FindAndModify
(
Query.Or
(
Query.And
(
Query.EQ("_id", "Index"),
Query.EQ("LockId", Guid.Empty)
),
Query.LT("UnlockOn", now)
),
SortBy
.Null,
Update
.Set("LockId", guid)
.Set("UnlockOn", now + reserveDuration),
true
);
但它会按照以下方式格式化我的代码:
var modification = shortUrlIndexCollection.FindAndModify
(
Query.Or
(
Query.And
(
Query.EQ("_id", "Index"),
Query.EQ("LockId", Guid.Empty)
),
Query.LT("UnlockOn", now)
),
SortBy
.Null,
Update
.Set("LockId", guid)
.Set("UnlockOn", now + reserveDuration),
true
);
根据 Custom Brace formatting with Resharper我已经尝试过 continuous line indent multiplier
选项,但它给出了错误的结果...
最佳答案
尝试 Resharper 7.1它修复了链接方法的缩进。
刚刚用我的 stylecop 设置试了一下,格式变成了:
shortUrlIndexCollection.FindAndModify(
Query.Or(
Query.And(Query.EQ("_id", "Index"), Query.EQ("LockId", Guid.Empty)), Query.LT("UnlockOn", now)),
SortBy.Null,
Update.Set("LockId", guid).Set("UnlockOn", now + reserveDuration),
true);
不是你想要的。
关于c# - Resharper 过度缩进我的代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13387385/