English 中文(简体)
Visual studio 2010+重新锐化括号缩进问题
原标题:Visual studio 2010 + resharper bracket indentation problem

我使用的是VS2010+重新锐化,我厌倦了在代码中重新格式化括号缩进。例如,如果我有这样的代码:

operators.Keys
    .ToList()
    .ForEach(k => filters
        .AddRange(CustomHtmlHelpers.GetIdAndValueListByPrefix(queryString, k)
            .Select(t => new QueryFilter()
            {
                Operation = operators[k],
                PropertyName = t.Item1,
                Value = t.Item2
            })))

如果我把<code>在最后VS(或重拍器)修复了括号缩进,因此代码变得如下:

operators.Keys
    .ToList()
    .ForEach(k => filters
                        .AddRange(CustomHtmlHelpers.GetIdAndValueListByPrefix(queryString, k)
                                    .Select(t => new QueryFilter()
                                    {
                                        Operation = operators[k],
                                        PropertyName = t.Item1,
                                        Value = t.Item2
                                    })));

Same happens if i use resharper s code cleanup. I probably could turn off automatic code reformatting on ; but i need it in other situations. I tried changing code formating options both in VS and resharper setting but never got indentation as i want it.

我如何配置vs或resharper,使其不会进行多个选项卡格式化?或者可能还有其他插件我可以(与r#一起)专门用于此目的?

编辑:对于任何对此问题感兴趣的人,这里是r#论坛http://devnet.jetbrains.net/thread/304794欢迎任何希望从r#中看到更好的嵌套代码缩进的人在此处投票支持http://youtrack.jetbrains.net/issue/RSRP-88220

问题回答

只是猜测。。。

转到ReSharper->;选项->;代码编辑->;c#->;格式样式->;另外

在Align Multiline Constructs中搜索,并尝试切换复选框“Chained method calls”的状态(我想您的值已选中此复选框)。

如果不是这个,我希望所需的设置非常接近:-)





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签