]> granicus.if.org Git - clang/commit
clang-format: [JS] Add a special case for indenting function literals.
authorDaniel Jasper <djasper@google.com>
Thu, 18 Jun 2015 12:32:59 +0000 (12:32 +0000)
committerDaniel Jasper <djasper@google.com>
Thu, 18 Jun 2015 12:32:59 +0000 (12:32 +0000)
commit86b6cb7ed1b613f4cf69408678eb039b2a2b7a3c
tree11307c686dc46a19dfd9bcf7926c3761570b1ca2
parent9080c07f6d1de344eb9d0585a1ca388e70a14d83
clang-format: [JS] Add a special case for indenting function literals.

Before:
  var func =
      function() {
        doSomething();
      };

After:
  var func =
      function() {
    doSomething();
  };

This is a very narrow special case which fixes most of the discrepency
with what our users do. In the long run, we should try to come up with
a more generic fix for indenting these.

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