Is there a way to mark up code to tell ReSharper not to format it?

Posted by adrianbanks on Stack Overflow See other posts from Stack Overflow or by adrianbanks
Published on 2010-02-01T11:57:58Z Indexed on 2010/03/23 18:33 UTC
Read the original article Hit count: 729

Filed under:
|
|

I quite often use the ReSharper "Clean Up Code" command to format my code to our coding style before checking it into source control. This works well in general, but some bits of code are better formatted manually (eg. because of the indenting rules in ReSharper, things like chained linq methods or multi-line ternary operators have a strange indent that pushes them way to the right).

Is there any way to mark up parts of a file to tell ReSharper not to format that area? I'm hoping for some kind of markup similar to how ReSharper suppresses other warnings/features. If not, is there some way of changing a combination of settings to get ReSharper to format the indenting correctly?

EDIT:

I have found this post from the ReSharper forums that says that generated code sections (as defined in the ReSharper options page) are ignored in code cleanup. Having tried it though, it doesn't seem to get ignored.

© Stack Overflow or respective owner

Related posts about c#

Related posts about resharper-4.5