History log of /llvm-project/clang/unittests/Format/FormatTestJS.cpp (Results 276 – 300 of 353)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 3e0dcc27 27-May-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Fix incorrect detection of ternary expressions.

A definintion like this could not be formatted at all:
constructor({aa}: {
aa?: string,
aaaaaaaa?: string,
aaaaaaaaaa

clang-format: [JS] Fix incorrect detection of ternary expressions.

A definintion like this could not be formatted at all:
constructor({aa}: {
aa?: string,
aaaaaaaa?: string,
aaaaaaaaaaaaaaa?: boolean,
aaaaaa?: List<string>
}) {
}

llvm-svn: 238291

show more ...


# 08051991 26-May-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Support ES6 spread operator.

Specifically, don't add a space before it.

Before:
someFunction(... a);
var x = [1, 2, ... a];

After:
someFunction(...a);
var x = [1, 2, ...

clang-format: [JS] Support ES6 spread operator.

Specifically, don't add a space before it.

Before:
someFunction(... a);
var x = [1, 2, ... a];

After:
someFunction(...a);
var x = [1, 2, ...a];

llvm-svn: 238183

show more ...


# 79e06081 21-May-2015 Manuel Klimek <klimek@google.com>

clang-format: [JS] Better support for fat arrows.

Assigns a token type (TT_JsFatArrow) to => tokens, and uses that to
more easily recognize and format fat arrow functions.
Improves function parsing

clang-format: [JS] Better support for fat arrows.

Assigns a token type (TT_JsFatArrow) to => tokens, and uses that to
more easily recognize and format fat arrow functions.
Improves function parsing to better recognize formal parameter
lists and return type declarations.
Recognizes arrow functions and parse function bodies as child blocks.

Patch by Martin Probst.

llvm-svn: 237895

show more ...


Revision tags: llvmorg-3.6.1, llvmorg-3.6.1-rc1
# 668c7bb3 11-May-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Parse exported functions as free-standing.

Before:
export function foo() {} export function bar() {}

After:
export function foo() {
}
export function bar() {
}

llvm-sv

clang-format: [JS] Parse exported functions as free-standing.

Before:
export function foo() {} export function bar() {}

After:
export function foo() {
}
export function bar() {
}

llvm-svn: 236978

show more ...


# 7325aee1 08-May-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Avoid bad line-warp around "function".

Before:
someLooooooooongFunction(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,

clang-format: [JS] Avoid bad line-warp around "function".

Before:
someLooooooooongFunction(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, function(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {
// code
});

After:
someLooooooooongFunction(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
function(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {
// code
});

llvm-svn: 236813

show more ...


# 69694b06 08-May-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Fix regex literal detection.

Before:
var regex = /= / ;

After:
var regex = /=/;

llvm-svn: 236811


# 9326f919 05-May-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] support optional methods.

Optional methods use ? tokens like this:

interface X { y?(): z; }

It seems easiest to detect and disambiguate these from ternary
expressions by check

clang-format: [JS] support optional methods.

Optional methods use ? tokens like this:

interface X { y?(): z; }

It seems easiest to detect and disambiguate these from ternary
expressions by checking if the code is in a declaration context. Turns
out that that didn't quite work properly for interfaces in Java and JS,
and for JS file root contexts.

Patch by Martin Probst, thank you.

llvm-svn: 236488

show more ...


# 2964749c 05-May-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Do not collapse short interfaces.

Patch by Martin Probst.

llvm-svn: 236485


# f69b922e 02-May-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Fix calculation of template string width.

OriginalColumn might not be set, so fall back to Location and SourceMgr
in case it is missing. Also initialize end column in case the tok

clang-format: [JS] Fix calculation of template string width.

OriginalColumn might not be set, so fall back to Location and SourceMgr
in case it is missing. Also initialize end column in case the token is
multi line, but it's the ` token itself that starts the multi line.

Patch by Martin Probst, thank you!

llvm-svn: 236383

show more ...


# d2219063 02-May-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Fix templated parameter default values.

Parameters can have templated types and default values (= ...), which is
another location in which a template closer should be followed by

clang-format: [JS] Fix templated parameter default values.

Parameters can have templated types and default values (= ...), which is
another location in which a template closer should be followed by
whitespace.

Patch by Martin Probst, thank you.

llvm-svn: 236382

show more ...


# 0d6ac27b 16-Apr-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] handle comments in template strings.

Patch by Martin Probst. Thank you.

llvm-svn: 235078


# d9309774 13-Apr-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Support index signature types.

Patch by Martin Probst.

llvm-svn: 234754


# a74f5072 13-Apr-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] support optionality markers in JS types.

Patch by Martin Probst. Thank you.

llvm-svn: 234753


# 6a5d38d2 13-Apr-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Allow periods and commata in class declarations.

Patch by Martin Probst. Thank you.

llvm-svn: 234752


# acf67e3e 07-Apr-2015 Daniel Jasper <djasper@google.com>

clang-format: Improve nested block formatting.

Before:
functionA(functionB({
int i;
int j;
}),
aaaa, bbbb, cccc);

After:
functionA(functionB({
int i;

clang-format: Improve nested block formatting.

Before:
functionA(functionB({
int i;
int j;
}),
aaaa, bbbb, cccc);

After:
functionA(functionB({
int i;
int j;
}),
aaaa, bbbb, cccc);

llvm-svn: 234304

show more ...


# 739ec534 04-Apr-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Understand object literals with only methods.

Before:
let theObject = {someMethodName() {
doTheThing();
doTheOtherThing();
},
someOtherMethodName()

clang-format: [JS] Understand object literals with only methods.

Before:
let theObject = {someMethodName() {
doTheThing();
doTheOtherThing();
},
someOtherMethodName() {
doSomething();
doSomethingElse();
}};

After:
let theObject = {
someMethodName() {
doTheThing();
doTheOtherThing();
},
someOtherMethodName() {
doSomething();
doSomethingElse();
}
};

llvm-svn: 234091

show more ...


# f46dec86 31-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Support getters, setters and methods in object literals.

llvm-svn: 233698


# 02c7bca5 30-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Fix comment formatting in goog.scopes.

Before:
goog.scope(function() {
// test
var x = 0;
// test
});

After:
goog.scope(function() {
// test
var x = 0;
// tes

clang-format: [JS] Fix comment formatting in goog.scopes.

Before:
goog.scope(function() {
// test
var x = 0;
// test
});

After:
goog.scope(function() {
// test
var x = 0;
// test
});

llvm-svn: 233530

show more ...


Revision tags: llvmorg-3.5.2, llvmorg-3.5.2-rc1
# bc46b939 15-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] support cast syntax and type arguments.

Casts in TS syntax (foo = <type>bar;) should not be followed by
whitespace.

Patch by Martin Probst. Thank you.

llvm-svn: 232321


# 60948b12 15-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] more precisely detect enums.

The current enum detection is overly aggressive. As NestingLevel only
applies per line (?) it classifies many if not most object literals as
enum decl

clang-format: [JS] more precisely detect enums.

The current enum detection is overly aggressive. As NestingLevel only
applies per line (?) it classifies many if not most object literals as
enum declarations and adds superfluous line breaks into them. This
change narrows the heuristic by requiring an assignment just before the
open brace and requiring the line to start with an identifier.

Patch by Martin Probst. Thank you.

llvm-svn: 232320

show more ...


Revision tags: llvmorg-3.6.0
# a0ef4f36 20-Feb-2015 Daniel Jasper <djasper@google.com>

clang-format: [js] Support template strings.

Merge template strings (marked by backticks ``).
Do not format any contents of template strings.

Patch by Martin Probst. Thank you.

llvm-svn: 230011


# fca735cd 19-Feb-2015 Daniel Jasper <djasper@google.com>

clang-format: [js] Support ES6 module exports.

Patch by Martin Probst, thank you!

llvm-svn: 229865


# 354aa515 19-Feb-2015 Daniel Jasper <djasper@google.com>

clang-format: [js] Support ES6 module imports.

Patch by Martin Probst.

llvm-svn: 229863


# 6fa9ec78 19-Feb-2015 Daniel Jasper <djasper@google.com>

clang-format: [js] Do not fall through for JS structural elements.

Patch by Martin Probst. Thank you.

llvm-svn: 229862


Revision tags: llvmorg-3.6.0-rc4
# 3c42dba2 18-Feb-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] support AtScript style annotations for JS.

Based on Java annotation support and style.

Patch by Martin Probst.

llvm-svn: 229703


1...<<1112131415