As Niels commented, this is not something that clang-format should handle.
The second option
suggested by Adrien is the way to go.
I don't agree. The solution that Saloni has come up with, which detects
simple keywords
like "BLayoutBuilder" and "AddGroup" without doing in-depth syntax analysis,
is giving promising
results. And the implementation is not that complex.
I guess the question is on whether we want to integrate our changes back into
clang-format, or
whether we want to maintain a fork with this kind of specific customizations.
I do not have a
preference on that.