用于缩进匿名方法的 ReSharper 配置?

发布于 2024-10-01 12:53:58 字数 424 浏览 5 评论 0原文

如果我要求 ReSharper 重新格式化当前代码:

SomeMethodThatIsGivenAnAnonymousMethod(delegate
{
    Test();
});

那么它会像这样重新格式化:

SomeMethodThatIsGivenAnAnonymousMethod(delegate
                                           {
                                               Test();
                                           });

我最多可以哄它将大括号与 delegate 关键字对齐。有什么办法可以让它缩进到原来的方式吗?

If I ask ReSharper to reformat the current code:

SomeMethodThatIsGivenAnAnonymousMethod(delegate
{
    Test();
});

Then it reformats it like this:

SomeMethodThatIsGivenAnAnonymousMethod(delegate
                                           {
                                               Test();
                                           });

I can at most coax it to line up the braces with the delegate keyword. Is there any way I can coax it into indenting it back to the original way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绝對不後悔。 2024-10-08 12:53:58

尝试格式化样式 |其他|缩进匿名方法体。如果我关闭此功能,我会得到您描述的原始格式。

Try Formatting Style | Other | Indent Anonymous Method Body. If I turn this off, I get the original format you describe.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文