Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-17 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-17 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-17 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-18 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-18 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-18 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-18 Thread Martin Probst via 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

Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-18 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-19 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-19 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-19 Thread Martin Probst via cfe-commits
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"; --

r270203 - clang-format: [JS] sort ES6 imports.

2016-05-20 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-20 Thread Martin Probst via cfe-commits
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:

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

2016-04-10 Thread Martin Probst via cfe-commits
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 ==

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

2016-04-10 Thread Martin Probst via cfe-commits
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

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

2016-04-10 Thread Martin Probst via cfe-commits
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) {}");

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

2016-04-11 Thread Martin Probst via cfe-commits
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

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

2016-04-11 Thread Martin Probst via cfe-commits
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

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

2016-04-11 Thread Martin Probst via cfe-commits
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

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

2016-04-11 Thread Martin Probst via cfe-commits
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,

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

2016-04-11 Thread Martin Probst via 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

Re: r265934 - [clang-format] Walk backwards from end() instead of forwards from rend().

2016-04-11 Thread Martin Probst via cfe-commits
> > > 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

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

2016-04-17 Thread Martin Probst via cfe-commits
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

[PATCH] D19206: Add a test for "foo as bar" casts.

2016-04-17 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D19206: Add a test for "foo as bar" casts.

2016-04-17 Thread Martin Probst via cfe-commits
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

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

2016-04-18 Thread Martin Probst via cfe-commits
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

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

2016-04-18 Thread Martin Probst via cfe-commits
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

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

2016-04-19 Thread Martin Probst via cfe-commits
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

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

2016-04-19 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D19206: Add a test for "foo as bar" casts.

2016-04-19 Thread Martin Probst via 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/

r266744 - Summary:

2016-04-19 Thread Martin Probst via cfe-commits
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

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

