[PATCH] D147003: [clang-format] JSON Add ability to add a space before the colon

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 27 15:09:06 PDT 2023


owenpan added a comment.

You need to add `CHECK_PARSE_BOOL(SpaceBeforeJsonColon)` in ConfigParseTest.cpp.



================
Comment at: clang/include/clang/Format/Format.h:3717
 
+  /// If ``true``, a space will be add before a json colon 
+  /// \code
----------------



================
Comment at: clang/lib/Format/TokenAnnotator.cpp:4155
     if (Right.is(tok::colon))
-      return false;
+      return Style.SpaceBeforeJsonColon;
   } else if (Style.isCSharp()) {
----------------
Do we need to check if `Left.is(tok::string_literal)`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147003/new/

https://reviews.llvm.org/D147003



More information about the cfe-commits mailing list