[PATCH] D73768: clang-format: [JS] document InsertTrailingCommas.
Martin Probst via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 31 01:27:35 PST 2020
mprobst created this revision.
mprobst added a reviewer: MyDeveloperDay.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
In release notes and the regular docs.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D73768
Files:
clang/docs/ClangFormatStyleOptions.rst
clang/docs/ReleaseNotes.rst
Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -172,6 +172,11 @@
}
}
+- Option ``InsertTrailingCommas`` can be set to ``TCS_Wrapped`` to insert
+ trailing commas in container literals (arrays and objects) that wrap across
+ multiple lines. It is currently only available for JavaScript and disabled by
+ default (``TCS_None``).
+
libclang
--------
Index: clang/docs/ClangFormatStyleOptions.rst
===================================================================
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -717,6 +717,26 @@
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
}
+
+**InsertTrailingCommas** (``TrailingCommaStyle``) can be set to ``TCS_Wrapped``
+ to insert trailing commas in container literals (arrays and objects) that wrap
+ across multiple lines. It is currently only available for JavaScript and
+ disabled by default (``TCS_None``).
+
+ ``InsertTrailingCommas`` cannot be used together with ``BinPackArguments`` as
+ inserting the comma disables bin-packing.
+
+ .. code-block:: c++
+
+ TSC_Wrapped:
+ const someArray = [
+ aaaaaaaaaaaaaaaaaaaaaaaaaa,
+ aaaaaaaaaaaaaaaaaaaaaaaaaa,
+ aaaaaaaaaaaaaaaaaaaaaaaaaa,
+ // ^ inserted
+ ]
+
+
**BinPackParameters** (``bool``)
If ``false``, a function declaration's or function definition's
parameters will either all be on the same line or will have one line each.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73768.241650.patch
Type: text/x-patch
Size: 1594 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200131/e6830bec/attachment-0001.bin>
More information about the cfe-commits
mailing list