]> granicus.if.org Git - clang/commit
clang-format: [JS] revert over-eager ASI check.
authorMartin Probst <martin@probst.io>
Mon, 16 Jan 2017 09:52:40 +0000 (09:52 +0000)
committerMartin Probst <martin@probst.io>
Mon, 16 Jan 2017 09:52:40 +0000 (09:52 +0000)
commit883044a3f4d214eaa371fb78c04a543c36aa65cf
tree5ad5532732c9ebe68e5b6c6f3ec9920d5be86ced
parent16ba0232fbfb3a278c56d37531196ef2967950be
clang-format: [JS] revert over-eager ASI check.

Summary: Change r291428 introduced ASI detection after closing curly braces. That would generally be correct, however this breaks indentation for structural statements. What happens is that CompoundStatementIndenter increases indentation for the current line, then after reading ASI creates a new line (with the increased line level), and only after the structural parser sees e.g. the if/then/else branch closed, line level is reduced. That leads to the new line started by ASI having a level too high.

Reviewers: djasper

Subscribers: sammccall, cfe-commits, klimek

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

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