You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently in all generated header files, the // clang on is written in column zero just before the closing comment line (also written in column zero). As long as the class declaration is closed with a } then calling clang-format on this file will leave the generated code untouched. However, if the user specifies that they don't want the closing brace, then both the // clang on and the following line are indented. That results in a difference being generated every time the file gets generated and the user modifies and reformats it.
I think a better approach would be to change the generation of // clang on. If the header file has no user-modifications, the comment line should be added after the closing block, with indentation chosen based on whether or not a closing brace is being generated. If there is user-specified code, then don't add // clang on which lets the user choose whether or when to turn formatting back on.
Effectively, once the // clang on gets written the first time the file is created, that line gets treated as if the user created it.
The text was updated successfully, but these errors were encountered:
Previously, these files had to be regenerated every time they were regenerated.
This fixes that, allowing us to format it the way clang-format wants and leave
it that way.
Description:
Currently in all generated header files, the
// clang on
is written in column zero just before the closing comment line (also written in column zero). As long as the class declaration is closed with a}
then calling clang-format on this file will leave the generated code untouched. However, if the user specifies that they don't want the closing brace, then both the// clang on
and the following line are indented. That results in a difference being generated every time the file gets generated and the user modifies and reformats it.I think a better approach would be to change the generation of
// clang on
. If the header file has no user-modifications, the comment line should be added after the closing block, with indentation chosen based on whether or not a closing brace is being generated. If there is user-specified code, then don't add// clang on
which lets the user choose whether or when to turn formatting back on.Effectively, once the
// clang on
gets written the first time the file is created, that line gets treated as if the user created it.The text was updated successfully, but these errors were encountered: