[PATCH] D118448: clang-format: [JS] fix uninitialized memory.

2022-01-28 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 rGc26729251588: clang-format: [JS] fix uninitialized memory. (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D118448: clang-format: [JS] fix uninitialized memory.

2022-01-28 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added reviewers: jankuehle, krasimir. mprobst requested review of this revision. Herald added a project: clang. SortJavaScriptImports attempts to set its currently parsed token to an invalid token when it reaches the end of the line. However in doing so, it u

[PATCH] D118446: clang-format: [JS] sort import aliases. Users can define aliases for long symbols using import aliases:

2022-01-28 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 rG03c59765b3eb: clang-format: [JS] sort import aliases. Users can define aliases for long… (authored by mprobst). Repository: rG LLVM Github Monorep

[PATCH] D118446: clang-format: [JS] sort import aliases. Users can define aliases for long symbols using import aliases:

2022-01-28 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: jankuehle. Herald added a subscriber: jeroen.dobbelaere. mprobst requested review of this revision. Herald added a project: clang. import X = A.B.C; Previously, these were unhandled and would terminate import sorting. With this change, al

[PATCH] D118363: clang-format: [JS] sort import aliases.

2022-01-27 Thread Martin Probst via Phabricator via cfe-commits
mprobst closed this revision. mprobst added a comment. Landed in https://github.com/llvm/llvm-project/commit/c6d5efb5d98093c4bd7578b2ea52c9032d20dea3 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118363/new/ https://reviews.llvm.org/D118363 _

[PATCH] D118361: clang-format: [JS] sort import aliases.

2022-01-27 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 403646. mprobst added a comment. - make test break if we used alphasort Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118361/new/ https://reviews.llvm.org/D118361 Files: clang/unittests/Format/SortImportsTes

[PATCH] D118361: clang-format: [JS] sort import aliases.

2022-01-27 Thread Martin Probst via Phabricator via cfe-commits
mprobst abandoned this revision. mprobst added a comment. Superseded by https://reviews.llvm.org/D118363 (sorry for the diff confusion). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118361/new/ https://reviews.llvm.org/D118361 ___

[PATCH] D118363: clang-format: [JS] sort import aliases.

2022-01-27 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Herald added a subscriber: jeroen.dobbelaere. mprobst requested review of this revision. Herald added a project: clang. Users can define aliases for long symbols using import aliases: import X = A.B.C; Previously, these were un

[PATCH] D118361: clang-format: [JS] sort import aliases.

2022-01-27 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Herald added a subscriber: jeroen.dobbelaere. mprobst requested review of this revision. Herald added a project: clang. Users can define aliases for long symbols using import aliases: import X = A.B.C; Previously, these were un

[PATCH] D117197: [clang-format] Add new option to support adding a space between Javascript Union and Intersection types

2022-01-14 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3522 + if ((Left.is(TT_JsTypeOperator) && Right.isTypeOrIdentifier()) || + (Left.isTypeOrIdentifier() || Left.is(TT_TemplateCloser)) && + Right.is(TT_JsTypeOperator)) ---

[PATCH] D117197: [clang-format] Add new option to support adding a space between Javascript Union and Intersection types

2022-01-14 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3522 + if ((Left.is(TT_JsTypeOperator) && Right.isTypeOrIdentifier()) || + (Left.isTypeOrIdentifier() || Left.is(TT_TemplateCloser)) && + Right.is(TT_JsTypeOperator)) ---

[PATCH] D117197: [clang-format] Add new option to support adding a space between Javascript Union and Intersection types

2022-01-13 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3524 return false; if (Left.is(TT_JsTypeOperator) || Right.is(TT_JsTypeOperator)) return false; curdeius wrote: > HazardyKnusperkeks wrote: > > mprobst wrote: > > >

[PATCH] D117197: [clang-format] Add new option to support adding a space between Javascript Union and Intersection types

2022-01-13 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3524 return false; if (Left.is(TT_JsTypeOperator) || Right.is(TT_JsTypeOperator)) return false; MyDeveloperDay wrote: > mprobst wrote: > > shouldn't you change this

[PATCH] D117197: [clang-format] Add new option to support adding a space between Javascript Union and Intersection types

2022-01-13 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3524 return false; if (Left.is(TT_JsTypeOperator) || Right.is(TT_JsTypeOperator)) return false; shouldn't you change this line here? Repository: rG LLVM Github M

[PATCH] D116638: [clang-format] Fix ignoring JavaScriptWrapImport when ColumnWidth: 0

2022-01-05 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:2827 -**JavaScriptWrapImports** (``Boolean``) :versionbadge:`clang-format 3.9` - Whether to wrap JavaScript import/export statements. + * If ``ColumnWidth`` is 0 (no limit on the number of colum

[PATCH] D116638: [clang-format] Fix ignoring JavaScriptWrapImport when ColumnWidth: 0

2022-01-05 Thread Martin Probst via Phabricator via cfe-commits
mprobst added inline comments. Comment at: clang/docs/ClangFormatStyleOptions.rst:2827 -**JavaScriptWrapImports** (``Boolean``) :versionbadge:`clang-format 3.9` - Whether to wrap JavaScript import/export statements. + * If ``ColumnWidth`` is 0 (no limit on the number of colum

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

2021-12-06 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG327d966365d7: clang-format: [JS] test case for numeric separators. (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115147/new/ https://

[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

[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] 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] 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] 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] D101515: clang-format: [JS] handle "off" in imports

2021-04-30 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 rGb2780cd744ea: clang-format: [JS] handle "off" in imports (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D101515: clang-format: [JS] handle "off" in imports

2021-04-30 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 341849. mprobst added a comment. - review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101515/new/ https://reviews.llvm.org/D101515 Files: clang/lib/Format/SortJavaScriptImports.cpp clang/unittes

[PATCH] D101515: clang-format: [JS] handle "off" in imports

2021-04-30 Thread Martin Probst via Phabricator via cfe-commits
mprobst marked an inline comment as done. mprobst added a comment. added test for merging Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101515/new/ https://reviews.llvm.org/D101515 ___ cfe-commits mailin

[PATCH] D101515: clang-format: [JS] handle "off" in imports

2021-04-30 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 341815. mprobst added a comment. - test for avoiding merges Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101515/new/ https://reviews.llvm.org/D101515 Files: clang/lib/Format/SortJavaScriptImports.cpp clan

[PATCH] D101515: clang-format: [JS] handle "off" in imports

2021-04-30 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 341814. mprobst marked 4 inline comments as done. mprobst added a comment. - review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101515/new/ https://reviews.llvm.org/D101515 Files: clang/lib/Format

[PATCH] D101515: clang-format: [JS] handle "off" in imports

2021-04-30 Thread Martin Probst via Phabricator via cfe-commits
mprobst marked 9 inline comments as done. mprobst added a comment. PTAL, addressed review comments. Comment at: clang/lib/Format/SortJavaScriptImports.cpp:191 +!(FirstNonImportLine->First->is(tok::comment) && + FirstNonImportLine->First->TokenText.trim() == "//

[PATCH] D101515: clang-format: [JS] handle "off" in imports

2021-04-29 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added reviewers: krasimir, h-joo. mprobst requested review of this revision. Herald added a project: clang. Previously, the JavaScript import sorter would ignore `// clang-format off` and `on` comments. This change fixes that. It tracks whether formatting is

[PATCH] D101020: clang-format: [JS] do not merge side-effect imports.

2021-04-22 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 rGfbc6f42dbee5: clang-format: [JS] do not merge side-effect imports. (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D101020: clang-format: [JS] do not merge side-effect imports.

2021-04-21 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added reviewers: krasimir, h-joo. mprobst requested review of this revision. Herald added a project: clang. The if condition was testing the current element, but forgot to check the previous element (doh), so it would fail depending on sort order of the impor

[PATCH] D100953: clang-format: [JS] do not wrap after `asserts`

2021-04-21 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG70ae843d9980: clang-format: [JS] do not wrap after `asserts` (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100953/new/ https://review

[PATCH] D100953: clang-format: [JS] do not wrap after `asserts`

2021-04-21 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added reviewers: krasimir, h-joo. mprobst requested review of this revision. Herald added a project: clang. `asserts` is a pseudo keyword in TypeScript used in return types. Wrapping after it triggers automatic semicolon insertion, which breaks the code seman

[PATCH] D100752: clang-format: [JS] do not merge imports and exports.

2021-04-20 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3d4a6037ff46: clang-format: [JS] do not merge imports and exports. (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100752/new/ https://

[PATCH] D100752: clang-format: [JS] do not merge imports and exports.

2021-04-19 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. Previously, clang-format would erroneously merge import and export statements. These need to be kept separate, as the semantics differ. Repository: rG LL

[PATCH] D100466: clang-format: [JS] merge import lines.

2021-04-14 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. mprobst marked an inline comment as done. Closed by commit rGd45df0d29f70: clang-format: [JS] merge import lines. (authored by mprobst). Changed prior to commit: htt

[PATCH] D100466: clang-format: [JS] merge import lines.

2021-04-14 Thread Martin Probst via Phabricator via cfe-commits
mprobst marked 3 inline comments as done. mprobst added inline comments. Comment at: clang/lib/Format/SortJavaScriptImports.cpp:92 + // reference needs re-formatting. + bool SymbolsMerged; // The source location just after { and just before } in the import.

[PATCH] D100466: clang-format: [JS] merge import lines.

2021-04-14 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 337456. mprobst added a comment. address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100466/new/ https://reviews.llvm.org/D100466 Files: clang/lib/Format/SortJavaScriptImports.cpp clang/

[PATCH] D100466: clang-format: [JS] merge import lines.

2021-04-14 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. Multiple lines importing from the same URL can be merged: import {X} from 'a'; import {Y} from 'a'; Merge to: import {X, Y} from 'a'; This change i

[PATCH] D99495: clang-format: [JS] do not collapse - - to --.

2021-03-30 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2b30bd2be0a8: clang-format: [JS] do not collapse - - to --. (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99495/new/ https://reviews.

[PATCH] D99495: clang-format: [JS] do not collapse - - to --.

2021-03-29 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. In JavaScript, `- -1;` is legal syntax, the language allows unary minus. However the two tokens must not collapse together: `--1` is prefix decrement, i.e. d

[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] 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] 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
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] 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] 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] 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] 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] 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
mprobst updated this revision to Diff 254740. mprobst added a comment. - - improve handling of keywors - rather than blacklisting all C++ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77311/new/ https://reviews.llvm.org/D77311 Files: clang/lib/F

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

2020-04-03 Thread Martin Probst via Phabricator via cfe-commits
mprobst added a comment. Thanks for the feedback. Indeed, whitelisting the JS keywords is better, but we still needed a way to blacklist all C++ keywords then - Krasimir's suggestion with the #include did the trick, thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

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

2020-04-03 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 254741. mprobst added a comment. - fix formatting Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77311/new/ https://reviews.llvm.org/D77311 Files: clang/lib/Format/FormatToken.h clang/lib/Format/TokenAnnota

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

2020-04-02 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Herald added subscribers: cfe-commits, jfb. Herald added a project: clang. C++ defines a number of keywords that are regular identifiers in JavaScript, e.g. `concept`: const concept = 1; // legit JS This change expands the exis

[PATCH] D73354: clang-format: insert trailing commas into containers.

2020-02-03 Thread Martin Probst via Phabricator via cfe-commits
mprobst closed this revision. mprobst marked an inline comment as done. mprobst added a comment. This has landed as https://reviews.llvm.org/rGa324fcf1ae6 (not sure why this hasn't closed automatically). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D73768: clang-format: [JS] document InsertTrailingCommas.

2020-02-02 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdc04c54fc1f6: clang-format: [JS] document InsertTrailingCommas. (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73768/new/ https://revi

[PATCH] D73768: clang-format: [JS] document InsertTrailingCommas.

2020-01-31 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: MyDeveloperDay. Herald added a project: clang. Herald added a subscriber: cfe-commits. In release notes and the regular docs. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D73768 Files: clang/docs/ClangFormatStyleOptio

[PATCH] D73354: clang-format: insert trailing commas into containers.

2020-01-29 Thread Martin Probst via Phabricator via cfe-commits
mprobst marked 4 inline comments as done. mprobst added inline comments. Comment at: clang/include/clang/Format/Format.h:42 + Unsuitable, + BinBackTrailingCommaConflict +}; sammccall wrote: > Back->Pack? That's what you get when you fix my auto-complete: consis

[PATCH] D73354: clang-format: insert trailing commas into containers.

2020-01-29 Thread Martin Probst via Phabricator via cfe-commits
mprobst marked 2 inline comments as done. mprobst added inline comments. Comment at: clang/lib/Format/Format.cpp:2531 +}); + auto Env = MyDeveloperDay wrote: > Ok, this comment is more a discussion point rather than a review comment. Was > there a reason

