Try Catch formatting

Hello, I'm new to resharper and i try to find out how to disable the formatting on the "try catch" blocks.
I want a try catch in this form:

try { MyMethodCall(); }
catch (Exception ex) { ... }

and not the expanded version:

try
{
  MyMethodCall();
}
catch(Excetion ex)
{
  ...
}

I looked everywhere in the options but I can't find where is the setting for such behavior.
Thanks in advance

1 comment
Comment actions Permalink

Hello,

Unfortunately, there's no way to perfrom such formatting for try-catch blocks in ReSharper out-of-the-box. You may tweak the corresponding settings in the Code Editing → C# → Formatting Style → Line Breaks and Wrapping dialog, but they will affect all constructions - not only try-catch, but others as well (e.g., if- and for- braces/line breaks layout).

We apologize for the inconvenience.
Thank you!

0

Please sign in to leave a comment.