[all-commits] [llvm/llvm-project] 2dbcbd: [clang-format] do not break before { in JS comments

Krasimir Georgiev via All-commits all-commits at lists.llvm.org
Fri Nov 6 01:35:49 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2dbcbd357d1da1adf9c512d150e68424faa46d75
      https://github.com/llvm/llvm-project/commit/2dbcbd357d1da1adf9c512d150e68424faa46d75
  Author: Krasimir Georgiev <krasimir at google.com>
  Date:   2020-11-06 (Fri, 06 Nov 2020)

  Changed paths:
    M clang/lib/Format/BreakableToken.cpp
    M clang/unittests/Format/FormatTestJS.cpp

  Log Message:
  -----------
  [clang-format] do not break before { in JS comments

In JavaScript some @tags can be followed by `{`, and machinery that parses
these comments will fail to understand the comment if followed by a line break.

clang-format already handles this case by not breaking before `{` in comments.
However this was not working in cases when the column limit falls within `@tag`
or between `@tag` and `{`. This adapts clang-format for this case.

Reviewed By: mprobst

Differential Revision: https://reviews.llvm.org/D90908




More information about the All-commits mailing list