summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
Commit message (Collapse)AuthorAgeFilesLines
...
* clang-format: Enable include sorting for style=ChromiumNico Weber2017-02-241-1/+0
| | | | llvm-svn: 296161
* clang-format: Fix many Objective-C formatting regressions from r289428Nico Weber2017-02-245-22/+13
| | | | | | | | | | | | | | | r289428 added a separate language kind for Objective-C, but kept many "Language == LK_Cpp" checks untouched. This introduced a "IsCpp()" method that returns true for both C++ and Objective-C++, and replaces all comparisons of Language with LK_Cpp with calls to this new method. Also add a lot more test coverge for formatting things in LK_ObjC mode, by having FormatTest's verifyFormat() test for LK_ObjC everything that's being tested for LK_Cpp at the moment. Fixes PR32060 and many other things. llvm-svn: 296160
* [clang-format] Remove unused member variables from BreakableTokenKrasimir Georgiev2017-02-212-20/+6
| | | | llvm-svn: 295714
* clang-format: [JS] Improve line-wrapping behavior of template strings.Daniel Jasper2017-02-203-5/+22
| | | | | | | | Specifically, similar to other blocks, clang-format now wraps both after "${" and before the corresponding "}", if the contained expression spans multiple lines. llvm-svn: 295663
* clang-format: Prevent weird line-wraps in complex lambda introducersDaniel Jasper2017-02-201-0/+2
| | | | | | | | | | | | | | | | | | | Before: aaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]() -> ::std:: unordered_set<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa> { // }); After: aaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]() -> ::std::unordered_set< aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa> { // }); llvm-svn: 295659
* clang-format: [JS/TS] Improve detection for array subscripts in types.Daniel Jasper2017-02-201-0/+3
| | | | | | | | | | | | Before: var someValue = (v as aaaaaaaaaaaaaaaaaaaa<T>[ ]).someFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); After: var someValue = (v as aaaaaaaaaaaaaaaaaaaa<T>[]) .someFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 295658
* clang-format: Don't remove existing spaces between identifier and ::.Daniel Jasper2017-02-171-3/+7
| | | | | | | | | | | | | | | | | | | | This can lead to bad behavior with macros that are used to annotate functions (e.g. ALWAYS_INLINE). Before, this: ALWAYS_INLINE ::std::string getName() ... was turned into: ALWAYS_INLINE::std::string getName() ... If it turns out that clang-format is failing to clean up a lot of the existing spaces now, we can add more analyses of the identifier. It should not currently. Cases where clang-format breaks nested name specifiers should be fine as clang-format wraps after the "::". Thus, a line getting longer and then shorter again should lead to the same original code. llvm-svn: 295437
* [clang-format] Align block comment decorationsKrasimir Georgiev2017-02-162-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements block comment decoration alignment. source: ``` /* line 1 * line 2 */ ``` result before: ``` /* line 1 * line 2 */ ``` result after: ``` /* line 1 * line 2 */ ``` Reviewers: djasper, bkramer, klimek Reviewed By: klimek Subscribers: mprobst, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D29943 llvm-svn: 295312
* clang-format: don't break code using __has_include, PR31908Nico Weber2017-02-102-1/+25
| | | | llvm-svn: 294772
* [clang-format] Fix typo in comment.Krasimir Georgiev2017-02-091-1/+1
| | | | llvm-svn: 294570
* [clang-format] Move OriginalPrefix from base to subclass.Krasimir Georgiev2017-02-081-4/+8
| | | | | | | | | | | | | | | | Summary: OriginalPrefix is only needed for line comment sections. Moved from the base class to the child class. No functional changes. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D29716 llvm-svn: 294457
* [clang-format] Break before a sequence of line comments aligned with the ↵Krasimir Georgiev2017-02-082-12/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | next line. Summary: Make the comment alignment respect sections of line comments originally alinged with the next token. Until now the decision how to break a continuous sequence of line comments into sections was taken without reference to the next token. source: ``` class A { public: // comment about public // comment about a int a; } ``` format before: ``` class A { public: // comment about public // comment about a int a; } ``` format after: ``` class A { public: // comment about public // comment about a int a; } ``` Reviewers: djasper, klimek Reviewed By: klimek Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D29626 llvm-svn: 294435
* clang-format: Fix bad variable declaration detection.Daniel Jasper2017-02-071-1/+5
| | | | | | | | | | | | Before: LooooooooooooooooongType variable(nullptr, [](A *a) {}); After: LooooooooooooooooongType variable(nullptr, [](A *a) {}); llvm-svn: 294358
* clang-format: [JS] correcly format object literal methods.Martin Probst2017-02-072-8/+18
| | | | | | | | | | | | | | | | | | | | | Summary: In JavaScript, object literals can contain methods: var x = { a() { return 1; }, }; Previously, clang-format always parsed nested {} inside a braced list as further braced lists. Special case this logic for JavaScript to try parsing as a braced list, but fall back to parsing as a child block. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D29656 llvm-svn: 294315
* clang-format: [JS] exclaim preceding regex literals.Martin Probst2017-02-071-1/+3
| | | | | | | | | | | | | | | | | | | | Summary: Regex detection would incorrectly classify a trailing `!` operator (nullability cast) followed by a `/` as the start of a regular expression literal. This fixes code such as: var foo = x()! / 10; Which would previously parse a regexp all the way to the end of the source file (or next `/`). Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D29634 llvm-svn: 294304
* clang-format: [JS] handle parenthesized class expressions.Martin Probst2017-02-072-7/+20
| | | | | | | | | | | | | | | | | | | | Summary: In JavaScript, classes are expressions, so they can appear e.g. in argument lists. var C = foo(class { bar() { return 1; } }; Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D29635 llvm-svn: 294302
* clang-format: Fix bug with conflicting BreakBeforeBinaryOperations and ↵Daniel Jasper2017-02-061-1/+2
| | | | | | | | | | | | | | | | AlignAfterOpenBracket Fix for the formatting options combination of BreakBeforeBinaryOperators: All, AlignAfterOpenBracket: AlwaysBreak not handling long templates correctly. This patch allows a break after an opening left parenthesis, TemplateOpener, or bracket when both options are enabled. Patch by Daphne Pfister, thank you! Fixes llvm.org/PR30304. llvm-svn: 294179
* clang-format: [JS] Fix bugs in parsing and aligning template strings.Daniel Jasper2017-02-032-3/+5
| | | | llvm-svn: 294009
* [clang-format] Re-align broken comment lines where appropriate.Krasimir Georgiev2017-02-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The comment aligner was skipping over newly broken comment lines. This patch fixes that. source: ``` int ab; // line int a; // long long ``` format with column limit 15 before: ``` int ab; // line int a; // long // long ``` format with column limit 15 after: ``` int ab; // line int a; // long // long ``` Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D29486 llvm-svn: 293997
* clang-format: [Proto] Also supports implicit string literal concatenationDaniel Jasper2017-02-031-1/+2
| | | | llvm-svn: 293995
* [clang-format] Don't reflow across comment pragmas.Krasimir Georgiev2017-02-025-22/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The comment reflower wasn't taking comment pragmas as reflow stoppers. This patch fixes that. source: ``` // long long long long // IWYU pragma: ``` format with column limit = 20 before: ``` // long long long // long IWYU pragma: ``` format with column limit = 20 after: ``` // long long long // long // IWYU pragma: ``` Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D29450 llvm-svn: 293898
* [clang-format] Fix breaking of comment sections in unwrapped lines ↵Krasimir Georgiev2017-02-023-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | containing newlines. Summary: The breaking of line comment sections was misaligning the case where the first comment line is on an unwrapped line containing newlines. In this case, the breaking column must be based on the source column of the last token that is preceded by a newline, not on the first token of the unwrapped line. source: ``` enum A { a, // line 1 // line 2 }; ``` format before: ``` enum A { a, // line 1 // line 2 }; ``` format after: ``` enum A { a, // line 1 // line 2 }; ``` Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D29444 llvm-svn: 293891
* [clang-format] Don't reflow lines starting with TODO, FIXME or XXX.Krasimir Georgiev2017-02-021-3/+12
| | | | | | | | | | | | | | Summary: These lines commonly carry a special meaning. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D29396 llvm-svn: 293878
* clang-format: Do not use two-argument/operand special case with no alignmentDaniel Jasper2017-02-021-1/+1
| | | | | | | | | | | | | | | | | Without alignment, there is no clean separation between the arguments, even if there are only two. Before: aaaaaaaaaaaaaa( aaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); After: aaaaaaaaaaaaaa(aaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 293875
* clang-format: Fix incorrect line breaks after forced operator wraps.Daniel Jasper2017-02-011-1/+1
| | | | | | | | | | | | | | | | | Before: bool x = aaaaa // || bbbbb // || cccc; After: bool x = aaaaa // || bbbbb // || cccc; llvm-svn: 293839
* [clang-format] Fix regression about not aligning trailing comments in case ↵Krasimir Georgiev2017-02-011-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | they were previously aligned, but at different indent. Summary: Comment reflower was adding untouchable tokens in case two consecutive comment lines are aligned in the source code. This disallows the whitespace manager to re-indent them later. source: ``` int i = f(abc, // line 1 d, // line 2 // line 3 b); ``` Since line 2 and line 3 are aligned, the reflower was marking line 3 as untouchable; however the three comment lines need to be re-aligned. output before: ``` int i = f(abc, // line 1 d, // line 2 // line 3 b); ``` output after: ``` int i = f(abc, // line 1 d, // line 2 // line 3 b); ``` Reviewers: djasper Reviewed By: djasper Subscribers: sammccall, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D29383 llvm-svn: 293755
* clang-format: Don't force-wrap multiline RHSs for 2-operand experssions.Daniel Jasper2017-02-011-1/+6
| | | | | | | | | | | | | | | | | | | | This rows back on r288120, r291801 and r292110. I apologize in advance for the churn. All of those revisions where meant to make the wrapping of RHS expressions more consistent. However, now that they are consistent, we seem to be a bit too eager. The reasoning here is that I think it is generally correct that we want to line-wrap before multiline RHS expressions (or multiline arguments to a function call). However, if there are only two of such operands or arguments, there is always a clear vertical separation between them and the additional line break seems much less desirable. Somewhat good examples are expressions like: EXPECT_EQ(2, someLongExpression( orCall)); llvm-svn: 293752
* Keep Chromium ObjC column limit at 80 for consistency with C++Nico Weber2017-01-311-0/+2
| | | | | | | https://reviews.llvm.org/D29337 Patch from Dan Beam <dbeam@chromium.org>! llvm-svn: 293675
* [clang-format] Fix regression about adding leading whitespace to the content ↵Krasimir Georgiev2017-01-311-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of line comments Summary: The reflower didn't measure precisely the line column of a line in the middle of a line comment section that has a prefix that needs to be adapted. source: ``` /// a //b ``` format before: ``` /// a //b ``` format after: ``` /// a // b ``` Reviewers: djasper Reviewed By: djasper Subscribers: sammccall, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D29329 llvm-svn: 293641
* clang-format: [JS] Indent expressions in ${} relative to their surroundingDaniel Jasper2017-01-311-2/+13
| | | | | | | | | | | | | | | | | | | | This only affects expressions inside ${} scopes of template strings. Here, we want to indent relative to the surrounding template string and not the surrounding expression. Otherwise, this can create quite a mess. Before: var f = ` aaaaaaaaaaaaaaaaaa: ${someFunction( aaaaa + // bbbb)}`; After: var f = ` aaaaaaaaaaaaaaaaaa: ${someFunction( aaaaa + // bbbb)}`; llvm-svn: 293636
* [clang-format] Fix reflow in block comment lines with leading whitespace.Krasimir Georgiev2017-01-311-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The reflower was not taking into account the additional leading whitespace in block comment lines. source: ``` { /* * long long long long * long * long long long long */ } ``` format (with column limit 20) before: ``` { /* * long long long * long long long long * long long */ } ``` format after: ``` { /* * long long long * long long long * long long long */ } ``` Reviewers: djasper, klimek Reviewed By: djasper Subscribers: cfe-commits, sammccall, klimek Differential Revision: https://reviews.llvm.org/D29326 llvm-svn: 293633
* [clang-format] Fix regression merging comments across newlines.Krasimir Georgiev2017-01-312-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes a regression that causes example: ``` enum A { a, // line a // line b b }; ``` to be formatted as follows: ``` enum A { a, // line a // line b b }; ``` Reviewers: djasper, klimek Reviewed By: klimek Subscribers: cfe-commits, sammccall, djasper, klimek Differential Revision: https://reviews.llvm.org/D29322 llvm-svn: 293624
* clang-format: [JS] Properly set scopes inside template strings.Daniel Jasper2017-01-312-1/+7
| | | | | | | | | | | | | Before: var f = `aaaaaaaaaaaaa:${aaaaaaa .aaaaa} aaaaaaaa aaaaaaaaaaaaa:${aaaaaaa.aaaaa} aaaaaaaa`; After: var f = `aaaaaaaaaaaaa:${aaaaaaa.aaaaa} aaaaaaaa aaaaaaaaaaaaa:${aaaaaaa.aaaaa} aaaaaaaa`; llvm-svn: 293622
* clang-format: [JS] Fix incorrect line break in template strings.Daniel Jasper2017-01-311-3/+5
| | | | | | | | | | | Before: var f = `aaaa ${a ? 'a' : 'b' }`; After: var f = `aaaa ${a ? 'a' : 'b'}`; llvm-svn: 293618
* [clang-format] Don't reflow comment lines starting with '@'.Krasimir Georgiev2017-01-311-1/+3
| | | | | | | | | | | | | | | | Summary: This patch stops reflowing comment lines starting with '@', since they commonly have a special meaning. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D29323 llvm-svn: 293617
* [clang-format] Refactor WhitespaceManager and friendsDaniel Jasper2017-01-3110-211/+182
| | | | | | | | | | | | | | | | | | | The main motivation behind this is to cleanup the WhitespaceManager and make it more extensible for future alignment etc. features. Specifically, WhitespaceManager has started to copy more and more code that is already present in FormatToken. Instead, I think it makes more sense to actually store a reference to each FormatToken for each change. This has as a consequence led to a change in the calculation of indent levels. Now, we actually compute them for each Token ahead of time, which should be more efficient as it removes an unsigned value for the ParenState, which is used during the combinatorial exploration of the solution space. No functional changes intended. Review: https://reviews.llvm.org/D29300 llvm-svn: 293616
* [clang-format] Fix regression that breaks comments without a comment prefixKrasimir Georgiev2017-01-301-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Consider formatting the following code fragment with column limit 20: ``` { // line 1 // line 2\ // long long long line } ``` Before this fix the output is: ``` { // line 1 // line 2\ // long long long line } ``` This patch fixes a regression that breaks the last comment line without adding the '//' prefix. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D29298 llvm-svn: 293548
* [clang-format] Separate line comment sections after a right brace from ↵Krasimir Georgiev2017-01-301-7/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | comment sections in the scope. Summary: The following two comment lines form a single comment section: ``` if (1) { // line 1 // line 2 } ``` This is because the break of a comment section was based on the original column of the first token of the previous line (in this case, the 'if'). This patch splits these two comment lines into different sections by taking into account the original column of the right brace preceding the first line comment where applicable. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D29291 llvm-svn: 293539
* clang-format: [JavaScript] Undo r291974 for JavaScript.Daniel Jasper2017-01-301-1/+8
| | | | | | | | | | | | | | | | | | | | | This had significant negative consequences and I don't have a good solution for it yet. Before: var string = [ 'aaaaaa', 'bbbbbb', ] .join('+'); After: var string = [ 'aaaaaa', 'bbbbbb', ].join('+'); llvm-svn: 293465
* clang-format: [JS] do not format MPEG transport streams.Martin Probst2017-01-271-1/+12
| | | | | | | | | | | | | | | Summary: The MPEG transport stream file format also uses ".ts" as its file extension. This change detects its specific framing format (0x47 every 189 bytes) and simply ignores MPEG TS files. Reviewers: djasper, sammccall Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D29186 llvm-svn: 293270
* [clang-format] Implement comment reflowing.Krasimir Georgiev2017-01-259-289/+891
| | | | | | | | | | | | | | | | | | Summary: This presents a version of the comment reflowing with less mutable state inside the comment breakable token subclasses. The state has been pushed into the driving breakProtrudingToken method. For this, the API of BreakableToken is enriched by the methods getSplitBefore and getLineLengthAfterSplitBefore. Reviewers: klimek Reviewed By: klimek Subscribers: djasper, klimek, mgorny, cfe-commits, ioeric Differential Revision: https://reviews.llvm.org/D28764 llvm-svn: 293055
* clang-format: fix fallback style set to "none" not always formattingAntonio Maiorano2017-01-201-6/+6
| | | | | | | | | | | This fixes clang-format not formatting if fallback-style is explicitly set to "none", and either a config file is found or YAML is passed in without a "BasedOnStyle". With this change, passing "none" in these cases will have no affect, and LLVM style will be used as the base style. Differential Revision: https://reviews.llvm.org/D28844 llvm-svn: 292562
* clang-format: Make GetStyle return Expected<FormatStyle> instead of FormatStyleAntonio Maiorano2017-01-171-35/+29
| | | | | | | | | | Change the contract of GetStyle so that it returns an error when an error occurs (i.e. when it writes to stderr), and only returns the fallback style when it can't find a configuration file. Differential Revision: https://reviews.llvm.org/D28081 llvm-svn: 292174
* clang-format: Always wrap before multi-line parameters/operands.Daniel Jasper2017-01-162-28/+46
| | | | | | | | | | | | | | | | | Before: aaaaaaaaaaaaaaaaaa(aaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaa); After: aaaaaaaaaaaaaaaaaa(aaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaa); No new test cases, as the existing ones cover this fairly well. llvm-svn: 292110
* clang-format: [JS] revert over-eager ASI check.Martin Probst2017-01-161-2/+1
| | | | | | | | | | | | 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 llvm-svn: 292099
* clang-format: Fix bug in making line break decisions.Daniel Jasper2017-01-131-5/+5
| | | | | | | | | | | | | | | | | | | | | Here, the optimization to not line wrap when it would not lead to a reduction in columns was overwriting and enforced break that we want to do no matter what. Before: int i = someFunction( aaaaaaa, 0).aaa(aaaaaaaaaaaaa) * aaaaaaa + aaaaaaa; After: int i = someFunction(aaaaaaa, 0) .aaa(aaaaaaaaaaaaa) * aaaaaaa + aaaaaaa; llvm-svn: 291974
* clang-format: Fix regression introduced by r291801.Daniel Jasper2017-01-121-8/+4
| | | | | | | | | | | | | | Uncovered by polly tests. Before: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaa, {}, aaaaaaaaaaaaaaaaaaaaaaa); After: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaa, {}, aaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 291807
* clang-format: Treat braced lists like other complex parameters.Daniel Jasper2017-01-121-0/+7
| | | | | | | | | | | | | | | | | Specifically, wrap before them if they are multi-line so that we don't create long hanging indents. This prevents having a lot of code indented a lot in some cases. Before: someFunction(Param, {List1, List2, List3}); After: someFunction(Param, {List1, List2, List3}); llvm-svn: 291801
* clang-format: Improve support for override/final as variable names.Daniel Jasper2017-01-091-6/+4
| | | | | | | | | | | | | | | | Before: bool a = f() &&override.f(); bool a = f() &&final.f(); void f(const MyOverride & override); void f(const MyFinal & final); After: bool a = f() && override.f(); bool a = f() && final.f(); void f(const MyOverride &override); void f(const MyFinal &final); llvm-svn: 291434
* clang-format: [JS] ASI after importsMartin Probst2017-01-091-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Automatic semicolon insertion should break import and export statements: Before, this would format on one line: // Note: no semi after 'x' below! import {x} from 'x' export function foo() {} Into: import {x} from 'x' export function foo() {} With this change, the statements get separated. This also improves automatic semicolon insertion to consider closing braces preceding declarations and statements. Reviewers: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28465 llvm-svn: 291428
OpenPOWER on IntegriCloud