[PATCH] D73354: clang-format: insert trailing commas into containers.

2020-01-28 Thread Martin Probst via Phabricator via cfe-commits
mprobst marked 6 inline comments as done. mprobst added a comment. PTAL. Comment at: clang/include/clang/Format/Format.h:552 +/// Insert trailing commas in container literals that were wrapped over +/// multiple lines. +TCS_Wrapped, mprobst wrote: >

[PATCH] D73354: clang-format: insert trailing commas into containers.

2020-01-28 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 240873. mprobst marked an inline comment as done. mprobst added a comment. - - only run comma insertion for JavaScript. - review fixes - Fix col limit - test for comma insertion - - validate options, reject bin packing + trailing commas Repository: rG LLVM

[PATCH] D73335: clang-format: [JS] options for arrow functions.

2020-01-28 Thread Martin Probst via Phabricator via cfe-commits
mprobst marked 2 inline comments as done. mprobst added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:3165 + } +} + RKSimon wrote: > @mprobst - this is breaking buildbots: > http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-and

[PATCH] D73354: clang-format: insert trailing commas into containers.

2020-01-28 Thread Martin Probst via Phabricator via cfe-commits
mprobst marked 3 inline comments as done. mprobst added inline comments. Comment at: clang/include/clang/Format/Format.h:552 +/// Insert trailing commas in container literals that were wrapped over +/// multiple lines. +TCS_Wrapped, sammccall wrote: >

