[PATCH] D47193: clang-format: [JS] do not wrap before any `is`.

2018-05-22 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Herald added subscribers: cfe-commits, klimek. `is` type annotations can occur at any nesting level. For example: function x() { return function y(): a is B { ... }; } Breaking before the `is` above breaks TypeScript pars

[PATCH] D47193: clang-format: [JS] do not wrap before any `is`.

2018-05-22 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC332968: clang-format: [JS] do not wrap before any `is`. (authored by mprobst, committed by ). Changed prior to commit: https://reviews.llvm.org/D47193?vs=147978&id=147979#toc Repository: rC Clang ht

[PATCH] D49797: [clang-format] Indent after breaking Javadoc annotated line

2018-07-26 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: lib/Format/BreakableToken.cpp:526 + 0, Content[LineIndex].find_first_of(Blanks)); + if (FirstWord == "@param") +return Style.ContinuationIndentWidth; Shouldn't this check the set above? Comme

[PATCH] D49797: [clang-format] Indent after breaking Javadoc annotated line

2018-07-27 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: unittests/Format/FormatTestComments.cpp:3109 +TEST_F(FormatTestComments, IndentsLongJavadocAnnotatedLines) { + FormatStyle Style = getGoogleStyle(FormatStyle::LK_Java); + Style.ColumnLimit = 60; mprobst wrote: > add a

[PATCH] D49797: [clang-format] Indent after breaking Javadoc annotated line

2018-07-27 Thread Martin Probst via Phabricator via cfe-commits
mprobst accepted this revision. mprobst added inline comments. This revision is now accepted and ready to land. Comment at: lib/Format/Format.cpp:814 +// by qualified identifiers. +GoogleStyle.CommentPragmas = "(taze:|^/[ \t]*<|@see|@exports|@module|@mods)"; GoogleS

[PATCH] D49797: [clang-format] Indent after breaking Javadoc annotated line

2018-07-27 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: lib/Format/Format.cpp:814 +// by qualified identifiers. +GoogleStyle.CommentPragmas = "(taze:|^/[ \t]*<|@see|@exports|@module|@mods)"; GoogleStyle.MaxEmptyLinesToKeep = 3; krasimir wrote: > mprobst wrote: >

[PATCH] D50177: clang-format: fix a crash in comment wraps.

2018-08-02 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Previously, clang-format would crash if it tried to wrap an overlong single line comment, because two parts of the code inserted a break in the same location. /** heregoesalongcommentwithnospace */ This wasn't previously notice

[PATCH] D50177: clang-format: fix a crash in comment wraps.

2018-08-02 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL338706: clang-format: fix a crash in comment wraps. (authored by mprobst, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D50177 Files: cfe/trun

[PATCH] D50230: clang-format: [JS] don't break comments before any '{'

2018-08-03 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Previously, clang-format would avoid breaking before the first `{` found, but then happily break before subsequent '{'s on the line. This change fixes that by looking for the first location that has no opening curly, if any. Repo

[PATCH] D50230: clang-format: [JS] don't break comments before any '{'

2018-08-03 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 158946. mprobst added a comment. Also handle multiple numbered list tokens. Repository: rC Clang https://reviews.llvm.org/D50230 Files: lib/Format/BreakableToken.cpp unittests/Format/FormatTestJS.cpp Index: unittests/Format/FormatTestJS.cpp ===

[PATCH] D50230: clang-format: [JS] don't break comments before any '{'

2018-08-03 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC338837: clang-format: [JS] don't break comments before any '{' (authored by mprobst, committed by ). Changed prior to commit: https://reviews.llvm.org/D50230?vs=158946&id=158957#toc Repository: rC Cl

[PATCH] D50249: clang-format: [JS] don't break comments before any '{'

2018-08-03 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Herald added a subscriber: cfe-commits. Previously, clang-format would avoid breaking before the first `{` found, but then happily break before subsequent '{'s on the line. This change fixes that by looking for the first location t

[PATCH] D50249: clang-format: [JS] don't break comments before any '{'

2018-08-03 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC338890: clang-format: [JS] don't break comments before any '{' (authored by mprobst, committed by ). Changed prior to commit: https://reviews.llvm.org/D50249?vs=158993&id=159001#toc Repository: rC Cl

[PATCH] D43440: clang-format: [JS] fix `of` detection.

2018-02-18 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: djasper. Herald added a subscriber: klimek. `of` is only a keyword when after an identifier, but not when after an actual keyword. Before: return of (a, b, c); After: return of(a, b, c); Repository: rC Clang https://reviews.llvm

[PATCH] D43440: clang-format: [JS] fix `of` detection.

2018-02-19 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL325489: clang-format: [JS] fix `of` detection. (authored by mprobst, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D43440 Files: cfe/trunk/lib

[PATCH] D33640: clang-format: [JS] fix indenting bound functions.

2017-05-29 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. The previous fix to force build style wrapping if the previous token is a closing parenthesis broke a peculiar pattern where users parenthesize the function declaration in a bind call: fn((function() { ... }).bind(this)); This

[PATCH] D33640: clang-format: [JS] fix indenting bound functions.

2017-05-29 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 100588. mprobst added a comment. - fix comment https://reviews.llvm.org/D33640 Files: lib/Format/ContinuationIndenter.cpp unittests/Format/FormatTestJS.cpp Index: unittests/Format/FormatTestJS.cpp ==

[PATCH] D33640: clang-format: [JS] fix indenting bound functions.

2017-05-29 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 100589. mprobst added a comment. - fix comment https://reviews.llvm.org/D33640 Files: lib/Format/ContinuationIndenter.cpp unittests/Format/FormatTestJS.cpp Index: unittests/Format/FormatTestJS.cpp ==

[PATCH] D33640: clang-format: [JS] fix indenting bound functions.

2017-05-29 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL304135: clang-format: [JS] fix indenting bound functions. (authored by mprobst). Changed prior to commit: https://reviews.llvm.org/D33640?vs=100589&id=100591#toc Repository: rL LLVM https://reviews.

[PATCH] D33714: clang-format: [JS] improve calculateBraceType heuristic

2017-05-31 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. calculateBraceTypes decides for braced init for empty brace pairs ({}). In context of a function declaration, this incorrectly classifies empty function or method bodies as braced inits, leading to missing wraps: class C {

[PATCH] D33714: clang-format: [JS] improve calculateBraceType heuristic

2017-05-31 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 100839. mprobst added a comment. TODO => FIXME https://reviews.llvm.org/D33714 Files: lib/Format/UnwrappedLineParser.cpp unittests/Format/FormatTestJS.cpp Index: unittests/Format/FormatTestJS.cpp ===

[PATCH] D33714: clang-format: [JS] improve calculateBraceType heuristic

2017-05-31 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 100840. mprobst added a comment. - restrict to JS, C++ actually wants this. https://reviews.llvm.org/D33714 Files: lib/Format/UnwrappedLineParser.cpp unittests/Format/FormatTestJS.cpp Index: unittests/Format/FormatTestJS.cpp ==

[PATCH] D33714: clang-format: [JS] improve calculateBraceType heuristic

2017-05-31 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL304290: clang-format: [JS] improve calculateBraceType heuristic (authored by mprobst). Changed prior to commit: https://reviews.llvm.org/D33714?vs=100840&id=100841#toc Repository: rL LLVM https://re

[PATCH] D33857: Correctly Indent Nested JavaScript Literals.

2017-06-06 Thread Martin Probst via Phabricator via cfe-commits
mprobst accepted this revision. mprobst added a comment. This revision is now accepted and ready to land. LGTM Repository: rL LLVM https://reviews.llvm.org/D33857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-b

[PATCH] D33857: Correctly Indent Nested JavaScript Literals.

2017-06-06 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL304791: clang-format: [JS] Correctly Indent Nested JavaScript Literals. (authored by mprobst). Changed prior to commit: https://reviews.llvm.org/D33857?vs=101296&id=101547#toc Repository: rL LLVM ht

[PATCH] D48030: clang-format: [JS] strict prop init annotation.

2018-06-11 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. TypeScript uses the `!` token for strict property initialization assertions, as in: class X { strictPropAsserted!: string; } Previously, clang-format would wrap between the `!` and the `:` for overly long lines. This patc

[PATCH] D48030: clang-format: [JS] strict prop init annotation.

2018-06-11 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 150770. mprobst added a comment. fix typo in test Repository: rC Clang https://reviews.llvm.org/D48030 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestJS.cpp Index: unittests/Format/FormatTestJS.cpp =

[PATCH] D48030: clang-format: [JS] strict prop init annotation.

2018-06-11 Thread Martin Probst via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL334415: clang-format: [JS] strict prop init annotation. (authored by mprobst, committed by ). Herald added a subscriber: l

[PATCH] D59527: [clang-format] Don't insert break between JS template string and tag identifier

2019-03-19 Thread Martin Probst via Phabricator via cfe-commits
mprobst accepted this revision. mprobst added a comment. This revision is now accepted and ready to land. LGTM. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59527/new/ https://reviews.llvm.org/D59527 ___ cfe-commits

[PATCH] D59527: [clang-format] Don't insert break between JS template string and tag identifier

2019-03-19 Thread Martin Probst via Phabricator via cfe-commits
mprobst closed this revision. mprobst added a comment. Landed as r356447. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59527/new/ https://reviews.llvm.org/D59527 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[PATCH] D59292: [clang-format] messes up indentation when using JavaScript private fields and methods

2019-03-19 Thread Martin Probst via Phabricator via cfe-commits
mprobst accepted this revision. mprobst added a comment. This revision is now accepted and ready to land. Actually I'll fix the nits. Comment at: clang/docs/ReleaseNotes.rst:174 -- ... +- Add support for correct indenting of private fields and methods in Javascript. --

[PATCH] D59292: [clang-format] messes up indentation when using JavaScript private fields and methods

2019-03-19 Thread Martin Probst via Phabricator via cfe-commits
mprobst closed this revision. mprobst added a comment. Landed in r356449, thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59292/new/ https://reviews.llvm.org/D59292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[PATCH] D52535: clang-format: [JS] space after parameter naming.

2018-09-26 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: mboehme. Previously: foo(/*bar=*/baz); Now: foo(/*bar=*/ baz); The run-in parameter naming comment is not intended in JS. Repository: rC Clang https://reviews.llvm.org/D52535 Files: lib/Format/TokenAnnotator.cpp unittests/F

[PATCH] D52535: clang-format: [JS] space after parameter naming.

2018-09-26 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL343080: clang-format: [JS] space after parameter naming. (authored by mprobst, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D52535 Files: cfe

[PATCH] D52535: clang-format: [JS] space after parameter naming.

2018-09-26 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC343080: clang-format: [JS] space after parameter naming. (authored by mprobst, committed by ). Changed prior to commit: https://reviews.llvm.org/D52535?vs=167073&id=167077#toc Repository: rL LLVM ht

[PATCH] D52536: clang-format: [JS] conditional types.

2018-09-26 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. This change adds some rudimentary support for conditional types. Specifically it avoids breaking before `extends` and `infer` keywords, which are subject to Automatic Semicolon Insertion, so breaking before them creates incorrect s

[PATCH] D52536: clang-format: [JS] conditional types.

2018-09-26 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 167239. mprobst added a comment. - comment in test Repository: rC Clang https://reviews.llvm.org/D52536 Files: lib/Format/FormatToken.h lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestJS.cpp Index: unittests/Format/FormatTestJS.cpp =

[PATCH] D52536: clang-format: [JS] conditional types.

2018-09-26 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL343179: clang-format: [JS] conditional types. (authored by mprobst, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D52536 Files: cfe/trunk/lib/

[PATCH] D37142: clang-format: [JS] simplify template string wrapping.

2017-08-25 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. Previously, clang-format would try to wrap template string substitutions by indenting relative to the openening `${`. This helped with indenting structured strings, such as strings containing HTML, as the substitutions would be alig

[PATCH] D37142: clang-format: [JS] simplify template string wrapping.

2017-08-28 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 112858. mprobst added a comment. - clang-format: [JS] wrap calls w/ literals in template strings. https://reviews.llvm.org/D37142 Files: lib/Format/ContinuationIndenter.cpp unittests/Format/FormatTestJS.cpp Index: unittests/Format/FormatTestJS.cpp

[PATCH] D37142: clang-format: [JS] simplify template string wrapping.

2017-08-28 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:1139 + + // On lines containing template strings, propagate NoLineBreak even for dict + // and array literals. This is to force wrapping an initial function call if djasper wrote: >

[PATCH] D37142: clang-format: [JS] simplify template string wrapping.

2017-08-28 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:1139 + + // On lines containing template strings, propagate NoLineBreak even for dict + // and array literals. This is to force wrapping an initial function call if djasper wrote: >

[PATCH] D37142: clang-format: [JS] simplify template string wrapping.

2017-08-29 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 113036. mprobst added a comment. - drop function name wrapping hack https://reviews.llvm.org/D37142 Files: lib/Format/ContinuationIndenter.cpp unittests/Format/FormatTestJS.cpp Index: unittests/Format/FormatTestJS.cpp ==

[PATCH] D37142: clang-format: [JS] simplify template string wrapping.

2017-08-29 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:1139 + + // On lines containing template strings, propagate NoLineBreak even for dict + // and array literals. This is to force wrapping an initial function call if mprobst wrote: >

[PATCH] D37142: clang-format: [JS] simplify template string wrapping.

2017-08-29 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL311988: clang-format: [JS] simplify template string wrapping. (authored by mprobst). Repository: rL LLVM https://reviews.llvm.org/D37142 Files: cfe/trunk/lib/Format/ContinuationIndenter.cpp cfe/tr

[PATCH] D56385: clang-format: [JS] support goog.requireType.

2019-01-07 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. It's a new primitive for importing symbols, and should be treated like the (previously handled) `goog.require` and `goog.forwardDeclare`. Repository: rC Clang https://reviews.llvm.org/D56385 Files: lib/Format/TokenAnnotator

[PATCH] D56385: clang-format: [JS] support goog.requireType.

2019-01-07 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL350516: clang-format: [JS] support goog.requireType. (authored by mprobst, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D77311: clang-format: [JS] detect C++ keywords.

2020-04-03 Thread Martin Probst via Phabricator via cfe-commits
mprobst marked 2 inline comments as done. mprobst added inline comments. Comment at: clang/lib/Format/FormatToken.h:913 bool IsJavaScriptIdentifier(const FormatToken &Tok) const { -return Tok.is(tok::identifier) && - JsExtraKeywords.find(Tok.Tok.getIdentifierInfo

[PATCH] D77311: clang-format: [JS] detect C++ keywords.

2020-04-03 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. mprobst marked an inline comment as done. Closed by commit rG146d685cd657: clang-format: [JS] detect C++ keywords. (authored by mprobst). Changed prior to commit: https://reviews.llvm.org/D77311?vs=254741&id=254763#toc R

[PATCH] D77548: clang-format: [JS] handle pseudo-keywords.

2020-04-06 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Herald added a project: clang. Herald added a subscriber: cfe-commits. The previous change in https://reviews.llvm.org/D77311 attempted to detect more C++ keywords. However it also precisely detected all JavaScript keywords. That's

[PATCH] D77548: clang-format: [JS] handle pseudo-keywords.

2020-04-06 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG92201505cdec: clang-format: [JS] handle pseudo-keywords. (authored by mprobst). Changed prior to commit: https://reviews.llvm.org/D77548?vs=255314&id=255357#toc Repository: rG LLVM Github Monorepo C

[PATCH] D40410: clang-format: [JS] disable ASI on decorators.

2017-11-24 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. Automatic Semicolon Insertion in clang-format tries to guess if a line wrap should insert an implicit semicolong. The previous heuristic would not trigger ASI if a token was immediately preceded by an `@` sign: function foo(@Bar

[PATCH] D40424: clang-format: [JS] handle semis in generic types.

2017-11-24 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. TypeScript generic type arguments can contain object (literal) types, which in turn can contain semicolons: const x: Array<{a: number; b: string;} = []; Previously, clang-format would incorrectly categorize the braced list as a

[PATCH] D40410: clang-format: [JS] disable ASI on decorators.

2017-11-25 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL318973: clang-format: [JS] disable ASI on decorators. (authored by mprobst). Repository: rL LLVM https://reviews.llvm.org/D40410 Files: cfe/trunk/lib/Format/UnwrappedLineParser.cpp cfe/trunk/unitt

[PATCH] D40424: clang-format: [JS] handle semis in generic types.

2017-11-25 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL318975: clang-format: [JS] handle semis in generic types. (authored by mprobst). Repository: rL LLVM https://reviews.llvm.org/D40424 Files: cfe/trunk/lib/Format/UnwrappedLineParser.cpp cfe/trunk/u

[PATCH] D40642: clang-format: [JS] do not wrap after async/await.

2017-11-30 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added subscribers: cfe-commits, klimek. Otherwise automatic semicolon insertion can trigger, i.e. wrapping produces invalid syntax. Repository: rC Clang https://reviews.llvm.org/D40642 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestJ

[PATCH] D40642: clang-format: [JS] do not wrap after async/await.

2017-11-30 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL319415: clang-format: [JS] do not wrap after async/await. (authored by mprobst). Repository: rL LLVM https://reviews.llvm.org/D40642 Files: cfe/trunk/lib/Format/TokenAnnotator.cpp cfe/trunk/unitte

[PATCH] D66736: clang-format: [JS] handle `as const`.

2019-08-26 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Herald added a project: clang. TypeScript 3.4 supports casting into a const type using `as const`: const x = {x: 1} as const; Previously, clang-format would insert a space after the `const`. With this patch, no space is inserte

[PATCH] D66736: clang-format: [JS] handle `as const`.

2019-08-26 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5836472ac488: clang-format: [JS] handle `as const`. (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66736/new/ https://reviews.llvm.org

[PATCH] D36131: clang-format: [JS] handle object types in extends positions.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. clang-format would previously drop the whitespace after `extends` in code such as: class Foo extends {} {} Where the first set of curly braces is an inline object literal type. https://reviews.llvm.org/D36131 Files: lib/Fo

[PATCH] D36132: clang-format: [JS] support default imports.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. Formerly, `import {default as X} from y;` would not be recognized as an import. https://reviews.llvm.org/D36132 Files: lib/Format/SortJavaScriptImports.cpp unittests/Format/SortImportsTestJS.cpp Index: unittests/Format/Sort

[PATCH] D36131: clang-format: [JS] handle object types in extends positions.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 109078. mprobst added a comment. - revert bogus change https://reviews.llvm.org/D36131 Files: lib/Format/TokenAnnotator.cpp lib/Format/UnwrappedLineParser.cpp unittests/Format/FormatTestJS.cpp Index: unittests/Format/FormatTestJS.cpp ===

[PATCH] D36139: clang-format: [JS] prefer wrapping chains over empty literals.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. E.g. don't wrap like this: (foo.bar.baz).and.bam(Blah.of({ })) But rather: (foo.bar.baz) .and.bam(Blah.of({})) https://reviews.llvm.org/D36139 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestJS.

[PATCH] D36142: clang-format: [JS] do not insert whitespace in call positions.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. In JavaScript, may keywords can be used in method names and thus call sites: foo.delete(); foo.instanceof(); clang-format would previously insert whitespace after the `instanceof`. This change generically skips inserting white

[PATCH] D36142: clang-format: [JS] do not insert whitespace in call positions.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 109089. mprobst added a comment. - support switch, case, delete. https://reviews.llvm.org/D36142 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestJS.cpp Index: unittests/Format/FormatTestJS.cpp ==

[PATCH] D36144: clang-format: [JS] consistenly format enums.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. Previously, const enums would get formatted differently because the modifier was not recognized. https://reviews.llvm.org/D36144 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestJS.cpp Index: unittests/Forma

[PATCH] D36146: clang-format: [JS] whitespace between keywords and parenthesized expressions.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. `throw (...)` should have a whitespace following it, as do await and void. https://reviews.llvm.org/D36146 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestJS.cpp Index: unittests/Format/FormatTestJS.cpp

[PATCH] D36147: clang-format: [JS] handle union types in arrow functions.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. clang-format would previously fail to detect that an arrow functions parameter block is not an expression, and thus insert whitespace around the `|` and `&` type operators in it. https://reviews.llvm.org/D36147 Files: lib/For

[PATCH] D36148: clang-format: [JS] support fields with case/switch/default labels.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. `case:` and `default:` would normally parse as labels for a `switch` block. However in TypeScript, they can be used in field declarations, e.g.: interface I { case: string; } This change special cases parsing them in decla

[PATCH] D36131: clang-format: [JS] handle object types in extends positions.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL309695: clang-format: [JS] handle object types in extends positions. (authored by mprobst). Repository: rL LLVM https://reviews.llvm.org/D36131 Files: cfe/trunk/lib/Format/TokenAnnotator.cpp cfe/t

[PATCH] D36132: clang-format: [JS] support default imports.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL309697: clang-format: [JS] support default imports. (authored by mprobst). Changed prior to commit: https://reviews.llvm.org/D36132?vs=109059&id=109136#toc Repository: rL LLVM https://reviews.llvm.o

[PATCH] D36159: clang-format: [JS] handle single lines comments ending in `\\`.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. Previously, clang-format would consider the following code line to be part of the comment and incorrectly format the rest of the file. https://reviews.llvm.org/D36159 Files: lib/Format/FormatTokenLexer.cpp unittests/Format/Fo

[PATCH] D36144: clang-format: [JS] consistenly format enums.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL309703: clang-format: [JS] consistenly format enums. (authored by mprobst). Repository: rL LLVM https://reviews.llvm.org/D36144 Files: cfe/trunk/lib/Format/TokenAnnotator.cpp cfe/trunk/unittests/F

[PATCH] D36147: clang-format: [JS] handle union types in arrow functions.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL309707: clang-format: [JS] handle union types in arrow functions. (authored by mprobst). Repository: rL LLVM https://reviews.llvm.org/D36147 Files: cfe/trunk/lib/Format/TokenAnnotator.cpp cfe/trun

[PATCH] D36146: clang-format: [JS] whitespace between keywords and parenthesized expressions.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL309710: clang-format: [JS] whitespace between keywords and parenthesized expressions. (authored by mprobst). Repository: rL LLVM https://reviews.llvm.org/D36146 Files: cfe/trunk/lib/Format/TokenAnno

[PATCH] D36139: clang-format: [JS] prefer wrapping chains over empty literals.

2017-08-01 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL309712: clang-format: [JS] prefer wrapping chains over empty literals. (authored by mprobst). Changed prior to commit: https://reviews.llvm.org/D36139?vs=109082&id=109155#toc Repository: rL LLVM htt

[PATCH] D36148: clang-format: [JS] support fields with case/switch/default labels.

2017-08-04 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL310070: clang-format: [JS] support fields with case/switch/default labels. (authored by mprobst). Repository: rL LLVM https://reviews.llvm.org/D36148 Files: cfe/trunk/lib/Format/UnwrappedLineParser.

[PATCH] D36359: [clang-format] Put '/**' and '*/' on own lines in jsdocs ending in comment pragmas

2017-08-07 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: lib/Format/BreakableToken.cpp:688 + if (DelimitersOnNewline) { +StringRef TrimmedContent = Content.back().substr(TailOffset).rtrim(Blanks); +if (!TrimmedContent.empty()) { Can you add a comment on what this is d

[PATCH] D36159: clang-format: [JS] handle single lines comments ending in `\\`.

2017-08-07 Thread Martin Probst via Phabricator via cfe-commits
mprobst added a comment. Friendly ping. https://reviews.llvm.org/D36159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D36159: clang-format: [JS] handle single lines comments ending in `\\`.

2017-08-08 Thread Martin Probst via Phabricator via cfe-commits
mprobst marked an inline comment as done. mprobst added inline comments. Comment at: lib/Format/FormatTokenLexer.cpp:544-545 +while (BackslashPos != StringRef::npos) { + if (BackslashPos + 1 < FormatTok->TokenText.size() && + FormatTok->TokenText[BackslashPos +

[PATCH] D36159: clang-format: [JS] handle single lines comments ending in `\\`.

2017-08-08 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. mprobst marked 2 inline comments as done. Closed by commit rL310365: clang-format: [JS] handle single lines comments ending in `\\`. (authored by mprobst). Repository: rL LLVM https://reviews.llvm.org/D36159 Files: cf

[PATCH] D36491: clang-format: [JS] detect ASI after closing parens.

2017-08-08 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. A closing parenthesis followed by a declaration or statement should always terminate the current statement. https://reviews.llvm.org/D36491 Files: lib/Format/UnwrappedLineParser.cpp unittests/Format/FormatTestJS.cpp Index:

[PATCH] D36491: clang-format: [JS] detect ASI after closing parens.

2017-08-09 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL310482: clang-format: [JS] detect ASI after closing parens. (authored by mprobst). Repository: rL LLVM https://reviews.llvm.org/D36491 Files: cfe/trunk/lib/Format/UnwrappedLineParser.cpp cfe/trunk

[PATCH] D36142: clang-format: [JS] do not insert whitespace in call positions.

2017-08-14 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 110959. mprobst marked 2 inline comments as done. mprobst added a comment. - clean up implementation, just use getIdentifierInfo - clean up tests, remove illegal syntax, add more tests https://reviews.llvm.org/D36142 Files: lib/Format/TokenAnnotator.cpp

[PATCH] D36142: clang-format: [JS] do not insert whitespace in call positions.

2017-08-14 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:2355 +(Left.Tok.getIdentifierInfo() || + Left.isOneOf(tok::kw_switch, tok::kw_case, tok::kw_delete))) + return false; djasper wrote: > Why is instanceof not required in

[PATCH] D36684: clang-format: [JS] wrap optional properties in type aliases.

2017-08-14 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. clang-format wraps object literal keys in an object literal if they are marked as `TT_SelectorName`s and/or the colon is marked as `TT_DictLiteral`. Previously, clang-format would accidentally work because colons in type aliases wer

[PATCH] D36142: clang-format: [JS] do not insert whitespace in call positions.

2017-08-14 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL310851: clang-format: [JS] do not insert whitespace in call positions. (authored by mprobst). Repository: rL LLVM https://reviews.llvm.org/D36142 Files: cfe/trunk/lib/Format/TokenAnnotator.cpp cfe

[PATCH] D36684: clang-format: [JS] wrap optional properties in type aliases.

2017-08-14 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL310852: clang-format: [JS] wrap optional properties in type aliases. (authored by mprobst). Repository: rL LLVM https://reviews.llvm.org/D36684 Files: cfe/trunk/lib/Format/TokenAnnotator.cpp cfe/t

[PATCH] D70377: clang-format: [JS] tests for async wrapping.

2020-01-16 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG736a3802124b: clang-format: [JS] tests for async wrapping. (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70377/new/ https://reviews.l

[PATCH] D72827: clang-format: [JS] Handle keyword-named methods.

2020-01-16 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Herald added a project: clang. Including `do`, `for`, and `while`, in addition to the previously handled fields. The unit test explicitly uses methods, but this code path handles both fields and methods. Repository: rG LLVM Git

[PATCH] D91078: [clang-format] do not break before @tags in JS comments

2020-11-09 Thread Martin Probst via Phabricator via cfe-commits
mprobst added a comment. See my comment on the upstream bug, let's chat a bit about whether we need this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91078/new/ https://reviews.llvm.org/D91078 ___ cfe-

[PATCH] D91132: clang-format: [JS] support new assignment operators.

2020-11-10 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Herald added a project: clang. mprobst requested review of this revision. Before: a && = b; After: a &&= b; These operators are new additions in ES2021. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D911

[PATCH] D91132: clang-format: [JS] support new assignment operators.

2020-11-10 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 304069. mprobst added a comment. - fix comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91132/new/ https://reviews.llvm.org/D91132 Files: clang/lib/Format/FormatToken.h clang/lib/Format/FormatTokenLex

[PATCH] D91132: clang-format: [JS] support new assignment operators.

2020-11-10 Thread Martin Probst via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG16212b8b3e4f: clang-format: [JS] support new assignment operators. (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D91078: [clang-format] do not break before @tags in JS comments

2020-11-10 Thread Martin Probst via Phabricator via cfe-commits
mprobst added a comment. For posterity: there was a question whether this is legal syntax in JSDoc in the first place (e.g. whether it should be escaped). That remains unclear - Closure Compiler parser however does ignore JSDoc tags if the line does not start with an `@` tag. So the safe thing

[PATCH] D104101: clang-format: [JS] don't sort named imports if off.

2021-06-11 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. mprobst requested review of this revision. Herald added a project: clang. The previous implementation would accidentally still sort the individual named imports, even if the module reference was in a clang-format off block. Repos

[PATCH] D104101: clang-format: [JS] don't sort named imports if off.

2021-06-11 Thread Martin Probst via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG63042d46bb0c: clang-format: [JS] don't sort named imports if off. (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D105087: [clang-format] PR49960 clang-format doesn't handle ASI after "return" on JavaScript

2021-06-29 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1015 +if (!eof()) { + if (Next->is(tok::identifier)) { +// Peek the next token. can you add comments explaining what syntax is being detected here?

[PATCH] D105087: [clang-format] PR49960 clang-format doesn't handle ASI after "return" on JavaScript

2021-07-01 Thread Martin Probst via Phabricator via cfe-commits
mprobst accepted this revision. mprobst added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1001 + if (TokenPosition < AllTokens.size()) { +FormatToken *PeekNext = AllTokens[TokenPosition]; +return PeekNext; nit: just `return AllT

[PATCH] D115147: clang-format: [JS] test case for numeric separators.

2021-12-06 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. mprobst requested review of this revision. Herald added a project: clang. ES2021 allows numeric literals using `_` as a separator. This already works, but had no test. Repository: rG LLVM Github Monorepo https://reviews.llvm.o

  1   2   3   >