[PATCH] D44609: [clang-format] New option BeforeLambdaBody to manage lambda line break inside function parameter call (in Allman style)

Michael via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 28 14:25:26 PST 2020


Alundra added a comment.

@Wawha In the same style of this missing feature, I think you are also aware of the miss of clang-format about struct/array initializer like: https://bugs.llvm.org/show_bug.cgi?id=40411
Basically to have the break for braces after the '=' of the struct/array initializer like this example:

  const FMOD_3D_ATTRIBUTES Attributes =
  {
      { WorldPosition.x, WorldPosition.y, WorldPosition.z },
      { 0.0f, 0.0f, 0.0f },
      { 0.0f, 0.0f, 1.0f },
      { 0.0f, 1.0f, 0.0f }};

Actually with the indent configured you end with something like:

  const FMOD_3D_ATTRIBUTES Attributes =
      {
          { WorldPosition.x, WorldPosition.y, WorldPosition.z },
          { 0.0f, 0.0f, 0.0f },
          { 0.0f, 0.0f, 1.0f },
          { 0.0f, 1.0f, 0.0f }};

The only way right now is to have the '{' after the '=' but that breaks your coding style:

  const FMOD_3D_ATTRIBUTES Attributes = {
      { WorldPosition.x, WorldPosition.y, WorldPosition.z },
      { 0.0f, 0.0f, 0.0f },
      { 0.0f, 0.0f, 1.0f },
      { 0.0f, 1.0f, 0.0f }};

That looks like on the same topic about braces controls missing feature.
Since you look very familiar, it can be for you a next challenge to add that in clang format?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D44609/new/

https://reviews.llvm.org/D44609





More information about the cfe-commits mailing list