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

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 13 00:56:17 PST 2022


MyDeveloperDay created this revision.
MyDeveloperDay added reviewers: mprobst, krasimir, HazardyKnusperkeks, curdeius, owenpan.
MyDeveloperDay added projects: clang, clang-format.
MyDeveloperDay requested review of this revision.

https://github.com/llvm/llvm-project/issues/49858

The following issue highlights a problem where we cannot add a space between A|B when detecting a JSTypeOperator

This patch allows clang-format to be configured to support that (which seems to match most references I can find)

https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types
https://flow.org/en/docs/types/intersections/

Fixes: #49858


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117197

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/Format.cpp
  clang/lib/Format/TokenAnnotator.cpp
  clang/unittests/Format/FormatTest.cpp
  clang/unittests/Format/FormatTestJS.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117197.399573.patch
Type: text/x-patch
Size: 5804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220113/d4a05f55/attachment-0001.bin>


More information about the cfe-commits mailing list