#
b559b438 |
| 01-Nov-2016 |
Daniel Jasper <djasper@google.com> |
clang-format: [JS] Fix incorrect space when "as" is used as identifier.
Before: aaaaa.as ();
After: aaaaa.as();
llvm-svn: 285672
|
#
71e50af6 |
| 01-Nov-2016 |
Daniel Jasper <djasper@google.com> |
clang-format: [JS] Fix formatting of generator functions.
Before: var x = { a: function* () { // } }
After: var x = { a: function*() { // } }
llvm-svn: 285670
|
#
4d67dd77 |
| 01-Nov-2016 |
Daniel Jasper <djasper@google.com> |
clang-format: [JS] Fix space when for is used as regular identifier.
Before: x.for () = 1;
After: x.for() = 1;
llvm-svn: 285669
|
#
eb886635 |
| 31-Oct-2016 |
Daniel Jasper <djasper@google.com> |
clang-format: [JS] Fix missing space after 'yield'.
Before: class X { delete(val) { return null; } * gen() { yield[1, 2]; } * gen() { yield{a: 1}; } };
clang-format: [JS] Fix missing space after 'yield'.
Before: class X { delete(val) { return null; } * gen() { yield[1, 2]; } * gen() { yield{a: 1}; } };
After: class X { delete(val) { return null; } * gen() { yield [1, 2]; } * gen() { yield {a: 1}; } };
llvm-svn: 285569
show more ...
|
#
717f6dcd |
| 21-Oct-2016 |
Martin Probst <martin@probst.io> |
clang-format: [JS] Fix template string ASI.
Summary: Previously, automatic semicolon insertion would add an unwrapped line when a template string contained a line break.
var x = `foo${
clang-format: [JS] Fix template string ASI.
Summary: Previously, automatic semicolon insertion would add an unwrapped line when a template string contained a line break.
var x = `foo${ bar}`;
Would be formatted with `bar...` on a separate line and no indent.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D25675
llvm-svn: 284807
show more ...
|
#
4210d2fd |
| 22-Sep-2016 |
Martin Probst <martin@probst.io> |
clang-format: [JS] reserved words in method names.
Summary: Before: class X { delete () { ... } }
After: class X { delete() { ... } }
Review
clang-format: [JS] reserved words in method names.
Summary: Before: class X { delete () { ... } }
After: class X { delete() { ... } }
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D24804
llvm-svn: 282138
show more ...
|
#
fbbe75b1 |
| 18-Sep-2016 |
Martin Probst <martin@probst.io> |
clang-format: [JS] Do not wrap taze annotation comments.
Summary: `// taze: ... from ...` comments are used help tools where a specific global symbol comes from.
Before: // taze: many, differen
clang-format: [JS] Do not wrap taze annotation comments.
Summary: `// taze: ... from ...` comments are used help tools where a specific global symbol comes from.
Before: // taze: many, different, symbols from // 'some_long_location_here'
After: // taze: many, different, symbols from 'some_long_location_here'
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D24477
llvm-svn: 281857
show more ...
|
#
b9316ff8 |
| 18-Sep-2016 |
Martin Probst <martin@probst.io> |
clang-format: [JS] ASI insertion after boolean literals.
Summary: Before when a semicolon was missing after a boolean literal: a = true return 1;
clang-format would parse this as one line a
clang-format: [JS] ASI insertion after boolean literals.
Summary: Before when a semicolon was missing after a boolean literal: a = true return 1;
clang-format would parse this as one line and format as: a = true return 1;
It turns out that C++ does not consider `true` and `false` to be literals, we have to check for that explicitly.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D24574
llvm-svn: 281856
show more ...
|
#
58209dd9 |
| 17-Sep-2016 |
Daniel Jasper <djasper@google.com> |
clang-format: [JS] Fix a crash in handledTemplateStrings.
llvm-svn: 281816
|
#
28d8a5ab |
| 07-Sep-2016 |
Daniel Jasper <djasper@google.com> |
clang-format: [JavaScript] Change default AllowShortFunctionsOnASingleLine for Google style to "empty".
llvm-svn: 280878
|
#
496c1999 |
| 07-Sep-2016 |
Daniel Jasper <djasper@google.com> |
clang-format: [JavaScript] Do requoting in a separate pass
The attempt to fix requoting behavior in r280487 after changes to tooling::Replacements are incomplete. We essentially need to add to repla
clang-format: [JavaScript] Do requoting in a separate pass
The attempt to fix requoting behavior in r280487 after changes to tooling::Replacements are incomplete. We essentially need to add to replacements at the same position, one to insert a line break and one to change the quoting and that's incompatible with the new tooling::Replacement API, which does not allow for order-dependent Replacements. To make the order clear, Replacements::merge() has to be used, but that requires the merged Replacement to actually refer to the changed text, which is hard to reproduce for the requoting.
This change fixes the behavior by moving the requoting to a completely separate pass. The added benefit is that no weird ColumnWidth calculations are necessary anymore and this should just work even if we implement string literal splitting in the future.
llvm-svn: 280874
show more ...
|
#
34ecf42b |
| 06-Sep-2016 |
Martin Probst <martin@probst.io> |
clang-format: [JS] whitespace required between ! and as.
Summary: Before: x!as string After: x! as string
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https:
clang-format: [JS] whitespace required between ! and as.
Summary: Before: x!as string After: x! as string
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D24272
llvm-svn: 280731
show more ...
|
#
56ff7aaa |
| 06-Sep-2016 |
Martin Probst <martin@probst.io> |
clang-format: [JS] ignore comments when wrapping returns.
Summary: When code contains a comment between `return` and the value:
return /* lengthy comment here */ ( lengthyValueComesHere
clang-format: [JS] ignore comments when wrapping returns.
Summary: When code contains a comment between `return` and the value:
return /* lengthy comment here */ ( lengthyValueComesHere);
Do not wrap before the comment, as that'd break the code through JS' automatic semicolon insertion.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D24257
llvm-svn: 280730
show more ...
|
#
a9855afe |
| 02-Sep-2016 |
Martin Probst <martin@probst.io> |
clang-format: [JS] merge requoting replacements.
Summary: When formatting source code that needs both requoting and reindentation, merge the replacements to avoid erroring out for conflicting replac
clang-format: [JS] merge requoting replacements.
Summary: When formatting source code that needs both requoting and reindentation, merge the replacements to avoid erroring out for conflicting replacements.
Also removes the misleading Replacements parameter from the TokenAnalyzer API.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D24155
llvm-svn: 280487
show more ...
|
#
6181da47 |
| 25-Aug-2016 |
Martin Probst <martin@probst.io> |
clang-format: [JS] nested and tagged template strings.
JavaScript template strings can be nested arbitrarily:
foo = `text ${es.map(e => { return `<${e}>`; })} text`;
This change lexes nested t
clang-format: [JS] nested and tagged template strings.
JavaScript template strings can be nested arbitrarily:
foo = `text ${es.map(e => { return `<${e}>`; })} text`;
This change lexes nested template strings using a stack of lexer states to correctly switch back to template string lexing on closing braces.
Also, reuse the same stack for the token-stashed logic.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D22431
llvm-svn: 279727
show more ...
|
Revision tags: llvmorg-3.9.0, llvmorg-3.9.0-rc3 |
|
#
ed87d788 |
| 22-Aug-2016 |
Martin Probst <martin@probst.io> |
clang-format: [JS] supports casts to types starting with punctuation ("{[(").
Before:
x as{x: number}
After:
x as {x: number}
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differ
clang-format: [JS] supports casts to types starting with punctuation ("{[(").
Before:
x as{x: number}
After:
x as {x: number}
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D23761
llvm-svn: 279436
show more ...
|
#
e1e12a73 |
| 19-Aug-2016 |
Martin Probst <martin@probst.io> |
clang-format: [JS] handle object literals with casts.
Summary: E.g. `{a: 1} as b`.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D23714
llvm
clang-format: [JS] handle object literals with casts.
Summary: E.g. `{a: 1} as b`.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D23714
llvm-svn: 279250
show more ...
|
Revision tags: llvmorg-3.9.0-rc2, llvmorg-3.9.0-rc1 |
|
#
d9d8da28 |
| 12-Jul-2016 |
Daniel Jasper <djasper@google.com> |
clang-format: [JS] Allow top-level conditionals again.
I am not sure exactly which test breakage Martin was trying to fix in r273694. For now, fix the behavior for top-level conditionals, which (sur
clang-format: [JS] Allow top-level conditionals again.
I am not sure exactly which test breakage Martin was trying to fix in r273694. For now, fix the behavior for top-level conditionals, which (surprisingly) are actually used somewhat commonly.
llvm-svn: 275183
show more ...
|
#
4f8d9943 |
| 11-Jul-2016 |
Eric Liu <ioeric@google.com> |
Make tooling::applyAllReplacements return llvm::Expected<string> instead of empty string to indicate potential error.
Summary: return llvm::Expected<> to carry error status and error information. Th
Make tooling::applyAllReplacements return llvm::Expected<string> instead of empty string to indicate potential error.
Summary: return llvm::Expected<> to carry error status and error information. This is the first step towards introducing "Error" into tooling::Replacements.
Reviewers: djasper, klimek
Subscribers: ioeric, klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21601
llvm-svn: 275062
show more ...
|
#
ec3dc988 |
| 24-Jun-2016 |
Martin Probst <martin@probst.io> |
clang-format: [JS] Fix build breakage.
Checking Line.MustBeDeclaration does actually break the field and param initializer use case.
llvm-svn: 273694
|
#
31d6da7c |
| 23-Jun-2016 |
Martin Probst <martin@probst.io> |
clang-format: [JS] handle conditionals in fields, default params.
Summary:
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21658
llvm-svn: 273
clang-format: [JS] handle conditionals in fields, default params.
Summary:
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21658
llvm-svn: 273619
show more ...
|
#
1b7f9804 |
| 23-Jun-2016 |
Martin Probst <martin@probst.io> |
clang-format: [JS] recognize more type locations.
Summary: Includes parenthesized type expressions and type aliases.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: htt
clang-format: [JS] recognize more type locations.
Summary: Includes parenthesized type expressions and type aliases.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21597
llvm-svn: 273603
show more ...
|
#
dce8e417 |
| 22-Jun-2016 |
Martin Probst <martin@probst.io> |
clang-format: [JS] Do not break before 'as'.
Summary: 'as' is a pseudo operator, so automatic semicolon insertion kicks in and the code fails to part.
Reviewers: djasper
Subscribers: klimek
Diffe
clang-format: [JS] Do not break before 'as'.
Summary: 'as' is a pseudo operator, so automatic semicolon insertion kicks in and the code fails to part.
Reviewers: djasper
Subscribers: klimek
Differential Revision: http://reviews.llvm.org/D21576
llvm-svn: 273422
show more ...
|
#
887a3994 |
| 14-Jun-2016 |
Daniel Jasper <djasper@google.com> |
clang-format: [JS] Fix failing format with TypeScript casts.
Before, this could be formatted at all (with BracketAlignmentStyle AlwaysBreak):
foo = <Bar[]>[ 1, /* */ 2 ];
llvm-svn: 272
clang-format: [JS] Fix failing format with TypeScript casts.
Before, this could be formatted at all (with BracketAlignmentStyle AlwaysBreak):
foo = <Bar[]>[ 1, /* */ 2 ];
llvm-svn: 272668
show more ...
|
#
6465008e |
| 14-Jun-2016 |
Daniel Jasper <djasper@google.com> |
clang-format: [JS] Support annotated classes.
llvm-svn: 272654
|