HomePhabricator

[clang-format] Add new LambdaBodyIndentation option

Authored by vlovich on Jun 22 2021, 11:39 AM.

Description

[clang-format] Add new LambdaBodyIndentation option

Currently the lambda body indents relative to where the lambda signature is located. This instead lets the user
choose to align the lambda body relative to the parent scope that contains the lambda declaration. Thus:

someFunction([] {

lambdaBody();

});

will always have the same indentation of the body even when the lambda signature goes on a new line:

someFunction(

  • { lambdaBody();

});

whereas before lambdaBody would be indented 6 spaces.

Differential Revision: https://reviews.llvm.org/D102706