================
@@ -4684,6 +4684,36 @@ struct FormatStyle {
/// \version 17
bool SpaceBeforeJsonColon;
+ /// Defines how clang-format should treat spaces around block comment
+ /// delimiters and specialized inline comments (such as parameter name
+ /// annotations). The default `Leave` mode preserves existing whitespace.
+ enum class CommentSpaceMode : int8_t {
+ /// Preserve existing whitespace, making no formatting changes.
+ Leave,
+ /// Ensure exactly one space is present.
+ Always,
+ /// Ensure no space is present.
+ Never,
+ };
+
+ /// Specifies spacing behavior for different block comment forms.
+ struct SpaceInCommentsOptions {
+ CommentSpaceMode AfterOpeningComment = CommentSpaceMode::Leave;
+ CommentSpaceMode BeforeClosingComment = CommentSpaceMode::Leave;
+ CommentSpaceMode AfterOpeningParamComment = CommentSpaceMode::Leave;
+ CommentSpaceMode BeforeClosingParamComment = CommentSpaceMode::Leave;
+
+ constexpr bool operator==(const SpaceInCommentsOptions &R) const {
+ return AfterOpeningComment == R.AfterOpeningComment &&
+ BeforeClosingComment == R.BeforeClosingComment &&
+ AfterOpeningParamComment == R.AfterOpeningParamComment &&
+ BeforeClosingParamComment == R.BeforeClosingParamComment;
+ }
+ };
+
+ /// Controls spacing inside block comments.
+ SpaceInCommentsOptions SpaceInComments;
----------------
HazardyKnusperkeks wrote:
Please sort in the header according to the option name.
https://github.com/llvm/llvm-project/pull/162105
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits