History log of /llvm-project/clang/unittests/Format/FormatTestJS.cpp (Results 176 – 200 of 353)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# ece8c0c6 13-Jun-2016 Martin Probst <martin@probst.io>

clang-format: [JS] Indent namespaces in JavaScript/TS by default.

Summary: There's no convention of avoiding the nested indentation.

Reviewers: djasper

Subscribers: klimek, alexeagle, cfe-commits

clang-format: [JS] Indent namespaces in JavaScript/TS by default.

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

show more ...


# 0cd74ee8 13-Jun-2016 Martin Probst <martin@probst.io>

clang-format: [JS] Introduce JavaScriptWrapImports option.

Summary:
When turned on, clang-format wraps JavaScript imports (and importing exports),
instead of forcing the entire import statement onto

clang-format: [JS] Introduce JavaScriptWrapImports option.

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

show more ...


# 0eb40cfa 13-Jun-2016 Martin Probst <martin@probst.io>

clang-format: [JS] post-fix non-null assertion operator.

Summary:
Do not insert whitespace preceding the "!" postfix operator. This is an
incomplete fix, but should cover common usage.

Reviewers: d

clang-format: [JS] post-fix non-null assertion operator.

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

show more ...


# 2ec2324f 09-Jun-2016 Martin Probst <martin@probst.io>

clang-format: [JS] recognized named functions in AnnotatingParser.

Summary: This also fixes union type formatting in function parameter types.

Before: function x(path: number| string) {}
After: fun

clang-format: [JS] recognized named functions in AnnotatingParser.

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

show more ...


Revision tags: llvmorg-3.8.1, llvmorg-3.8.1-rc1
# 48622090 01-Jun-2016 Martin Probst <martin@probst.io>

clang-format: [JS] no ASI on `import {x as\n y}`.

Summary: ASI did not handle the ES6 `as` operator correctly.

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: http://re

clang-format: [JS] no ASI on `import {x as\n y}`.

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

show more ...


# e77f19c0 29-May-2016 Daniel Jasper <djasper@google.com>

clang-format: Fix segfault introduced by allowing wraps after comments.

llvm-svn: 271191


# 7ea9b6d7 29-May-2016 Martin Probst <martin@probst.io>

clang-format: [JS] Support shebang lines on the very first line.

Summary:
Shebang lines (`#!/bin/blah`) can be used in JavaScript scripts to indicate
they should be run using e.g. node. This change

clang-format: [JS] Support shebang lines on the very first line.

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

show more ...


# 409697ec 29-May-2016 Martin Probst <martin@probst.io>

clang-format: [JS] fix async parsing.

Summary:
Only treat the sequence `async function` as the start of a function expression,
as opposed to every occurrence of the token `async` (whoops).

Reviewer

clang-format: [JS] fix async parsing.

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

show more ...


# 997cf2fe 20-May-2016 Daniel Jasper <djasper@google.com>

clang-format: [JS] Treat "for" as a reserved word after a ".".

Otherwise, clang-format can get confused with statements like:

x.for = 1;

llvm-svn: 270188


# 5dbcd3bd 19-May-2016 Daniel Jasper <djasper@google.com>

clang-format: [JS] Fix spacing in destructuring assignments.

Before:
const[a, b, c] = [1, 2, 3];

After:
const [a, b, c] = [1, 2, 3];

llvm-svn: 270029


# e71b4cbd 17-May-2016 Martin Probst <martin@probst.io>

clang-format: [JS] fix template string width counting.

Summary:
Simply looking at the final text greatly simplifies the algorithm and also
fixes a reported issue. This requires duplicating the "actu

clang-format: [JS] fix template string width counting.

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

show more ...


# a166979e 12-May-2016 Martin Probst <martin@probst.io>

clang-format: [JS] respect clang-format off when requoting strings.

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D20200

llvm-svn: 269282


# 5f8445b3 24-Apr-2016 Martin Probst <martin@probst.io>

clang-format: [JS] generator and async functions.

For generators, see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_generators
async functions are not quite in the spe

clang-format: [JS] generator and async functions.

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

show more ...


# 1e8261ea 19-Apr-2016 Martin Probst <martin@probst.io>

clang-format: [JS] support `interface` as a free standing identifier.

Summary:
`interface` can be used as a fee standing identifier in JavaScript/TypeScript.
This change uses the heuristic of whethe

clang-format: [JS] support `interface` as a free standing identifier.

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

show more ...


# 805c6167 19-Apr-2016 Martin Probst <martin@probst.io>

Summary:
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 handl

Summary:
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

show more ...


# 053f1aa6 19-Apr-2016 Martin Probst <martin@probst.io>

clang-format: [JS] simplify import/export.

Summary:
Change `import` and `export` parsing to special case the renaming
syntax (`import x, {y as bar} ...`, `export {x}`) and otherwise just
parse a reg

clang-format: [JS] simplify import/export.

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

show more ...


# 716a533a 11-Apr-2016 Martin Probst <martin@probst.io>

clang-format: [JS] Test for parameter annotations.

Summary: Just to ensure no regressions, this already works fine.

Reviewers: djasper

Subscribers: cfe-commits, klimek

Differential Revision: http

clang-format: [JS] Test for parameter annotations.

Summary: Just to ensure no regressions, this already works fine.

Reviewers: djasper

Subscribers: cfe-commits, klimek

Differential Revision: http://reviews.llvm.org/D18950

llvm-svn: 265922

show more ...


# bbffeac5 11-Apr-2016 Martin Probst <martin@probst.io>

clang-format: [JS] do not insert semicolons after wrapped annotations.

Reviewers: djasper

Subscribers: klimek

Differential Revision: http://reviews.llvm.org/D18943

llvm-svn: 265916


# 8fc7a1e9 22-Mar-2016 Daniel Jasper <djasper@google.com>

clang-format: [JS] do not wrap ES6 imports/exports.

"import ... from '...';" and "export ... from '...';" should be treated
the same as goog.require/provide/module/forwardDeclare calls.

Patch by Ma

clang-format: [JS] do not wrap ES6 imports/exports.

"import ... from '...';" and "export ... from '...';" should be treated
the same as goog.require/provide/module/forwardDeclare calls.

Patch by Martin Probst.

llvm-svn: 264055

show more ...


# 91b1d1ab 21-Mar-2016 Daniel Jasper <djasper@google.com>

clang-format: [JS] no space in union and intersection types.

The operators | and & in types, as opposed to the bitwise operators,
should not have whitespace around them (e.g. `Foo<Bar|Baz>`).

Patch

clang-format: [JS] no space in union and intersection types.

The operators | and & in types, as opposed to the bitwise operators,
should not have whitespace around them (e.g. `Foo<Bar|Baz>`).

Patch by Martin Probst. Thank you.

llvm-svn: 263961

show more ...


# a4607e1b 17-Mar-2016 Daniel Jasper <djasper@google.com>

clang-format: [JS] Fix incorrect spacing around contextual keywords.

Before:
x.of ();

After:
x.of();

llvm-svn: 263710


# 1dcbbcfc 14-Mar-2016 Daniel Jasper <djasper@google.com>

clang-format: [JS] Handle certain cases of ASI.

Automatic Semicolon Insertion can only be properly handled by parsing
source code. However conservatively catching just a few, common
situations preve

clang-format: [JS] Handle certain cases of ASI.

Automatic Semicolon Insertion can only be properly handled by parsing
source code. However conservatively catching just a few, common
situations prevents breaking code during development, which greatly
improves usability.

JS code should still use semicolons, and ASI code should be flagged by
a compiler or linter.

Patch by Martin Probst. Thank you.

llvm-svn: 263470

show more ...


# acffeb8b 05-Mar-2016 Daniel Jasper <djasper@google.com>

clang-format: [JS] Support destructuring assignments in for loops.

Before:
for (let { a, b } of x) {
}

After:
for (let {a, b} of x) {
}

llvm-svn: 262776


Revision tags: llvmorg-3.8.0
# abd1f574 02-Mar-2016 Daniel Jasper <djasper@google.com>

clang-format: [JS] Optionally re-quote string literals.

Turns "foo" into 'foo' (or vice versa, depending on configuration).
This makes it more convenient to follow the Google JavaScript style
guide:

clang-format: [JS] Optionally re-quote string literals.

Turns "foo" into 'foo' (or vice versa, depending on configuration).
This makes it more convenient to follow the Google JavaScript style
guide:
https://google.github.io/styleguide/javascriptguide.xml?showone=Strings#Strings

This functionality is behind the option "JavaScriptQuotes", which can be:

* "leave" (no re-quoting)
* "single" (change to single quotes)
* "double" (change to double quotes)

This also changes single quoted JavaScript string literals to be treated
as tok::string_literal, not tok::char_literal, which fixes two unrelated
tests.

Patch by Martin Probst. Thank you.

llvm-svn: 262534

show more ...


# b18425bf 01-Mar-2016 Daniel Jasper <djasper@google.com>

clang-format: [JS] Support quoted object literal keys.

Before:
var x = {
a: a,
b: b, 'c': c,
};

After:
var x = {
a: a,
b: b,
'c': c,
};

llvm-svn: 262291


12345678910>>...15