【问题标题】:How to configure indentation for lambdas in invocations in Rider?如何在 Rider 的调用中为 lambdas 配置缩进?
【发布时间】:2021-07-11 04:27:55
【问题描述】:

我想配置 JetBrains Rider 的代码样式设置。我想这样格式化一个函数:

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;
}

Rider 给了我这个:

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;
}

我找不到解决这个问题的方法。在 CLion 中这是可能的,所以我想 Rider 也是如此。我该怎么做?

【问题讨论】:

    标签: c# rider


    【解决方案1】:
    1. 根据需要格式化代码
    2. 选择您的代码
    3. 使用检测格式

    如果存在这样的格式规则,它将显示如下:

    所以它们是相关的格式设置!

    【讨论】:

      猜你喜欢
      • 2017-11-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多