mprobst updated this revision to Diff 57440.
mprobst marked an inline comment as done.
mprobst added a comment.
- review comments
http://reviews.llvm.org/D20198
Files:
include/clang/Format/Format.h
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
lib/Format/FormatToken.h
lib/Format/For
mprobst added a comment.
PTAL.
Comment at: lib/Format/SortJavaScriptImports.cpp:45-46
@@ +44,4 @@
+
+struct JsImportExport {
+ bool IsExport;
+ // JS imports are sorted into these categories, in order.
klimek wrote:
> klimek wrote:
> > This is really weird - a
mprobst updated this revision to Diff 57497.
mprobst marked 8 inline comments as done.
mprobst added a comment.
- address review comments
http://reviews.llvm.org/D20198
Files:
include/clang/Format/Format.h
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
lib/Format/FormatToken.h
lib/Fo
mprobst updated this revision to Diff 57621.
mprobst marked 2 inline comments as done.
mprobst added a comment.
- address review comments
- - extract parseModuleReferences
http://reviews.llvm.org/D20198
Files:
include/clang/Format/Format.h
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
mprobst marked 6 inline comments as done.
mprobst added a comment.
PTAL.
Comment at: lib/Format/SortJavaScriptImports.cpp:93-96
@@ +92,6 @@
+return LHS.Category < RHS.Category;
+ if (LHS.Category == JsModuleReference::ReferenceCategory::SIDE_EFFECT)
+// Side effect impo
mprobst added a comment.
PTAL.
http://reviews.llvm.org/D20198
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mprobst marked 4 inline comments as done.
Comment at: lib/Format/SortJavaScriptImports.cpp:216-217
@@ +215,4 @@
+break;
+ Current = Line->First;
+ LineEnd = Line->Last;
+ skipComments();
klimek wrote:
> Both of these are used only once, perh
mprobst updated this revision to Diff 57637.
mprobst marked an inline comment as done.
mprobst added a comment.
- address review comments
- - extract parseModuleReferences
- more review comments
http://reviews.llvm.org/D20198
Files:
include/clang/Format/Format.h
lib/Format/CMakeLists.txt
mprobst updated this revision to Diff 57794.
mprobst added a comment.
- correctly insert breaks after import block
http://reviews.llvm.org/D20198
Files:
include/clang/Format/Format.h
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
lib/Format/FormatToken.h
lib/Format/FormatTokenLexer.c
mprobst updated this revision to Diff 57795.
mprobst added a comment.
- ranges
http://reviews.llvm.org/D20198
Files:
include/clang/Format/Format.h
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
lib/Format/FormatToken.h
lib/Format/FormatTokenLexer.cpp
lib/Format/FormatTokenLexer.h
mprobst marked 2 inline comments as done.
mprobst added a comment.
Thanks for the review, appreciated!
Comment at: lib/Format/SortJavaScriptImports.cpp:160
@@ +159,3 @@
+ if (i + 1 < e) {
+// Insert breaks between imports.
+ReferencesText += "\n";
--
Author: mprobst
Date: Fri May 20 06:24:24 2016
New Revision: 270203
URL: http://llvm.org/viewvc/llvm-project?rev=270203&view=rev
Log:
clang-format: [JS] sort ES6 imports.
Summary:
This change automatically sorts ES6 imports and exports into four groups:
absolute imports, parent imports, relative
This revision was automatically updated to reflect the committed changes.
mprobst marked 2 inline comments as done.
Closed by commit rL270203: clang-format: [JS] sort ES6 imports. (authored by
mprobst).
Changed prior to commit:
http://reviews.llvm.org/D20198?vs=57795&id=57922#toc
Repository:
mprobst updated this revision to Diff 53190.
mprobst added a comment.
- simplify conditions
http://reviews.llvm.org/D18943
Files:
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
==
mprobst marked an inline comment as done.
Comment at: lib/Format/UnwrappedLineParser.cpp:708
@@ +707,3 @@
+ if (Line && Line->Tokens.size() > 1) {
+// If the token before the previous one is an '@', the previous token is an
+// annotation and can precede another identifie
mprobst marked 2 inline comments as done.
Comment at: unittests/Format/FormatTestJS.cpp:689
@@ -688,1 +688,3 @@
"String");
+ verifyFormat("function f(@Foo bar) {}", "function f(@Foo\n"
+ " bar) {}");
This revision was automatically updated to reflect the committed changes.
mprobst marked an inline comment as done.
Closed by commit rL265916: clang-format: [JS] do not insert semicolons after
wrapped annotations. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D18943?vs
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Just to ensure no regressions, this already works fine.
http://reviews.llvm.org/D18950
Files:
unittests/Format/FormatTestJS.cpp
Index: unittests/Format
This revision was automatically updated to reflect the committed changes.
Closed by commit rL265922: clang-format: [JS] Test for parameter annotations.
(authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D18950?vs=53201&id=53205#toc
Repository:
rL LLVM
http://reviews.llv
Author: mprobst
Date: Mon Apr 11 04:17:57 2016
New Revision: 265922
URL: http://llvm.org/viewvc/llvm-project?rev=265922&view=rev
Log:
clang-format: [JS] Test for parameter annotations.
Summary: Just to ensure no regressions, this already works fine.
Reviewers: djasper
Subscribers: cfe-commits,
Author: mprobst
Date: Mon Apr 11 02:35:57 2016
New Revision: 265916
URL: http://llvm.org/viewvc/llvm-project?rev=265916&view=rev
Log:
clang-format: [JS] do not insert semicolons after wrapped annotations.
Reviewers: djasper
Subscribers: klimek
Differential Revision: http://reviews.llvm.org/D189
>
> > Was/is the 2 correct then? (if it was next(rbegin, 2) that'd be
> equivalent
> > to prev(end, 3), yes?)
>
> I think it is from looking at the test case, looping in martin to see
> whether I'm right :)
At that point in the code, we have [..., PrePrev = '@', Prev = 'SomeToken']
and CurrentTok
mprobst updated this revision to Diff 54017.
mprobst added a comment.
- fix tests
- add spec links
http://reviews.llvm.org/D19204
Files:
lib/Format/ContinuationIndenter.cpp
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
lib/Format/UnwrappedLineParser.cpp
unittests/Format/Forma
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
clang-format: [JS] unit tests for type aliases.
Spec:
https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3.10
These are already handled corre
mprobst updated this revision to Diff 54019.
mprobst added a comment.
- test, test name
http://reviews.llvm.org/D19206
Files:
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
===
--- unittests/Format/Fo
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
`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
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Change `import` and `export` parsing to special case the renaming
syntax (`import x, {y as bar} ...`, `export {x}`) and otherwise just
parse a regular struc
This revision was automatically updated to reflect the committed changes.
Closed by commit rL266743: clang-format: [JS] simplify import/export. (authored
by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D19242?vs=54124&id=54190#toc
Repository:
rL LLVM
http://reviews.llvm.org/D1
mprobst marked an inline comment as done.
mprobst added a comment.
Repository:
rL LLVM
http://reviews.llvm.org/D19242
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL266744: Summary: (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D19206?vs=54019&id=54192#toc
Repository:
rL LLVM
http://reviews.llvm.org/D19206
Files:
cfe/trunk/unittests/
Author: mprobst
Date: Tue Apr 19 09:59:16 2016
New Revision: 266744
URL: http://llvm.org/viewvc/llvm-project?rev=266744&view=rev
Log:
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/sp
Author: mprobst
Date: Tue Apr 19 09:55:37 2016
New Revision: 266743
URL: http://llvm.org/viewvc/llvm-project?rev=266743&view=rev
Log:
clang-format: [JS] simplify import/export.
Summary:
Change `import` and `export` parsing to special case the renaming
syntax (`import x, {y as bar} ...`, `export {
mprobst updated this revision to Diff 54195.
mprobst added a comment.
- test for wrapping
http://reviews.llvm.org/D19204
Files:
lib/Format/ContinuationIndenter.cpp
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTestJS.c
mprobst marked an inline comment as done.
Comment at: unittests/Format/FormatTestJS.cpp:339
@@ +338,3 @@
+ "}");
+ verifyFormat("async function* f() {\n"
+ " yield fetch(x);\n"
djasper wrote:
> What does the star mean here? Should we
mprobst updated this revision to Diff 54218.
mprobst added a comment.
- reuse mustBeJSIdent for interface detection
http://reviews.llvm.org/D19240
Files:
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
==
mprobst marked an inline comment as done.
mprobst added a comment.
http://reviews.llvm.org/D19240
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL266789: clang-format: [JS] support `interface` as a free
standing identifier. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D19240?vs=54218&id=54232#toc
Repository:
rL LLVM
mprobst marked an inline comment as done.
Comment at: unittests/Format/FormatTestJS.cpp:339
@@ +338,3 @@
+TEST_F(FormatTestJS, AsyncFunctions) {
+ verifyFormat("async function f() {\n"
+ " let x = 1;\n"
djasper wrote:
> Fundamentally, I think there
Author: mprobst
Date: Tue Apr 19 13:18:59 2016
New Revision: 266789
URL: http://llvm.org/viewvc/llvm-project?rev=266789&view=rev
Log:
clang-format: [JS] support `interface` as a free standing identifier.
Summary:
`interface` can be used as a fee standing identifier in JavaScript/TypeScript.
This
Author: mprobst
Date: Tue Apr 19 13:19:06 2016
New Revision: 266790
URL: http://llvm.org/viewvc/llvm-project?rev=266790&view=rev
Log:
reuse mustBeJSIdent for interface detection
Modified:
cfe/trunk/lib/Format/UnwrappedLineParser.cpp
Modified: cfe/trunk/lib/Format/UnwrappedLineParser.cpp
URL:
mprobst added a comment.
Friendly ping.
http://reviews.llvm.org/D19204
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL267368: clang-format: [JS] generator and async functions.
(authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D19204?vs=54195&id=54814#toc
Repository:
rL LLVM
http://reviews.llvm
Author: mprobst
Date: Sun Apr 24 17:05:09 2016
New Revision: 267368
URL: http://llvm.org/viewvc/llvm-project?rev=267368&view=rev
Log:
clang-format: [JS] generator and async functions.
For generators, see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_generators
async
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
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
mprobst added a comment.
How would I disable the formatting using that way?
When I special case `parsePreprocessorDirective()`, consume the line, and
return `LT_ImportStatement`, clang-format still tries to format tokens within
the shebang. E.g. I get `#!/usr/bin / env node`, note the whitespac
mprobst updated this revision to Diff 58529.
mprobst added a comment.
- use #include style shebang parsing.
http://reviews.llvm.org/D20632
Files:
lib/Format/FormatTokenLexer.cpp
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
=
mprobst marked 2 inline comments as done.
Comment at: lib/Format/TokenAnnotator.cpp:698
@@ +697,3 @@
+
+if (Style.Language == FormatStyle::LK_JavaScript) {
+ // JavaScript files can contain shebang lines of the form:
alexeagle wrote:
> should we still res
mprobst updated this revision to Diff 58612.
mprobst marked an inline comment as done.
mprobst added a comment.
revert FormatTokenLexer, restrict to first token
http://reviews.llvm.org/D20632
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
mprobst added a comment.
Alex, do you accept this revision?
http://reviews.llvm.org/D20632
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Refactors AnnotatedLine.startsWith/endsWith by extracting the core functionality
into FormatToken.startsSequence/endsSequence. This allows checking tokens w
mprobst updated this revision to Diff 58809.
mprobst added a comment.
- fix description
http://reviews.llvm.org/D20737
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.h
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.c
This revision was automatically updated to reflect the committed changes.
Closed by commit rL271184: clang-format: [JS] fix async parsing. (authored by
mprobst).
Changed prior to commit:
http://reviews.llvm.org/D20737?vs=58809&id=58915#toc
Repository:
rL LLVM
http://reviews.llvm.org/D20737
Author: mprobst
Date: Sun May 29 09:41:07 2016
New Revision: 271184
URL: http://llvm.org/viewvc/llvm-project?rev=271184&view=rev
Log:
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 th
Author: mprobst
Date: Sun May 29 09:41:36 2016
New Revision: 271185
URL: http://llvm.org/viewvc/llvm-project?rev=271185&view=rev
Log:
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 b
Author: mprobst
Date: Sun May 29 09:41:02 2016
New Revision: 271183
URL: http://llvm.org/viewvc/llvm-project?rev=271183&view=rev
Log:
clang-format: [JS] FormatToken.startsSequence/endsSequence.
Refactors AnnotatedLine.startsWith/endsWith by extracting the core functionality
into FormatToken.start
This revision was automatically updated to reflect the committed changes.
Closed by commit rL271185: clang-format: [JS] Support shebang lines on the very
first line. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D20632?vs=58612&id=58916#toc
Repository:
rL LLVM
http
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
E.g. sort `import {b, a} from 'x';` into `import {a, b} from 'x';`.
http://reviews.llvm.org/D20798
Files:
lib/Format/Format.cpp
lib/Format/SortJavaScr
mprobst updated this revision to Diff 59001.
mprobst added a comment.
- extract method for readability
http://reviews.llvm.org/D20798
Files:
lib/Format/Format.cpp
lib/Format/SortJavaScriptImports.cpp
unittests/Format/SortImportsTestJS.cpp
Index: unittests/Format/SortImportsTestJS.cpp
===
mprobst marked 4 inline comments as done.
mprobst added a comment.
Done regarding the tests. We do have an unrelated issue with formatting `import
{x as foo}`, will send a fix later.
http://reviews.llvm.org/D20798
___
cfe-commits mailing list
cfe-c
mprobst updated this revision to Diff 59070.
mprobst added a comment.
- multiline tests, review comments
http://reviews.llvm.org/D20798
Files:
lib/Format/Format.cpp
lib/Format/SortJavaScriptImports.cpp
unittests/Format/SortImportsTestJS.cpp
Index: unittests/Format/SortImportsTestJS.cpp
=
mprobst added a comment.
Done regarding the tests. We do have an unrelated issue with formatting `import
{x as foo}`, will send a fix later.
http://reviews.llvm.org/D20798
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.or
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
ASI did not handle the ES6 `as` operator correctly.
http://reviews.llvm.org/D20817
Files:
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTe
mprobst marked an inline comment as done.
mprobst added a comment.
http://reviews.llvm.org/D20798
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL271400: clang-format: [JS] Sort imported symbols. (authored
by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D20798?vs=59070&id=59226#toc
Repository:
rL LLVM
http://reviews.llvm.org/D20
Author: mprobst
Date: Wed Jun 1 10:22:47 2016
New Revision: 271401
URL: http://llvm.org/viewvc/llvm-project?rev=271401&view=rev
Log:
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-commit
This revision was automatically updated to reflect the committed changes.
Closed by commit rL271401: clang-format: [JS] no ASI on `import {x as\n y}`.
(authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D20817?vs=59074&id=59227#toc
Repository:
rL LLVM
http://reviews.llvm
Author: mprobst
Date: Wed Jun 1 10:19:53 2016
New Revision: 271400
URL: http://llvm.org/viewvc/llvm-project?rev=271400&view=rev
Log:
clang-format: [JS] Sort imported symbols.
Summary: E.g. sort `import {b, a} from 'x';` into `import {a, b} from 'x';`.
Reviewers: djasper
Subscribers: cfe-commit
Author: mprobst
Date: Wed Jun 8 09:04:04 2016
New Revision: 272142
URL: http://llvm.org/viewvc/llvm-project?rev=272142&view=rev
Log:
clang-format: [JS] fix an assertion failure caused by shrinking sources.
Summary:
The JavaScript import sorter has a corner condition that can cause the overall
so
Author: mprobst
Date: Wed Jun 8 09:05:26 2016
New Revision: 272143
URL: http://llvm.org/viewvc/llvm-project?rev=272143&view=rev
Log:
clang-format: [JS] fix a FIXME.
Modified:
cfe/trunk/lib/Format/SortJavaScriptImports.cpp
Modified: cfe/trunk/lib/Format/SortJavaScriptImports.cpp
URL:
http:/
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Do not insert whitespace preceding the "!" postfix operator. This is an
incomplete fix, but should cover common usage.
http://reviews.llvm.org/D21204
File
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
This also fixes union type formatting in function parameter types.
http://reviews.llvm.org/D21206
Files:
lib/Format/TokenAnnotator.cpp
unittests/Forma
Author: mprobst
Date: Thu Jun 9 17:49:04 2016
New Revision: 272330
URL: http://llvm.org/viewvc/llvm-project?rev=272330&view=rev
Log:
clang-format: [JS] recognized named functions in AnnotatingParser.
Summary: This also fixes union type formatting in function parameter types.
Before: function x(
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272330: clang-format: [JS] recognized named functions in
AnnotatingParser. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D21206?vs=60254&id=60268#toc
Repository:
rL LLVM
ht
mprobst updated this revision to Diff 60308.
mprobst marked an inline comment as done.
mprobst added a comment.
- invert check to whitelist known tokens that can precede a non-null assertion.
http://reviews.llvm.org/D21204
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.c
mprobst added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:2127
@@ +2126,3 @@
+// Postfix non-null assertion operator, as in `foo!.bar()`.
+if (Right.is(tok::exclaim) && Right.Next &&
+Right.Next->isNot(tok::identifier) && !Right.Next->Tok.isLiteral()
mprobst updated this revision to Diff 60311.
mprobst added a comment.
- more tests
http://reviews.llvm.org/D21204
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
mprobst added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:2128
@@ +2127,3 @@
+if (Right.is(tok::exclaim) && (Left.isOneOf(tok::identifier, tok::r_paren,
+tok::r_square, tok::r_brace) ||
+
Author: mprobst
Date: Sun Jun 12 19:49:54 2016
New Revision: 272524
URL: http://llvm.org/viewvc/llvm-project?rev=272524&view=rev
Log:
clang-format: [JS] post-fix non-null assertion operator.
Summary:
Do not insert whitespace preceding the "!" postfix operator. This is an
incomplete fix, but shoul
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272524: clang-format: [JS] post-fix non-null assertion
operator. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D21204?vs=60311&id=60482#toc
Repository:
rL LLVM
http://revie
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
When turned on, clang-format wraps JavaScript imports (and importing exports),
instead of forcing the entire import statement onto one line.
http://reviews
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added subscribers: cfe-commits, alexeagle.
Herald added a subscriber: klimek.
There's no convention of avoiding the nested indentation.
http://reviews.llvm.org/D21275
Files:
lib/Format/Format.cpp
unittests/Format/Forma
mprobst updated this revision to Diff 60519.
mprobst added a comment.
- rename to JavaScriptWrapImports
- re-alphabetize options list
http://reviews.llvm.org/D21273
Files:
include/clang/Format/Format.h
lib/Format/Format.cpp
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
mprobst updated this revision to Diff 60532.
mprobst added a comment.
- classify as LT_ImportStatement, re-enable wrapping later
- no early exist in TokenAnnotator: while loop is required for consumeToken().
http://reviews.llvm.org/D21273
Files:
include/clang/Format/Format.h
lib/Format/Form
Author: mprobst
Date: Mon Jun 13 11:39:50 2016
New Revision: 272558
URL: http://llvm.org/viewvc/llvm-project?rev=272558&view=rev
Log:
clang-format: [JS] Introduce JavaScriptWrapImports option.
Summary:
When turned on, clang-format wraps JavaScript imports (and importing exports),
instead of forci
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272558: clang-format: [JS] Introduce JavaScriptWrapImports
option. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D21273?vs=60532&id=60552#toc
Repository:
rL LLVM
http://rev
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272559: clang-format: [JS] Indent namespaces in
JavaScript/TS by default. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D21275?vs=60487&id=60553#toc
Repository:
rL LLVM
htt
Author: mprobst
Date: Mon Jun 13 11:41:28 2016
New Revision: 272559
URL: http://llvm.org/viewvc/llvm-project?rev=272559&view=rev
Log:
clang-format: [JS] Indent namespaces in JavaScript/TS by default.
Summary: There's no convention of avoiding the nested indentation.
Reviewers: djasper
Subscribe
Author: mprobst
Date: Mon Jun 13 12:50:10 2016
New Revision: 272569
URL: http://llvm.org/viewvc/llvm-project?rev=272569&view=rev
Log:
clang-format: [JS] Initialize new configuration value.
Modified:
cfe/trunk/lib/Format/Format.cpp
Modified: cfe/trunk/lib/Format/Format.cpp
URL:
http://llvm.o
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Includes parenthesized type expressions and type aliases.
http://reviews.llvm.org/D21597
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
mprobst added a comment.
This seems to be getting a bit tricky with the declaration contexts. If you
have a better suggestion, please come forward.
http://reviews.llvm.org/D21597
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.
Author: mprobst
Date: Wed Jun 22 09:35:14 2016
New Revision: 273422
URL: http://llvm.org/viewvc/llvm-project?rev=273422&view=rev
Log:
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:
mprobst updated this revision to Diff 61548.
mprobst added a comment.
- Remove parseJSTypeDefinition
http://reviews.llvm.org/D21597
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
===
mprobst added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:480
@@ -471,1 +479,3 @@
+ void parseJSTypeDefinition() {
+// `type Name = Type Expression;`
djasper wrote:
> Why is this necessary?
It is not, actually. I was chasing a wrong path here
mprobst marked 2 inline comments as done.
Comment at: lib/Format/TokenAnnotator.cpp:155
@@ +154,3 @@
+} else if (Style.Language == FormatStyle::LK_JavaScript && Left->Previous
&&
+ Left->Previous->is(TT_JsTypeColon)) {
+ // let x: (SomeType);
--
mprobst updated this revision to Diff 61706.
mprobst marked an inline comment as done.
mprobst added a comment.
- progress
http://reviews.llvm.org/D21597
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.c
Author: mprobst
Date: Thu Jun 23 14:52:32 2016
New Revision: 273603
URL: http://llvm.org/viewvc/llvm-project?rev=273603&view=rev
Log:
clang-format: [JS] recognize more type locations.
Summary: Includes parenthesized type expressions and type aliases.
Reviewers: djasper
Subscribers: klimek, cfe-
This revision was automatically updated to reflect the committed changes.
Closed by commit rL273603: clang-format: [JS] recognize more type locations.
(authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D21597?vs=61706&id=61711#toc
Repository:
rL LLVM
http://reviews.llvm
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
This causes a regression for top level ternary expressions, but that's deemed
acceptable, as those really should be very rare.
http://reviews.llvm.org/D216
mprobst updated this revision to Diff 61726.
mprobst added a comment.
ok
http://reviews.llvm.org/D21658
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
===
--- un
Author: mprobst
Date: Thu Jun 23 16:51:49 2016
New Revision: 273619
URL: http://llvm.org/viewvc/llvm-project?rev=273619&view=rev
Log:
clang-format: [JS] handle conditionals in fields, default params.
Summary:
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://rev
201 - 300 of 350 matches
Mail list logo