diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst --- a/clang/docs/ClangFormatStyleOptions.rst +++ b/clang/docs/ClangFormatStyleOptions.rst @@ -4781,7 +4781,8 @@ .. _SpaceBeforeJsonColon: **SpaceBeforeJsonColon** (``Boolean``) :versionbadge:`clang-format 17` :ref:`¶ ` - If ``true``, a space will be add before a JSON colon. + If ``true``, a space will be add before a JSON colon. For other languages, + use ``SpacesInContainerLiterals`` instead. .. code-block:: c++ @@ -5099,8 +5100,9 @@ .. _SpacesInContainerLiterals: **SpacesInContainerLiterals** (``Boolean``) :versionbadge:`clang-format 3.7` :ref:`¶ ` - If ``true``, spaces are inserted inside container literals (e.g. - ObjC and Javascript array and dict literals). + If ``true``, spaces are inserted inside container literals (e.g. ObjC and + Javascript array and dict literals). For JSON, use + ``SpaceBeforeJsonColon`` instead. .. code-block:: js diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h --- a/clang/include/clang/Format/Format.h +++ b/clang/include/clang/Format/Format.h @@ -3748,7 +3748,8 @@ /// \version 7 bool SpaceBeforeInheritanceColon; - /// If ``true``, a space will be add before a JSON colon. + /// If ``true``, a space will be add before a JSON colon. For other languages, + /// use ``SpacesInContainerLiterals`` instead. /// \code /// true: false: /// { { @@ -4031,8 +4032,9 @@ /// \version 10 bool SpacesInConditionalStatement; - /// If ``true``, spaces are inserted inside container literals (e.g. - /// ObjC and Javascript array and dict literals). + /// If ``true``, spaces are inserted inside container literals (e.g. ObjC and + /// Javascript array and dict literals). For JSON, use + /// ``SpaceBeforeJsonColon`` instead. /// \code{.js} /// true: false: /// var arr = [ 1, 2, 3 ]; vs. var arr = [1, 2, 3];