Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure indentation for lambdas in invocations in Rider?

Tags:

c#

rider

I want to configure the code style settings of JetBrains Rider. I want to format a function as this:

protected override JobHandle OnUpdate(JobHandle inputDeps) {
    Entities.ForEach((ref PaddleMovementData moveData, in PaddleInputData inputData) => {
        moveData.direction = 0;
        moveData.direction += Input.GetKey(inputData.upKey) ? 1 : 0;
        moveData.direction -= Input.GetKey(inputData.downKey) ? 1 : 0;
    }).Run();

    return default;
}

Yet Rider gives me this:

protected override JobHandle OnUpdate(JobHandle inputDeps) {
    Entities.ForEach((ref PaddleMovementData moveData, in PaddleInputData inputData) => {
                moveData.direction = 0;
                moveData.direction += Input.GetKey(inputData.upKey) ? 1 : 0;
                moveData.direction -= Input.GetKey(inputData.downKey) ? 1 : 0;
            }
        )
        .Run();

    return default;
}

I can't find a way to fix that. In CLion it is possible, so I guess the same is true for Rider. How can I do that?

like image 849
Deuchie Avatar asked Oct 18 '25 07:10

Deuchie


1 Answers

  1. Format your code as you want
  2. select your code
  3. use detect formatting

If such formatting rule exists it will be shown like this: enter image description here

So they are the related formatting settings!

like image 71
Mohammad Mostafa Dastjerdi Avatar answered Oct 20 '25 22:10

Mohammad Mostafa Dastjerdi