diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Format/Format.cpp | 5 | ||||
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 7 |
2 files changed, 10 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; diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 828250602be..62d7ec86c91 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -1611,6 +1611,13 @@ TEST_F(FormatTestJS, JSDocAnnotations) { " * @param {this.is.a.long.path.to.a.Type}\n" " */", getGoogleJSStyleWithColumns(20)); + verifyFormat("/**\n" + " * @see http://very/very/long/url/is/long\n" + " */", + "/**\n" + " * @see http://very/very/long/url/is/long\n" + " */", + getGoogleJSStyleWithColumns(20)); verifyFormat( "/**\n" " * @param This is a\n" |