[PATCH] D117197: [clang-format] Add new option to support adding a space between Javascript Union and Intersection types

Martin Probst via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 14 01:21:51 PST 2022


mprobst added inline comments.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:3522
+      if ((Left.is(TT_JsTypeOperator) && Right.isTypeOrIdentifier()) ||
+          (Left.isTypeOrIdentifier() || Left.is(TT_TemplateCloser)) &&
+              Right.is(TT_JsTypeOperator))
----------------
Why do we need this further qualification here? I'd have expect that you can simply "return Style.SpacesInJavaScriptUnion;"? identifier || template closer also sounds oddly specific, why exactly those?


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

https://reviews.llvm.org/D117197



More information about the cfe-commits mailing list