[PATCH] D73354: clang-format: insert trailing commas into containers.

2020-01-28 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 240847. mprobst marked 16 inline comments as done. mprobst added a comment. - - only run comma insertion for JavaScript. - review fixes - Fix col limit - test for comma insertion Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revi

[PATCH] D73335: clang-format: [JS] options for arrow functions.

2020-01-27 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG02656f29abda: clang-format: [JS] options for arrow functions. (authored by mprobst). Changed prior to commit: https://reviews.llvm.org/D73335?vs=240202&id=240575#toc Repository: rG LLVM Github Monore

[PATCH] D73335: clang-format: [JS] options for arrow functions.

2020-01-24 Thread Martin Probst via Phabricator via cfe-commits
mprobst added a comment. > If that's the case, consider adding the option to the style in a follow-up > patch: > > GoogleStyle.AllowShortLambdasOnASingleLine = FormatStyle::SLS_All; > > > that would have an advantage of making clear which test case diffs are result > of the implementatio

[PATCH] D73335: clang-format: [JS] options for arrow functions.

2020-01-24 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 240202. mprobst added a comment. - Disable arrow functions on single lines by default. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73335/new/ https://reviews.llvm.org/D73335 Files: clang/lib/Format/Format.

[PATCH] D73354: clang-format: insert trailing commas into containers.

