Control "Put assignment expression into block" warning for expression-bodied members

Code like:

public void Reset() => _index = -1;

makes Rider underline the variable _index and offer a “Put assignment expression into block” context action.

Is there a way to control this in the app settings and maybe even suppress the context action?

0
1 comment

Hello Andreas, 

Thanks for contacting JetBrains support. Regarding this behavior, please go to Settings | Editor | Inspection Settings | Inspection Severity | C#, then disable “Place assignment expression into block”:

If the issue persists, could you please provide the following details:

  • The screenshot of the issue
  • Share your Rider settings:

1. Go to Settings | Manage Layers (button at the bottom).

2. For each layer, use the context menu | Export to File.

3. Additionally, please share your `.editorconfig` file if it exists.

You can upload the files to our upload service and share the upload id. 

Thanks,

Tom

 

0

Please sign in to leave a comment.