MyDeveloperDay 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))
----------------
mprobst wrote:
> 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?
Left = template closer, Right =JsTypeOperator is for this case
```
type Foo = Bar<X> | Baz;
^^^^^
```
Left = type or identifier, Right =JsTypeOperator is for this case
```
let x: A | B = A | B;
^^^^^^^^^
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117197/new/
https://reviews.llvm.org/D117197
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits