This revision was automatically updated to reflect the committed changes.
Closed by commit rL280486: clang-format: [JS] handle default bindings in
imports. (authored by mprobst).
Changed prior to commit:
https://reviews.llvm.org/D23973?vs=69514&id=70159#toc
Repository:
rL LLVM
https://revie
mprobst marked an inline comment as done.
Comment at: lib/Format/Format.cpp:806
@@ -805,2 +805,3 @@
FormatTokenLexer &Tokens, tooling::Replacements &Result) override {
+tooling::Replacements RunResult;
deriveLocalStyle(AnnotatedLines);
djasper
Author: mprobst
Date: Fri Sep 2 09:29:48 2016
New Revision: 280487
URL: http://llvm.org/viewvc/llvm-project?rev=280487&view=rev
Log:
clang-format: [JS] merge requoting replacements.
Summary:
When formatting source code that needs both requoting and reindentation,
merge the replacements to avoid
This revision was automatically updated to reflect the committed changes.
mprobst marked an inline comment as done.
Closed by commit rL280487: clang-format: [JS] merge requoting replacements.
(authored by mprobst).
Changed prior to commit:
https://reviews.llvm.org/D24155?vs=70066&id=70164#toc
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
When code contains a comment between `return` and the value:
return /* lengthy comment here */ (
lengthyValueComesHere);
Do not wrap before th
mprobst added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:2384
@@ -2383,2 +2383,3 @@
} else if (Style.Language == FormatStyle::LK_JavaScript) {
-if (Left.is(tok::kw_return))
+const FormatToken *NonComment = Right.getPreviousNonComment();
+if (Left.isO
Author: mprobst
Date: Tue Sep 6 13:39:30 2016
New Revision: 280730
URL: http://llvm.org/viewvc/llvm-project?rev=280730&view=rev
Log:
clang-format: [JS] ignore comments when wrapping returns.
Summary:
When code contains a comment between `return` and the value:
return /* lengthy comment here
This revision was automatically updated to reflect the committed changes.
Closed by commit rL280730: clang-format: [JS] ignore comments when wrapping
returns. (authored by mprobst).
Changed prior to commit:
https://reviews.llvm.org/D24257?vs=70405&id=70444#toc
Repository:
rL LLVM
https://re
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Before:
x!as string
After:
x! as string
https://reviews.llvm.org/D24272
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Author: mprobst
Date: Tue Sep 6 13:55:34 2016
New Revision: 280731
URL: http://llvm.org/viewvc/llvm-project?rev=280731&view=rev
Log:
clang-format: [JS] whitespace required between ! and as.
Summary:
Before:
x!as string
After:
x! as string
Reviewers: djasper
Subscribers: klimek, cfe-com
This revision was automatically updated to reflect the committed changes.
Closed by commit rL280731: clang-format: [JS] whitespace required between ! and
as. (authored by mprobst).
Changed prior to commit:
https://reviews.llvm.org/D24272?vs=70442&id=70446#toc
Repository:
rL LLVM
https://rev
mprobst added inline comments.
Comment at: lib/Format/Format.cpp:1707
@@ +1706,3 @@
+ if (NewCode) {
+auto NewEnv = Environment::CreateVirtualEnvironment(
+*NewCode, FileName,
I guess we don't worry about the performance consequences here?
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
See (sorry, internal link): go/taze#global-symbols-dts-externs.
Before:
// taze: many, different, symbols from
// //some/long/iwyu/style/target
Af
mprobst updated this revision to Diff 71189.
mprobst added a comment.
- update commit msg
- make test case a bit more generic
https://reviews.llvm.org/D24477
Files:
lib/Format/Format.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
mprobst marked an inline comment as done.
mprobst added a comment.
https://reviews.llvm.org/D24477
___
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.
Before when a semicolon was missing after a boolean literal:
a = true
return 1;
clang-format would parse this as one line and format as:
a = tr
Author: mprobst
Date: Thu Mar 16 05:21:35 2017
New Revision: 297936
URL: http://llvm.org/viewvc/llvm-project?rev=297936&view=rev
Log:
[clang-format] disable adding extra space after MSVC '__super' keyword
clang-format treats MSVC `__super` keyword like all other keywords adding
a single space aft
Author: mprobst
Date: Wed Apr 5 05:56:07 2017
New Revision: 299533
URL: http://llvm.org/viewvc/llvm-project?rev=299533&view=rev
Log:
clang-format: [JS] fix whitespace around "of" operator.
Summary:
Previously:
import {of } from 'x';
of (null);
Now:
import {of} from 'x';
of(null)
Author: mprobst
Date: Mon Jan 16 03:52:40 2017
New Revision: 292099
URL: http://llvm.org/viewvc/llvm-project?rev=292099&view=rev
Log:
clang-format: [JS] revert over-eager ASI check.
Summary: Change r291428 introduced ASI detection after closing curly braces.
That would generally be correct, howe
Author: mprobst
Date: Fri Jan 27 03:09:11 2017
New Revision: 293270
URL: http://llvm.org/viewvc/llvm-project?rev=293270&view=rev
Log:
clang-format: [JS] do not format MPEG transport streams.
Summary:
The MPEG transport stream file format also uses ".ts" as its file extension.
This change detects
Author: mprobst
Date: Tue Feb 7 08:05:30 2017
New Revision: 294302
URL: http://llvm.org/viewvc/llvm-project?rev=294302&view=rev
Log:
clang-format: [JS] handle parenthesized class expressions.
Summary:
In JavaScript, classes are expressions, so they can appear e.g. in
argument lists.
var C =
Author: mprobst
Date: Tue Feb 7 08:08:03 2017
New Revision: 294304
URL: http://llvm.org/viewvc/llvm-project?rev=294304&view=rev
Log:
clang-format: [JS] exclaim preceding regex literals.
Summary:
Regex detection would incorrectly classify a trailing `!` operator
(nullability cast) followed by a `
Author: mprobst
Date: Tue Feb 7 10:33:13 2017
New Revision: 294315
URL: http://llvm.org/viewvc/llvm-project?rev=294315&view=rev
Log:
clang-format: [JS] correcly format object literal methods.
Summary:
In JavaScript, object literals can contain methods:
var x = {
a() { return 1; },
};
Author: mprobst
Date: Mon Jul 3 07:29:13 2017
New Revision: 307023
URL: http://llvm.org/viewvc/llvm-project?rev=307023&view=rev
Log:
clang-format: [JS] space between pseudo keywords and template literals.
Summary:
Before:
yield`foo`;
After:
yield `foo`;
Reviewers: djasper
Subscribers:
Author: mprobst
Date: Mon Jul 3 08:31:28 2017
New Revision: 307034
URL: http://llvm.org/viewvc/llvm-project?rev=307034&view=rev
Log:
Revert "clang-format: [JS] space between pseudo keywords and template literals."
This reverts commit 71d3b5cd916106005ef23467e3f6c7fbca7bc499.
Modified:
cfe/t
Author: mprobst
Date: Tue Jul 4 08:30:21 2017
New Revision: 307087
URL: http://llvm.org/viewvc/llvm-project?rev=307087&view=rev
Log:
clang-format: [JS] space between pseudo keywords and template literals.
Summary:
Before:
yield`foo`;
After:
yield `foo`;
This reinstates commit 71d3b5cd91 /
Author: mprobst
Date: Fri Jul 7 06:17:10 2017
New Revision: 307394
URL: http://llvm.org/viewvc/llvm-project?rev=307394&view=rev
Log:
clang-format: [JS] do not wrap after "readonly".
Summary:
Breaks after "readonly" trigger automatic semicolon insertion in field
declarations.
Reviewers: krasimir
Author: mprobst
Date: Tue Jul 18 07:00:19 2017
New Revision: 308306
URL: http://llvm.org/viewvc/llvm-project?rev=308306&view=rev
Log:
clang-format: [JS] Correctly format JavaScript imports with long module paths
Currently the `UnwrappedLineParser` fails to correctly unwrap JavaScript
imports wher
Author: mprobst
Date: Fri Jan 26 07:07:49 2018
New Revision: 323532
URL: http://llvm.org/viewvc/llvm-project?rev=323532&view=rev
Log:
clang-format: [JS] Prevent ASI before [ and (.
Summary:
JavaScript automatic semicolon insertion can trigger before [ and (, so
avoid breaking before them if the p
Author: mprobst
Date: Mon Feb 27 05:15:53 2017
New Revision: 296330
URL: http://llvm.org/viewvc/llvm-project?rev=296330&view=rev
Log:
clang-format: [JS] whitespace after async in arrow functions.
Summary:
Async arrow functions should be marked with a whitespace after the async
keyword, before th
Author: mprobst
Date: Tue Feb 28 05:08:24 2017
New Revision: 296467
URL: http://llvm.org/viewvc/llvm-project?rev=296467&view=rev
Log:
Blacklist arbitrary @\\w+ JSDoc tags from wrapping.
Summary:
Also limits the blacklisting to only apply when the tag is actually
followed by a parameter in curly b
Author: mprobst
Date: Mon Mar 13 02:10:18 2017
New Revision: 297605
URL: http://llvm.org/viewvc/llvm-project?rev=297605&view=rev
Log:
clang-format: [JS] do not wrap after interface and type.
Summary:
`interface` and `type` are pseudo keywords and cause automatic semicolon
insertion when followed
Author: mprobst
Date: Mon Mar 13 04:14:23 2017
New Revision: 297606
URL: http://llvm.org/viewvc/llvm-project?rev=297606&view=rev
Log:
clang-format: [JS] allow breaking after non-null assertions.
Summary:
Previously clang-format would not break after any !. However in TypeScript, !
can be used as
Author: mprobst
Date: Mon Mar 13 04:39:23 2017
New Revision: 297607
URL: http://llvm.org/viewvc/llvm-project?rev=297607&view=rev
Log:
clang-format: [JS] do not wrap @see tags.
Summary:
@see is special among JSDoc tags in that it is commonly followed by URLs. The
JSDoc spec suggests that users sh
Author: mprobst
Date: Wed Apr 26 07:34:15 2017
New Revision: 301397
URL: http://llvm.org/viewvc/llvm-project?rev=301397&view=rev
Log:
clang-format: [JS] prevent wraps before class members.
Summary: In JavaScript/TypeScript, class member definitions that use modifiers
can be subject to Automatic
Author: mprobst
Date: Wed Apr 26 07:34:18 2017
New Revision: 301398
URL: http://llvm.org/viewvc/llvm-project?rev=301398&view=rev
Log:
formatting
Modified:
cfe/trunk/lib/Format/TokenAnnotator.cpp
Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/t
Author: mprobst
Date: Wed Apr 26 07:36:49 2017
New Revision: 301399
URL: http://llvm.org/viewvc/llvm-project?rev=301399&view=rev
Log:
clang-format: [JS/Java] ignore Objective-C constructs in JS & Java.
Summary:
Java and JavaScript support annotations and decorators, respectively, that use
a lead
Author: mprobst
Date: Thu Apr 27 08:07:24 2017
New Revision: 301538
URL: http://llvm.org/viewvc/llvm-project?rev=301538&view=rev
Log:
clang-format: [JS] parse async function declarations.
Summary:
Previously, clang-format would accidentally parse an async function
declaration as a function expres
Author: mprobst
Date: Thu May 4 10:04:04 2017
New Revision: 302156
URL: http://llvm.org/viewvc/llvm-project?rev=302156&view=rev
Log:
clang-format: [JS] exponentiation operator
Summary: While its precedence should be higher than multiplicative, LLVM does
not have a level for that, so for the tim
Author: mprobst
Date: Tue May 9 07:45:48 2017
New Revision: 302523
URL: http://llvm.org/viewvc/llvm-project?rev=302523&view=rev
Log:
clang-format: [JS] keep triple slash directives intact.
Summary:
TypeScript uses triple slash directives of the form:
///
For various non-source instructions
Author: mprobst
Date: Tue May 9 15:04:09 2017
New Revision: 302580
URL: http://llvm.org/viewvc/llvm-project?rev=302580&view=rev
Log:
clang-format: [JS] Don't indent JavaScript IIFEs.
Because IIFEs[1] are often used like an anonymous namespace around large
sections of JavaScript code, it's useful
Author: mprobst
Date: Wed May 10 08:53:29 2017
New Revision: 302658
URL: http://llvm.org/viewvc/llvm-project?rev=302658&view=rev
Log:
clang-format: refine calculating brace types.
Summary:
For C++ code, opening parenthesis following a } indicate a braced init. For
JavaScript and other languages,
Author: mprobst
Date: Fri May 12 08:00:33 2017
New Revision: 302893
URL: http://llvm.org/viewvc/llvm-project?rev=302893&view=rev
Log:
clang-format: [JS] support non-null assertions after all identifiers.
Summary:
Previously:
x = namespace !;
Now:
x = namespace!;
Reviewers: djasper
Subs
Author: mprobst
Date: Mon May 15 03:15:53 2017
New Revision: 303038
URL: http://llvm.org/viewvc/llvm-project?rev=303038&view=rev
Log:
clang-format: [JS] fix non-null assertion operator recognition.
Summary:
`getIdentifierInfo()` includes all keywords, whereas non-null assertion
operators should o
Author: mprobst
Date: Mon May 15 06:15:29 2017
New Revision: 303049
URL: http://llvm.org/viewvc/llvm-project?rev=303049&view=rev
Log:
JavaScript allows parameter lists to include trailing commas:
myFunction(param1, param2,);
For symmetry with other parenthesized lists ([...], {...}), clang-f
Author: mprobst
Date: Mon May 15 14:33:20 2017
New Revision: 303106
URL: http://llvm.org/viewvc/llvm-project?rev=303106&view=rev
Log:
clang-format: [JS] for async loops.
Summary:
JavaScript supports asynchronous loop iteration in async functions:
for async (const x of y) ...
Reviewers: djas
Author: mprobst
Date: Thu May 18 16:19:29 2017
New Revision: 303382
URL: http://llvm.org/viewvc/llvm-project?rev=303382&view=rev
Log:
clang-format: [JS] for await, and fix a crash with for loops.
Summary:
The syntax is actually `for await (const x of y)` (d'oh).
This also fixes a crash for `for`
Author: mprobst
Date: Mon May 22 09:58:26 2017
New Revision: 303557
URL: http://llvm.org/viewvc/llvm-project?rev=303557&view=rev
Log:
clang-format: [JS] avoid line breaks before unindented r_parens.
The change that enabled wrapping at the previous scope's indentation had
unintended side-effects i
mprobst marked an inline comment as done.
mprobst added inline comments.
Comment at: unittests/Format/FormatTestJS.cpp:1280
+TEST_F(FormatTestJS, TemplateStringASI) {
+ verifyFormat("var x = `hello${world}`;", "var x = `hello${\n"
+ "
Author: mprobst
Date: Fri Oct 21 00:11:38 2016
New Revision: 284807
URL: http://llvm.org/viewvc/llvm-project?rev=284807&view=rev
Log:
clang-format: [JS] Fix template string ASI.
Summary:
Previously, automatic semicolon insertion would add an unwrapped line
when a template string contained a line
This revision was automatically updated to reflect the committed changes.
mprobst marked an inline comment as done.
Closed by commit rL284807: clang-format: [JS] Fix template string ASI.
(authored by mprobst).
Changed prior to commit:
https://reviews.llvm.org/D25675?vs=74837&id=75390#toc
Repos
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
See TypeScript grammar for tokens following 'declare':
https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#A.10
Additional minor change:
clang-
mprobst updated this revision to Diff 76831.
mprobst added a comment.
- drop kw_module from ASI protection block
https://reviews.llvm.org/D26274
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTestJS.cpp
Index: uni
Author: mprobst
Date: Thu Nov 10 10:21:02 2016
New Revision: 286468
URL: http://llvm.org/viewvc/llvm-project?rev=286468&view=rev
Log:
clang-format: [JS] do not break after declare namespace.
Summary:
See TypeScript grammar for tokens following 'declare':
https://github.com/Microsoft/TypeScript/bl
Author: mprobst
Date: Thu Nov 10 10:20:58 2016
New Revision: 286467
URL: http://llvm.org/viewvc/llvm-project?rev=286467&view=rev
Log:
clang-format: [JS] do not break after declare namespace.
See TypeScript grammar for tokens following 'declare':
https://github.com/Microsoft/TypeScript/blob/master
Author: mprobst
Date: Thu Nov 10 10:21:04 2016
New Revision: 286469
URL: http://llvm.org/viewvc/llvm-project?rev=286469&view=rev
Log:
drop kw_module from ASI protection block
Modified:
cfe/trunk/lib/Format/TokenAnnotator.cpp
Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp
URL:
http://llvm
This revision was automatically updated to reflect the committed changes.
Closed by commit rL286468: clang-format: [JS] do not break after declare
namespace. (authored by mprobst).
Changed prior to commit:
https://reviews.llvm.org/D26274?vs=76831&id=77493#toc
Repository:
rL LLVM
https://rev
mprobst created this revision.
mprobst added reviewers: klimek, djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
clang-format: [JS] handle let (ES6).
http://reviews.llvm.org/D13211
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
lib/Format/
mprobst created this revision.
mprobst added reviewers: djasper, klimek.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
JavaScript allows keywords to appear in IdenfierName positions, e.g. fields, or
object literal members, but not as plain identifiers.
http://reviews
mprobst updated this revision to Diff 35867.
mprobst marked an inline comment as done.
mprobst added a comment.
Use isOneOf instead of startsWith.
http://reviews.llvm.org/D13211
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
lib/Format/UnwrappedLineParser.cpp
unittests/Fo
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added subscribers: cfe-commits, klimek.
Slashes in regular expressions do not need to be escaped and do not terminate
the regular expression even without a preceding backslash.
http://reviews.llvm.org/D13641
Files:
lib/F
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added subscribers: klimek, cfe-commits.
If a RegExp contains a character group with a quote (`/["]/`), the
trailing end of it is first tokenized as a string literal, which leads
to the merging code seeing an unbalanced brack
mprobst updated this revision to Diff 37447.
mprobst added a comment.
Simplified escape handling.
http://reviews.llvm.org/D13765
Files:
lib/Format/Format.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
=
mprobst updated this revision to Diff 37654.
mprobst marked 3 inline comments as done.
mprobst added a comment.
- add test for if (...) /re/;
- address minor review comments
- fix unary handling.
http://reviews.llvm.org/D13765
Files:
lib/Format/Format.cpp
unittests/Format/FormatTestJS.cpp
mprobst added inline comments.
Comment at: lib/Format/Format.cpp:858
@@ +857,3 @@
+}
+if (Prev) {
+ if (Prev->isOneOf(tok::plus, tok::plusplus, tok::minus,
djasper wrote:
> I'd probably put this into the other two conditions to reduce indentation.
>
mprobst added inline comments.
Comment at: lib/Format/Format.cpp:757
@@ -756,3 +756,1 @@
- if (tryMergeEscapeSequence())
-return;
if (tryMergeTemplateString())
You cannot actually escape in a template string - backslashes in them are
literal b
mprobst updated this revision to Diff 37695.
mprobst marked 3 inline comments as done.
mprobst added a comment.
- add test
- review comments, fix unary handling.
- Extract canPrecedeRegexLiteral function.
http://reviews.llvm.org/D13765
Files:
lib/Format/Format.cpp
unittests/Format/FormatTes
mprobst added inline comments.
Comment at: lib/Format/Format.cpp:860
@@ +859,3 @@
+}
+if (Prev) {
+ if (Prev->isOneOf(tok::plusplus, tok::minusminus)) {
djasper wrote:
> I understand and I actually find that hard to understand. I think a better
> sol
mprobst added a comment.
Nice, great to see this.
Comment at: lib/Format/ContinuationIndenter.cpp:330
@@ -329,3 +329,3 @@
- if (Style.AlignAfterOpenBracket && Previous.opensScope() &&
- Previous.isNot(TT_ObjCMethodExpr) &&
+ if (Style.AlignAfterOpenBracket == FormatStyl
mprobst accepted this revision.
mprobst added a comment.
This revision is now accepted and ready to land.
LGTM.
http://reviews.llvm.org/D14104
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe
mprobst marked an inline comment as done.
Comment at: lib/Format/FormatTokenLexer.cpp:231
@@ -230,3 +230,3 @@
void FormatTokenLexer::tryParseTemplateString() {
FormatToken *BacktickToken = Tokens.back();
djasper wrote:
> I think, this could now use an elabor
mprobst updated this revision to Diff 64803.
mprobst added a comment.
- Use a stack to parse nested template strings.
- move docs
https://reviews.llvm.org/D22431
Files:
lib/Format/FormatTokenLexer.cpp
lib/Format/FormatTokenLexer.h
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTes
mprobst added a comment.
Friendly ping :-)
https://reviews.llvm.org/D22431
___
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.
http://reviews.llvm.org/D17385
Files:
lib/Format/Format.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
===
mprobst updated this revision to Diff 48338.
mprobst added a comment.
Fixed typo.
http://reviews.llvm.org/D17385
Files:
lib/Format/Format.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
===
--- u
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added subscribers: cfe-commits, klimek.
"import ... from '...';" and "export ... from '...';" should be treated the same
as goog.require/provide/module/forwardDeclare calls.
http://reviews.llvm.org/D17440
Files:
lib/Form
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added subscribers: cfe-commits, klimek.
http://reviews.llvm.org/D17439
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
===
mprobst added a comment.
FYI this should not be submitted yet, there are still style discussions going
on.
http://reviews.llvm.org/D17440
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com
mprobst updated this revision to Diff 48945.
mprobst marked an inline comment as done.
mprobst added a comment.
- Move code closer together by piping Replacements into the FormatTokenLexer.
http://reviews.llvm.org/D17385
Files:
lib/Format/Format.cpp
unittests/Format/FormatTestJS.cpp
Index:
mprobst marked an inline comment as done.
Comment at: lib/Format/Format.cpp:1579
@@ +1578,3 @@
+ // The width of the extra \ escapes is taken into account in getNextToken.
+ void requoteJSStringLiterals(tooling::Replacements &Replaces,
+ FormatToken
mprobst updated this revision to Diff 48946.
mprobst marked an inline comment as done.
mprobst added a comment.
- Move code closer together by piping Replacements into the FormatTokenLexer.
- remove sstream import
http://reviews.llvm.org/D17385
Files:
lib/Format/Format.cpp
unittests/Format/
>
> Nice, the behavior now seems nicely isolated. Is this a purely stylistic
> kind of change or do you think every JS developer working on any kind of
> codebase will want it? Generally this feels like something we should
> carefully enable with a dedicated style option. Where can I find more
> in
mprobst updated this revision to Diff 49214.
mprobst added a comment.
- Move code closer together by piping Replacements into the FormatTokenLexer.
- remove sstream import
- * Treat JavaScript single quoted string literals as tok::string_literal, not
http://reviews.llvm.org/D17385
Files:
incl
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
This change automatically sorts ES6 imports and exports into four groups:
absolute imports, parent imports, relative imports, and then exports. Exports
are
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
http://reviews.llvm.org/D20200
Files:
lib/Format/Format.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
===
Author: mprobst
Date: Thu May 12 06:20:32 2016
New Revision: 269282
URL: http://llvm.org/viewvc/llvm-project?rev=269282&view=rev
Log:
clang-format: [JS] respect clang-format off when requoting strings.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llv
This revision was automatically updated to reflect the committed changes.
Closed by commit rL269282: clang-format: [JS] respect clang-format off when
requoting strings. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D20200?vs=57014&id=57018#toc
Repository:
rL LLVM
h
mprobst updated this revision to Diff 57037.
mprobst added a comment.
- extract TokenAnalyzer.h and SortJavaScriptImports.h/cpp
- clean up imports
http://reviews.llvm.org/D20198
Files:
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
lib/Format/FormatToken.h
lib/Format/FormatTokenLexer.h
mprobst marked 2 inline comments as done.
mprobst added a comment.
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 updated this revision to Diff 57039.
mprobst added a comment.
- extract TokenAnalyzer.h and SortJavaScriptImports.h/cpp
- clean up imports/
- includes
http://reviews.llvm.org/D20198
Files:
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
lib/Format/FormatToken.h
lib/Format/Format
mprobst created this revision.
mprobst added reviewers: djasper, bkramer.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Simply looking at the final text greatly simplifies the algorithm and also
fixes a reported issue. This requires duplicating the "actual encoding wi
mprobst updated this revision to Diff 57066.
mprobst added a comment.
- simplify logic by parsing forward, reduce complexity to O(n) from O(n^2)
http://reviews.llvm.org/D20208
Files:
lib/Format/Format.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
==
mprobst updated this revision to Diff 57073.
mprobst marked 9 inline comments as done.
mprobst added a comment.
- extract TokenAnalyzer.h and SortJavaScriptImports.h/cpp
- clean up imports/
- includes
- address review comments
- pull out implementations from header files.
http://reviews.llvm.org
mprobst added a comment.
PTAL.
Comment at: lib/Format/SortJavaScriptImports.cpp:162
@@ +161,3 @@
+std::string ImportsText;
+for (unsigned i = 0, e = Indices.size(); i != e; ++i) {
+ JsImportExport ImpExp = Imports[Indices[i]];
djasper wrote:
> Is th
mprobst updated this revision to Diff 57138.
mprobst added a comment.
- extract TokenAnalyzer.h and SortJavaScriptImports.h/cpp
- clean up imports/
- includes
- address review comments
- pull out implementations from header files.
- support side effect imports, keep in relative order at top.
htt
Author: mprobst
Date: Tue May 17 01:29:29 2016
New Revision: 269747
URL: http://llvm.org/viewvc/llvm-project?rev=269747&view=rev
Log:
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 revision was automatically updated to reflect the committed changes.
Closed by commit rL269747: clang-format: [JS] fix template string width
counting. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D20208?vs=57066&id=57434#toc
Repository:
rL LLVM
http://reviews
Author: mprobst
Date: Tue May 17 01:29:33 2016
New Revision: 269748
URL: http://llvm.org/viewvc/llvm-project?rev=269748&view=rev
Log:
clang-format: [JS] simplify logic by parsing forward.
This also reduces complexity to O(n) from O(n^2) by avoiding backtracking
re-parses, and fixes length calcula
mprobst marked an inline comment as done.
Comment at: lib/Format/SortJavaScriptImports.cpp:77
@@ +76,3 @@
+return false;
+ // NB: empty URLs sort *last* (for export {...};).
+ if (LHS.URL.empty() != RHS.URL.empty())
djasper wrote:
> NB?
"Nota bene". Seems to
mprobst updated this revision to Diff 57438.
mprobst marked an inline comment as done.
mprobst added a comment.
- extract TokenAnalyzer.h and SortJavaScriptImports.h/cpp
- clean up imports/
- includes
- address review comments
- pull out implementations from header files.
- support side effect imp
101 - 200 of 350 matches
Mail list logo