Skip to content

[clang-format] AlignConsecutiveDeclarations does not distinguish between functions and variables #55605

@timblechmann

Description

@timblechmann

considering this code:

float a;

int bbbbbbbbbbbbbb;

std::vector< std::vector< std::vector< int > > > function()
{
    return {};
}

formatting it via AlignConsecutiveDeclarations: AcrossEmptyLinesAndComments, gives:

float                                            a;

int                                              bbbbbbbbbbbbbb;

std::vector< std::vector< std::vector< int > > > function()
{
    return {};
}

it would be great to have the option to only align consecutive declarations for declarations of the same kind, so that function and variable declarations are not aligned:

float a;

int   bbbbbbbbbbbbbb;

std::vector< std::vector< std::vector< int > > > function()
{
    return {};
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions