| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21658
llvm-svn: 273619
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Includes parenthesized type expressions and type aliases.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21597
llvm-svn: 273603
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
enum Type {
UNKNOWN = 0 [(some_options) = {
a: aa,
b: bb
}];
};
After:
enum Type {
UNKNOWN = 0 [(some_options) = {a: aa, b: bb}];
};
llvm-svn: 273553
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 273196
|
|
|
|
| |
llvm-svn: 273179
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: do not add existing includes.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21323
llvm-svn: 272669
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before, this could be formatted at all (with BracketAlignmentStyle
AlwaysBreak):
foo = <Bar[]>[
1, /* */
2
];
llvm-svn: 272668
|
|
|
|
| |
llvm-svn: 272654
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: There's no convention of avoiding the nested indentation.
Reviewers: djasper
Subscribers: klimek, alexeagle, cfe-commits
Differential Revision: http://reviews.llvm.org/D21275
llvm-svn: 272559
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
When turned on, clang-format wraps JavaScript imports (and importing exports),
instead of forcing the entire import statement onto one line.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21273
llvm-svn: 272558
|
|
|
|
|
|
|
|
|
|
|
|
| |
Seems this isn't generally desirable.
Before:
int const * a;
After:
int const* a;
llvm-svn: 272548
|
|
|
|
|
|
|
|
|
|
| |
Before:
returnsFunction (¶m1, ¶m2)(param);
After:
returnsFunction(¶m1, ¶m2)(param);
llvm-svn: 272538
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before (when aligning & to the right):
SomeType MemberFunction(const Deleted &) const&;
After:
SomeType MemberFunction(const Deleted &) const &;
This also applies to variable declarations, e.g.:
int const * a;
However, this form is very uncommon (most people would write
"const int* a" instead) and contracting to "const*" might actually send
the wrong signal of what the const binds to.
llvm-svn: 272537
|
|
|
|
|
|
|
|
|
|
| |
Before:
auto s = sizeof...(Ts)-1;
After:
auto s = sizeof...(Ts) - 1;
llvm-svn: 272536
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
[]() //
-> int {
return 1; //
};
After:
[]() //
-> int {
return 1; //
};
llvm-svn: 272535
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Do not insert whitespace preceding the "!" postfix operator. This is an
incomplete fix, but should cover common usage.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D21204
llvm-svn: 272524
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This also fixes union type formatting in function parameter types.
Before: function x(path: number| string) {}
After: function x(path: number|string) {}
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21206
llvm-svn: 272330
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The JavaScript import sorter has a corner condition that can cause the overall
source text length to shrink. This change circumvents the issue by appending
trailing space in the line after the import blocks to match at least the
previous source code length.
This needs a better long term fix, but this fixes the immediate issue.
Reviewers: alexeagle, djasper
Subscribers: klimek
Differential Revision: http://reviews.llvm.org/D21108
llvm-svn: 272142
|
|
|
|
|
|
| |
This could lead to column limit violations.
llvm-svn: 272125
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
.. and simplify it.
Before:
void A::f()&& {}
void f() && {}
After:
void A::f() && {}
void f() && {}
llvm-svn: 272124
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: make header guard identification stricter with Lexer.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D20959
llvm-svn: 271883
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
inserting new headers.
Summary:
[clang-format] skip empty lines and comments in the top of the code when inserting new headers.
Pair-programmed with @hokein
Reviewers: djasper
Subscribers: ioeric, cfe-commits, hokein, klimek
Differential Revision: http://reviews.llvm.org/D20898
llvm-svn: 271664
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: ASI did not handle the ES6 `as` operator correctly.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D20817
llvm-svn: 271401
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: E.g. sort `import {b, a} from 'x';` into `import {a, b} from 'x';`.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D20798
llvm-svn: 271400
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replacement with cleanupAroundReplacements().
Summary:
When a replacement's offset is set to UINT_MAX or -1U, it is treated as
a header insertion replacement by cleanupAroundReplacements(). The new #include
directive is then inserted into the correct block.
Reviewers: klimek, djasper
Subscribers: klimek, cfe-commits, bkramer
Differential Revision: http://reviews.llvm.org/D20734
llvm-svn: 271276
|
|
|
|
| |
llvm-svn: 271191
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Shebang lines (`#!/bin/blah`) can be used in JavaScript scripts to indicate
they should be run using e.g. node. This change treats # lines on the first line
as line comments.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D20632
llvm-svn: 271185
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Only treat the sequence `async function` as the start of a function expression,
as opposed to every occurrence of the token `async` (whoops).
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D20737
llvm-svn: 271184
|
|
|
|
|
|
|
| |
While it might change the meaning of the comment in rare circumstances,
it is better than violating the column limit.
llvm-svn: 270975
|
|
|
|
|
|
| |
FormatTest.cpp to CleanUpTest.cpp.
llvm-svn: 270971
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This change automatically sorts ES6 imports and exports into four groups:
absolute imports, parent imports, relative imports, and then exports. Exports
are sorted in the same order, but not grouped further.
To keep JS import sorting out of Format.cpp, this required extracting the
TokenAnalyzer infrastructure to separate header and implementation files.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D20198
llvm-svn: 270203
|
|
|
|
|
|
|
|
| |
Otherwise, clang-format can get confused with statements like:
x.for = 1;
llvm-svn: 270188
|
|
|
|
|
|
|
|
|
|
| |
Before:
const[a, b, c] = [1, 2, 3];
After:
const [a, b, c] = [1, 2, 3];
llvm-svn: 270029
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
#define MACRO(a) \
if (a) { \
f(); \
} else \
g()
After:
#define MACRO(a) \
if (a) { \
f(); \
} else \
g()
llvm-svn: 270028
|
|
|
|
|
|
|
|
|
|
| |
Before:
case a... b: break;
After:
case a ... b: break;
llvm-svn: 270027
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: [clang-format] Make formatReplacements() also sort #includes.
Reviewers: bkramer, djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D20362
llvm-svn: 269924
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
colon in constructor initializer.
Summary: Make clang-format cleaner remove redundant commas/colons in constructor initializer list.
Reviewers: klimek, djasper
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D19804
llvm-svn: 269888
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Simply looking at the final text greatly simplifies the algorithm and also
fixes a reported issue. This requires duplicating the "actual encoding width"
logic, but that seems cleaner than the column acrobatics before.
Reviewers: djasper, bkramer
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D20208
llvm-svn: 269747
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D20200
llvm-svn: 269282
|
|
|
|
|
|
|
|
|
|
| |
Before:
f(/*a=*/a, /*b=*/ ::b);
After:
f(/*a=*/a, /*b=*/::b);
llvm-svn: 268879
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
template <enum E> class A { public : E *f(); };
After:
template <enum E> class A {
public:
E *f();
};
llvm-svn: 268878
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
redundant code.
Summary:
After applying replacements, redundant code like extra commas or empty namespaces
might be introduced. Fixer can detect and remove any redundant code introduced by replacements.
The current implementation only handles redundant commas.
Reviewers: djasper, klimek
Subscribers: ioeric, mprobst, klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D18551
llvm-svn: 267416
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For generators, see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_generators
async functions are not quite in the spec yet, but stage 3 and already widely used:
http://tc39.github.io/ecmascript-asyncawait/
Reviewers: djasper
Subscribers: klimek
Differential Revision: http://reviews.llvm.org/D19204
llvm-svn: 267368
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
`interface` can be used as a fee standing identifier in JavaScript/TypeScript.
This change uses the heuristic of whether it's followed by another identifier
as an indication.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D19240
llvm-svn: 266789
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang-format: [JS] unit tests for type aliases.
Also adds a test for "foo as bar" casts.
Spec:
https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3.10
These are already handled correctly.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D19206
llvm-svn: 266744
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Change `import` and `export` parsing to special case the renaming
syntax (`import x, {y as bar} ...`, `export {x}`) and otherwise just
parse a regular structural element.
This simplifies the code a bit and should be more correct - it's easier
to recognise the specific import syntax than to recognise arbitrary
expressions and declarations.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D19242
llvm-svn: 266743
|
|
|
|
|
|
|
| |
Specifically understand ellipses in parameter lists and treat trailing
reference qualifiers and the "{" as signals.
llvm-svn: 266599
|
|
|
|
|
|
|
|
|
|
| |
Indentation of the last line was reset to the initial indentation of the block when reaching EOF.
Patch by Maxime Beaulieu
Differential Revision: http://reviews.llvm.org/D19065
llvm-svn: 266321
|
|
|
|
|
|
|
|
|
|
| |
Use tabs to fill whitespace at the start of a line.
Patch by Maxime Beaulieu
Differential Revision: http://reviews.llvm.org/D19028
llvm-svn: 266320
|