2016-04-19 Thread Martin Probst via cfe-commits
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 {

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

2016-04-19 Thread Martin Probst via cfe-commits
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

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

2016-04-19 Thread Martin Probst via cfe-commits
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

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

2016-04-19 Thread Martin Probst via cfe-commits
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 ==

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

2016-04-19 Thread Martin Probst via cfe-commits
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

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

2016-04-19 Thread Martin Probst via 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

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

2016-04-19 Thread Martin Probst via cfe-commits
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

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

2016-04-19 Thread Martin Probst via cfe-commits
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

r266790 - reuse mustBeJSIdent for interface detection

2016-04-19 Thread Martin Probst via cfe-commits
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:

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

2016-04-22 Thread Martin Probst via cfe-commits
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

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

2016-04-24 Thread Martin Probst via 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

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

2016-04-24 Thread Martin Probst via cfe-commits
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

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

2016-05-25 Thread Martin Probst via cfe-commits
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

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

2016-05-25 Thread Martin Probst via cfe-commits
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

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

2016-05-25 Thread Martin Probst via cfe-commits
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 =

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

2016-05-26 Thread Martin Probst via cfe-commits
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

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

2016-05-26 Thread Martin Probst via cfe-commits
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

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

2016-05-27 Thread Martin Probst via cfe-commits
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

[PATCH] D20737: clang-format: [JS] FormatToken.startsSequence/endsSequence.

2016-05-27 Thread Martin Probst via 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

Re: [PATCH] D20737: clang-format: [JS] FormatToken.startsSequence/endsSequence.

2016-05-27 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20737: clang-format: [JS] fix async parsing.

2016-05-29 Thread Martin Probst via cfe-commits
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

r271184 - clang-format: [JS] fix async parsing.

2016-05-29 Thread Martin Probst via cfe-commits
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

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

2016-05-29 Thread Martin Probst via cfe-commits
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

r271183 - clang-format: [JS] FormatToken.startsSequence/endsSequence.

2016-05-29 Thread Martin Probst via cfe-commits
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

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

2016-05-29 Thread Martin Probst via cfe-commits
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

[PATCH] D20798: clang-format: [JS] Sort imported symbols.

2016-05-30 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20798: clang-format: [JS] Sort imported symbols.

2016-05-30 Thread Martin Probst via cfe-commits
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 ===

Re: [PATCH] D20798: clang-format: [JS] Sort imported symbols.

2016-05-31 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20798: clang-format: [JS] Sort imported symbols.

2016-05-31 Thread Martin Probst via cfe-commits
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 =

Re: [PATCH] D20798: clang-format: [JS] Sort imported symbols.

2016-05-31 Thread Martin Probst via cfe-commits
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

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

2016-05-31 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20798: clang-format: [JS] Sort imported symbols.

2016-06-01 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D20798: clang-format: [JS] Sort imported symbols.

2016-06-01 Thread Martin Probst via 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

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

2016-06-01 Thread Martin Probst via cfe-commits
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

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

2016-06-01 Thread Martin Probst via cfe-commits
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

r271400 - clang-format: [JS] Sort imported symbols.

2016-06-01 Thread Martin Probst via cfe-commits
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

r272142 - clang-format: [JS] fix an assertion failure caused by shrinking sources.

2016-06-08 Thread Martin Probst via cfe-commits
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

r272143 - clang-format: [JS] fix a FIXME.

2016-06-08 Thread Martin Probst via cfe-commits
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:/

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

2016-06-09 Thread Martin Probst via cfe-commits
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

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

2016-06-09 Thread Martin Probst via cfe-commits
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

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

2016-06-09 Thread Martin Probst via cfe-commits
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(

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

2016-06-09 Thread Martin Probst via cfe-commits
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

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

2016-06-09 Thread Martin Probst via cfe-commits
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

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

2016-06-09 Thread Martin Probst via cfe-commits
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()

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

2016-06-09 Thread Martin Probst via cfe-commits
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

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

2016-06-09 Thread Martin Probst via cfe-commits
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) || +

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

2016-06-12 Thread Martin Probst via cfe-commits
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

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

2016-06-12 Thread Martin Probst via cfe-commits
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

[PATCH] D21273: clang-format: [JS] Introduce WrapJavaScriptImports option.

2016-06-12 Thread Martin Probst via cfe-commits
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

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

2016-06-12 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D21273: clang-format: [JS] Introduce WrapJavaScriptImports option.

2016-06-13 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D21273: clang-format: [JS] Introduce WrapJavaScriptImports option.

2016-06-13 Thread Martin Probst via cfe-commits
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

r272558 - clang-format: [JS] Introduce JavaScriptWrapImports option.

2016-06-13 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D21273: clang-format: [JS] Introduce WrapJavaScriptImports option.

2016-06-13 Thread Martin Probst via cfe-commits
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

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

2016-06-13 Thread Martin Probst via cfe-commits
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

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

2016-06-13 Thread Martin Probst via cfe-commits
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

r272569 - clang-format: [JS] Initialize new configuration value.

2016-06-13 Thread Martin Probst via cfe-commits
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

[PATCH] D21597: clang-format: [JS] recognize more type locations.

2016-06-21 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D21597: clang-format: [JS] recognize more type locations.

2016-06-21 Thread Martin Probst via cfe-commits
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.

r273422 - clang-format: [JS] Do not break before 'as'.

2016-06-22 Thread Martin Probst via cfe-commits
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:

Re: [PATCH] D21597: clang-format: [JS] recognize more type locations.

2016-06-22 Thread Martin Probst via cfe-commits
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 ===

Re: [PATCH] D21597: clang-format: [JS] recognize more type locations.

2016-06-22 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D21597: clang-format: [JS] recognize more type locations.

2016-06-23 Thread Martin Probst via cfe-commits
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); --

Re: [PATCH] D21597: clang-format: [JS] recognize more type locations.

2016-06-23 Thread Martin Probst via cfe-commits
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

r273603 - clang-format: [JS] recognize more type locations.

2016-06-23 Thread Martin Probst via cfe-commits
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-

Re: [PATCH] D21597: clang-format: [JS] recognize more type locations.

2016-06-23 Thread Martin Probst via cfe-commits
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

[PATCH] D21658: clang-format: [JS] handle conditionals in fields, default params.

2016-06-23 Thread Martin Probst via cfe-commits
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

Re: [PATCH] D21658: clang-format: [JS] handle conditionals in fields, default params.

2016-06-23 Thread Martin Probst via cfe-commits
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

r273619 - clang-format: [JS] handle conditionals in fields, default params.

2016-06-23 Thread Martin Probst via cfe-commits
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

<    1   2   3   4   >