0

How to say to Rider (Resharper) put #nullable after using (import) block after code reformat?

My example:

  • Preconditions:
    • JetBrains Rider 2022.1.2. I expect the same results with Resharper because Rider and Resharper use the same settings.
    • File with content:
using System.Collections.Generic;

#nullable enable

internal record Response
{
    public IList<decimal>? Items { get; init; }
}
  • Steps:
    1. Choose the file in solution explorer
    2. Context menu -> Refactor this -> Move to folder

Actual result:

  • #nullable enable was moved before using (import) block.
#nullable enable

using System.Collections.Generic;

internal record Response
{
    public IList<decimal>? Items { get; init; }
}

Expected result:

  • File content did not change.

1 Answers1

0

I played around with both Rider and R# and was not able to produce your desired behavior. So I assume that's not yet supported

Maybe you can create a ticket at JetBrains so that they can track it as a feature request.

mu88
  • 4,156
  • 1
  • 23
  • 47
  • Thank you for your advise. As I understand this is not implemented in rider. So, there is the ticket for it https://youtrack.jetbrains.com/issue/RSRP-489353 and [Rider Support Community Post](https://rider-support.jetbrains.com/hc/en-us/community/posts/6777729826578-How-to-put-nullable-after-using-import-block-after-code-reformat) – Sergey Rubtsov Aug 02 '22 at 14:01
  • Thanks for keeping us updated! Maybe you can mark it as an answer so that the question gets closed? – mu88 Aug 03 '22 at 05:43