2020-01-24 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 240194. mprobst added a comment. - - only run comma insertion for JavaScript. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73354/new/ https://reviews.llvm.org/D73354 Files: clang/include/clang/Format/Format

[PATCH] D73354: clang-format: insert trailing commas into containers.

2020-01-24 Thread Martin Probst via Phabricator via cfe-commits
mprobst added a comment. This is required by JavaScript style, but this change as is optimistically runs the tool for any language. I think that's probably not what we want here initially, just throwing it out there. WDYT? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

[PATCH] D73354: clang-format: insert trailing commas into containers.

2020-01-24 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added reviewers: krasimir, MyDeveloperDay. Herald added a project: clang. This change adds an option to insert trailing commas into container literals. For example, in JavaScript: const x = [ a, b, ^ inserted if missing. ] This is imple

[PATCH] D73335: clang-format: [JS] options for arrow functions.

2020-01-24 Thread Martin Probst via Phabricator via cfe-commits
mprobst added a comment. FYI I've started a conversation on whether `SLS_All` should be the default Google style. But the option I think is useful in either case. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73335/new/ https://reviews.llvm.org/D7

[PATCH] D73335: clang-format: [JS] options for arrow functions.

2020-01-24 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Herald added a project: clang. clang-format currently always wraps the body of non-empty arrow functions: const x = () => { z(); }; This change implements support for the `AllowShortLambdasOnASingleLine` style options, an

