]> granicus.if.org Git - clang/commit
clang-format: [JS] allow breaking after non-null assertions.
authorMartin Probst <martin@probst.io>
Mon, 13 Mar 2017 09:14:23 +0000 (09:14 +0000)
committerMartin Probst <martin@probst.io>
Mon, 13 Mar 2017 09:14:23 +0000 (09:14 +0000)
commit1f562e750841ffdb76b1444063f351a86f7a5ce5
tree3bdf6c66f8779f80857f1debb5fbebafec1cb7fc
parent6b5ac5c7659e39717a525c3858f269875ab98665
clang-format: [JS] allow breaking after non-null assertions.

Summary:
Previously clang-format would not break after any !. However in TypeScript, ! can be used as a post fix operator for non-nullability:
    x.foo()!.bar()!;

With this change, clang-format will wrap after the ! if it is likely a post-fix non null operator.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297606 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp