0

Whenever there is a possible null reference exception, Resharper suggests to check, assert or suppress the warning with these comments:

// ReSharper disable PossibleNullReferenceException
            objectWhichCouldBeNull.DoSomething();
// ReSharper restore PossibleNullReferenceException

However, the comments are always indented on the way to the left edge of the source code document. Is there a way to keep the comments aligned with other code, especially when using Resharper Code Cleanup function (Ctrl-Alt-F)?

Here's how it should be:

            // ReSharper disable PossibleNullReferenceException
            objectWhichCouldBeNull.DoSomething();
            // ReSharper restore PossibleNullReferenceException
M4N
  • 94,805
  • 45
  • 217
  • 260
user3918598
  • 285
  • 1
  • 4
  • 12

1 Answers1

1

Try disabling ReSharper | Options | Code Editing | C# | Formatting Style | Other | Other | Don't indent comments started at first column

Alexander Kurakin
  • 13,373
  • 2
  • 33
  • 29