[PATCH] D73026: clang-format: [JS] fix `??` opreator wrapping.

2020-01-20 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4c9d6914453d: clang-format: [JS] fix `??` opreator wrapping. (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73026/new/ https://reviews

[PATCH] D73026: clang-format: [JS] fix `??` opreator wrapping.

2020-01-20 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Herald added a project: clang. clang-format currently treats the nullish coalescing operator `??` like the ternary operator. That causes multiple nullish terms to be each indented relative to the last `??`, as they would in a terna

[PATCH] D72907: clang-format: [JS] pragmas for tslint, tsc.

2020-01-17 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9835cf159014: clang-format: [JS] pragmas for tslint, tsc. (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72907/new/ https://reviews.ll

[PATCH] D72911: clang-format: fix spacing in `operator const char*()`

2020-01-17 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: clang/lib/Format/TokenAnnotator.cpp:2717 +// operator Foo*() +// dependant on PointerAlignment style. + typo dependent

[PATCH] D72907: clang-format: [JS] pragmas for tslint, tsc.

2020-01-17 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. mprobst added a project: clang. tslint and tsc (the TypeScript compiler itself) use comment pragmas of the style: // tslint:disable-next-line:foo // @ts-ignore These must not be wrapped and must stay on their own line, in iso

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

2020-01-17 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0734fb21ed5e: clang-format: [JS] Handle more keyword-named methods. (authored by mprobst). Changed prior to commit: https://reviews.llvm.org/D72827?vs=238442&id=238713#toc Repository: rG LLVM Github

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

2020-01-17 Thread Martin Probst via Phabricator via cfe-commits
mprobst added a comment. I've added tests and a fix for try/catch and if/else. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72827/new/ https://reviews.llvm.org/D72827 ___ cfe-commits mailing list cfe-

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

2020-01-17 Thread Martin Probst via Phabricator via cfe-commits
mprobst added a comment. In D72827#1823895 , @krasimir wrote: > How about `if` and `try`? Is there a list somewhere for all such valid > identifiers? This is a bit annoying - generally speaking, we should parse all keywords in declaration locations as

[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] 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] D70377: clang-format: [JS] tests for async wrapping.

2019-11-18 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. Adds tests to ensure that `async method() ...` does not wrap between async and the method name, which would cause automatic semicolon insertion. Repository:

[PATCH] D69971: clang-format: [JS] support null operators.

2019-11-11 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa7638d384983: clang-format: [JS] support null operators. (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69971/new/ https://reviews.llv

[PATCH] D69972: clang-format: [JS] test declared fields.

2019-11-11 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6bcd8d4a18fc: clang-format: [JS] test declared fields. (authored by mprobst). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69972/new/ https://reviews.llvm.

[PATCH] D69971: clang-format: [JS] support null operators.

2019-11-08 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 228495. mprobst added a comment. Add tests for .?(foo) and .?[foo]. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69971/new/ https://reviews.llvm.org/D69971 Files: clang/lib/Format/FormatToken.h clang/lib/

[PATCH] D69972: clang-format: [JS] test declared fields.

2019-11-07 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Herald added a project: clang. TypeScript now supports declaring fields: class Foo { declare field: string; } clang-format happens to already format this fine, so this change just adds a regression test. Repository: r

[PATCH] D69971: clang-format: [JS] support null operators.

2019-11-07 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. mprobst added a reviewer: krasimir. Herald added a project: clang. JavaScript / TypeScript is adding two new operators: the null propagating operator `?.` and the nullish coalescing operator `??`. const x = foo ?? 'default'; const z = foo?.bar?.baz; This change

[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] 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] 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] 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] 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] 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] 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] 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] 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] 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
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] 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

  1   2   3   >