summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2017-03-13 09:39:23 +0000
committerMartin Probst <martin@probst.io>2017-03-13 09:39:23 +0000
commitb4cdb65e5fbf5e50999e2b8a6dedf57da4ae98e5 (patch)
treefc52ed1325dfb1edf62a96340ad4011f7f0f0c50 /clang/lib/Format
parent22b8d2692453ab29c0c1d3b24e3994fc4dcc5426 (diff)
downloadbcm5719-llvm-b4cdb65e5fbf5e50999e2b8a6dedf57da4ae98e5.tar.gz
bcm5719-llvm-b4cdb65e5fbf5e50999e2b8a6dedf57da4ae98e5.zip
clang-format: [JS] do not wrap @see tags.
Summary: @see is special among JSDoc tags in that it is commonly followed by URLs. The JSDoc spec suggests that users should wrap URLs in an additional {@link url...} tag (@see http://usejsdoc.org/tags-see.html), but this is very commonly violated, with @see being followed by a "naked" URL. This change special cases all JSDoc lines that contain an @see not to be wrapped to account for that. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D30883 llvm-svn: 297607
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/Format.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 07624620d01..9bb2a97ce5c 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -624,8 +624,9 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) {
GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty;
GoogleStyle.AlwaysBreakBeforeMultilineStrings = false;
GoogleStyle.BreakBeforeTernaryOperators = false;
- // taze:, and @tag followed by { for a lot of JSDoc tags.
- GoogleStyle.CommentPragmas = "(taze:|(@[A-Za-z_0-9-]+[ \\t]*{))";
+ // taze:, @tag followed by { for a lot of JSDoc tags, and @see, which is
+ // commonly followed by overlong URLs.
+ GoogleStyle.CommentPragmas = "(taze:|(@[A-Za-z_0-9-]+[ \\t]*{)|@see)";
GoogleStyle.MaxEmptyLinesToKeep = 3;
GoogleStyle.NamespaceIndentation = FormatStyle::NI_All;
GoogleStyle.SpacesInContainerLiterals = false;
OpenPOWER on IntegriCloud