是否可以使用clang-format
将结构成员和函数参数名称格式化为列?
例如:
struct
{
int alpha; //aligned to 'b' of "beta"
unsigned int beta;
MyObject *gamma; //aligned with 'g' not '*'
};
void foobar (int alpha, //aligned to 'b' of "beta"
unsigned int beta
MyObject *gamma) //aligned with 'g' not '*'
{
}
如果不可能,我可以以某种方式扩展 clang-format 来实现这一目标吗?
clang-format
最近(3.7或3.8)获得了更多调整对齐的选项,我在问题中提出的问题仍然没有得到完全支持,但我们现在可以更接近一些:
AlignConsecutiveDeclarations: true
其对齐声明如上所示。
不幸的是,对指针星号格式的控制似乎仍然有限,请参阅clang-format:将指针声明的星号 (*) 与变量名对齐
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)