[PATCH] D140956: [clang-format] Add an option for breaking after C++11 attributes

2023-01-11 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. > Was it actually a regression or did this patch also fix a bug? It seems that > the continuation indent before the & in your example is inconsistent with > other similar function declarations. Nice catch! I fully agree with you! Thank you for looking into this, sorry

[PATCH] D141547: Fix format for `case` in .proto files

2023-01-12 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clang/test/Format/case.proto:15 +repeated int32 fizz = 1; +} could you please turn this into an unit test here instead > https://github.com/llvm/llvm-project/blob/main/clang/unittests/Format/FormatTestProto.cpp. Rep

[PATCH] D141547: Fix format for `case` in .proto files

2023-01-16 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. Thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141547/new/ https://reviews.llvm.org/D141547 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D141547: Fix format for `case` in .proto files

2023-01-16 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGcaf393da1823: Fix format for `case` in .proto files (authored by fowles, committed by krasimir). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141547/new/ h

[PATCH] D154184: [clang-format] Correctly annotate */&/&& in operator function calls

2023-07-18 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. It looks like this causes a regression in the following example: % cat test.cc struct A { std::unique_ptr operator()(const B& b) const; }; % clang-format -style=google test.cc # should be the same as the input struct A { std::unique_ptr operator()(cons

[PATCH] D154184: [clang-format] Correctly annotate */&/&& in operator function calls

2023-07-18 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. In D154184#4509744 , @rymiel wrote: > Shouldn't that regression already be handled by D155358 > ? Ah, I missed that. That fixes it. Thank you! Repository: rG LLVM Github Monorepo CHANGES S

[PATCH] D76597: [clang-format] Reflow long C# generic type constraints correctly

2020-03-23 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Awesome! Thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76597/new/ https://reviews.llvm.org/D76597

[PATCH] D75760: [clang-format] Do not indent C# array initialisers as continuations

2020-03-23 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. This is OK with the comment in the code. Thank you! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75760/new/ https://reviews.llvm.org/D75760 ___

[PATCH] D76850: clang-format: Fix pointer alignment for overloaded operators (PR45107)

2020-03-26 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. I think this is an improvement. Accepting with a nit. Thank you! Comment at: clang/lib/Format/TokenAnnotator.cpp:2806 + if (Previous->is(tok::identifier) || Previous->isSimpleTypeSpecifier()) { +Previous =

[PATCH] D76850: clang-format: Fix pointer alignment for overloaded operators (PR45107)

2020-03-26 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. @MyDeveloperDay : sorry, I must have not refreshed this page and didn't realize you already gave an LGTM until I posted the comment. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76850/new/ https://reviews.llvm.org/D76850 ___

[PATCH] D77064: [clang-format] Correct line breaks in C# generic type constraints

2020-03-31 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Awesome! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77064/new/ https://reviews.llvm.org/D77064 ___ cfe-commits mailing list cfe-c

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

2020-04-02 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. In D77311#1957367 , @jfb wrote: > Some of these are technically "future reserved keywords": > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords > > Wouldn't it be better to list all of JS'

[PATCH] D75006: [clang-format] Wrap lines for C# property accessors

2020-02-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This is pretty cool! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75006/new/ https://reviews.llvm.org/D75006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[PATCH] D75244: [clang-format] Recognize C# named argument colons as a token type

2020-02-27 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. This is very nice! Brings the C# handling of the colon closer to other languages. Comment at: clang/lib/Format/TokenAnnotator.cpp:3499 const FormatToken &Left = *Righ

[PATCH] D75261: [clang-format] Recognize C# nullable types

2020-02-27 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added inline comments. This revision is now accepted and ready to land. Comment at: clang/unittests/Format/FormatTestCSharp.cpp:609 + + verifyFormat(R"(public float? Value;)", Style); // no space before `?`. +} Could you

[PATCH] D75194: [clang-format] Do not merge very long C# automatic properties

2020-02-28 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:489 +// If the Limit is broken, split the default value onto a new line and +// indent it. +// Why not always (not just when Limit is broken) merge the whole autom

[PATCH] D75368: [clang-format] Handle ?. ?? and ?[ as C# tokens

2020-03-02 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clang/include/clang/Basic/TokenKinds.def:237 +// C# support +PUNCTUATOR(questionquestion, "??") +PUNCTUATOR(questionlsquare, "?[") I think this is not a good place to add these. I think these definiti

[PATCH] D75368: [clang-format] Handle NullCoalescing and NullConditional operators in C#

2020-03-02 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Format/FormatToken.h:109 + TYPE(CSharpNullConditional) \ + TYPE(CSharpNullConditionalSq)

[PATCH] D75368: [clang-format] Handle NullCoalescing and NullConditional operators in C#

2020-03-02 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. Sorry, did the last round of comments not make sense? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75368/new/ https://reviews.llvm.org/D75368 ___ cfe-commits mailing list cfe

[PATCH] D75456: [clang-format] Rename CSharpNullConditionalSq and add missing test

2020-03-02 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Thank you! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75456/new/ https://reviews.llvm.org/D75456 ___ cfe-commits mailing list cfe

[PATCH] D75465: [clang-format] Do not merge target-name and : for C# attributes

2020-03-02 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clang/unittests/Format/FormatTestCSharp.cpp:281 Style.ColumnLimit = 10; - verifyFormat(R"([assembly:InternalsVisibleTo( + verifyFormat(R"([assembly: InternalsVisibleTo( "SomeAssembly, PublicKey=SomePublicKeyThatExceedsTheColum

[PATCH] D75465: [clang-format] Do not merge target-name and : for C# attributes

2020-03-02 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clang/unittests/Format/FormatTestCSharp.cpp:281 Style.ColumnLimit = 10; - verifyFormat(R"([assembly:InternalsVisibleTo( + verifyFormat(R"([assembly: InternalsVisibleTo( "SomeAssembly, PublicKey=SomePublicKeyThatExceedsTheColum

[PATCH] D75455: [clang-format] Allow nested [] in C# attributes

2020-03-03 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. That's a bit of a hack (we probably need to hook up full-fledged argument list parsing for complete handling), but this seems like a good trade-off between heuristics and results right now

[PATCH] D75465: [clang-format] Do not merge target-name and : for C# attributes

2020-03-03 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Thank you for the explanations! Looking good! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75465/new/ https://reviews.llvm.org/D75465 _

[PATCH] D75473: [clang-format] parse C# object initialisers

2020-03-03 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1978 + if (FormatTok->is(tok::l_paren)) +parseParens(); + I don't understand why this is needed, and removing this `if` does not cause any tests to fail. Please add

[PATCH] D75194: [clang-format] Do not merge very long C# automatic properties

2020-03-03 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. Here's some empirical ideas about the approach: In clang-format, braces can be handled in two quite distinct ways, controlled by BraceBlockKind : BK_

[PATCH] D75517: [clang-format] Do not format C# array subscript operators as attributes

2020-03-03 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Format/TokenAnnotator.cpp:376 + +// Chains [] in of `identifier[i][j][k]` are not attributes. +if (Tok.Previous && Tok.Previous->is(tok:

[PATCH] D75473: [clang-format] parse C# object initialisers

2020-03-04 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Thank you! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75473/new/ https://reviews.llvm.org/D75473 ___ cfe-commits mailing list cfe

[PATCH] D75606: [clang-format] Improve identification of C# nullables

2020-03-04 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Looks good with 1 suggestion. Comment at: clang/lib/Format/TokenAnnotator.cpp:1018 + (Tok->Next && Tok->Next->is(tok::identifier) && Tok->Next->Next && +

[PATCH] D75675: [clang-format] do not insert spaces around inline asm symbolic names

2020-03-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. krasimir edited the summary of this revision. krasimir added a reviewer: hans. hans added a comment. Very nice, thanks! Comment at: clang/lib/Format/TokenAnnotator.cpp:502

[PATCH] D75675: [clang-format] do not insert spaces around inline asm symbolic names

2020-03-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir marked an inline comment as done. krasimir added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:502 Left->Type = TT_ObjCMethodExpr; + } else if (Style.isCpp() && InsideInlineASM) { +Left->Type = TT_InlineASMSymbolicNameLSquare; ---

[PATCH] D75675: [clang-format] do not insert spaces around inline asm symbolic names

2020-03-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 248445. krasimir marked an inline comment as done. krasimir added a comment. Remove redundant check. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75675/new/ https://reviews.llvm.org/D75675 Files: clang/lib

[PATCH] D75675: [clang-format] do not insert spaces around inline asm symbolic names

2020-03-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG36c2ab8d04cd: [clang-format] do not insert spaces around inline asm symbolic names (authored by krasimir). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D7567

[PATCH] D75675: [clang-format] do not insert spaces around inline asm symbolic names

2020-03-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 248449. krasimir added a comment. Merging commits into 1 patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75675/new/ https://reviews.llvm.org/D75675 Files: clang/lib/Format/FormatToken.h clang/lib/Form

[PATCH] D75517: [clang-format] Do not format C# array subscript operators as attributes

2020-03-06 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. sorry could you please take another look at the comments I left Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75517/new/ https://reviews.llvm.org/D75517 ___ cfe-commits mailin

[PATCH] D75731: [clang-format] C# does not indent braced initializers as continuations

2020-03-09 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir requested changes to this revision. krasimir added inline comments. This revision now requires changes to proceed. Comment at: clang/unittests/Format/FormatTestCSharp.cpp:544 Shape[] shapes = new[] { new Circle { Radius = 2.7281, Colour = Colours.Red }, -

[PATCH] D75731: [clang-format] C# does not indent braced initializers as continuations

2020-03-09 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clang/unittests/Format/FormatTestCSharp.cpp:544 Shape[] shapes = new[] { new Circle { Radius = 2.7281, Colour = Colours.Red }, - new Square { - Side = 101.1, -

[PATCH] D75747: [clang-format] Correct indentation for `[key] = value,` entries in C++ object initialisers

2020-03-09 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir requested changes to this revision. krasimir added a comment. This revision now requires changes to proceed. Looks good! I'll stamp this after https://reviews.llvm.org/D75731 gets merged and this rebased on top of it. Comment at: clang/lib/Format/ContinuationIndenter.

[PATCH] D75856: [clang-format] cleanup from D75517

2020-03-09 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Thank you! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75856/new/ https://reviews.llvm.org/D75856 ___ cfe-commits mailing list cfe

[PATCH] D75856: [clang-format] cleanup from D75517

2020-03-09 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir requested changes to this revision. krasimir added a comment. This revision now requires changes to proceed. The new pre-merge checks are cool! Please clang-format the updated lines accordingly. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75856/new/ https://reviews.llvm.org/

[PATCH] D75760: [clang-format] Do not indent C# array initialisers as continuations

2020-03-09 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir requested changes to this revision. krasimir added inline comments. This revision now requires changes to proceed. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1443 +if (Style.isCSharp()) + FormatTok->BlockKind = BK_BracedInit; nextToken

[PATCH] D75731: [clang-format] C# does not indent braced initializers as continuations

2020-03-09 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Thank you CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75731/new/ https://reviews.llvm.org/D75731 ___ cfe-commits mailing list cfe-

[PATCH] D75747: [clang-format] Correct indentation for `[key] = value,` entries in C++ object initialisers

2020-03-09 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Thank you! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75747/new/ https://reviews.llvm.org/D75747 ___ cfe-commits mailing list cfe

[PATCH] D75983: [clang-format] Improved identification of C# nullables

2020-03-11 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:1016 if (Style.isCSharp()) { -// `Type? name;` and `Type? name =` can only be nullable types. +// `Type?)`, `Type?>`, `Type? name;`and `Type? name =` can only be +// nul

[PATCH] D75984: [clang-format] No space in `new()` and `this[Type x]` in C#

2020-03-11 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75984/new/ https://reviews.llvm.org/D75984 _

[PATCH] D75983: [clang-format] Improved identification of C# nullables

2020-03-11 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Thank you! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75983/new/ https://reviews.llvm.org/D75983 ___ cfe-commits mailing list cfe

[PATCH] D76367: [clang-format] Handle C# generic type constraints

2020-03-19 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir requested changes to this revision. krasimir added inline comments. This revision now requires changes to proceed. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:326 +void UnwrappedLineParser::parseCSharpGenericTypeConstraint(bool ConsumeBrace) { + do {

[PATCH] D76367: [clang-format] Handle C# generic type constraints

2020-03-19 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Thank you! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76367/new/ https://reviews.llvm.org/D76367 ___ cfe-commits mailing list cfe

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

2020-01-16 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. How about `if` and `try`? Is there a list somewhere for all such valid identifiers? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72827/new/

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

2020-01-17 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. krasimir added a reviewer: mprobst. Revision a75f8d98d7ac9e557b238a229a9a2647c71feed1 fixed spacing for operators, but caus

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

2020-01-17 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 238738. krasimir added a comment. - Add more tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72911/new/ https://reviews.llvm.org/D72911 Files: clang/lib/Format/TokenAnnotator.cpp clang/unittests/Forma

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

2020-01-17 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 238743. krasimir added a comment. - Fix typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72911/new/ https://reviews.llvm.org/D72911 Files: clang/lib/Format/TokenAnnotator.cpp clang/unittests/Format/Form

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

2020-01-17 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 238741. krasimir added a comment. - Address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72911/new/ https://reviews.llvm.org/D72911 Files: clang/lib/Format/TokenAnnotator.cpp clang/unitte

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

2020-01-17 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir marked 3 inline comments as done. krasimir added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:2722 +FormatToken *Before = Left.getPreviousNonComment(); +while (Before && Before->isOneOf(tok::kw_const, tok::kw_volatile)) { + Before = Befor

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

2020-01-17 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 238746. krasimir added a comment. - Fix typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72911/new/ https://reviews.llvm.org/D72911 Files: clang/lib/Format/TokenAnnotator.cpp clang/unittests/Format/Form

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

2020-01-17 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG33463cfba2be: clang-format: fix spacing in `operator const char*()` (authored by krasimir). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72911/new/ https:/

[PATCH] D72144: Treat C# `using` as a control statement

2020-01-22 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added inline comments. This revision is now accepted and ready to land. Comment at: clang/unittests/Format/FormatTestCSharp.cpp:259 + + verifyFormat("using (StreamWriter sw = new StreamWriter(filenameB)) {}", + Style);

[PATCH] D72144: Treat C# `using` as a control statement

2020-01-23 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir requested changes to this revision. krasimir added a comment. This revision now requires changes to proceed. I looked up the C# reference and all the examples are top-level, so having top-level

[PATCH] D72144: Treat C# `using` as a control statement

2020-01-23 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. I'll submit this for you. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72144/new/ https://reviews.llvm.org/D72144 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[PATCH] D72144: Treat C# `using` as a control statement

2020-01-23 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Revision". This revision was automatically updated to reflect the committed changes. Closed by commit rG1e0174a93cfd: Treat C# `using` as a control statement (authored by krasimir). Repository: rG LLVM Github Monorepo CH

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

2020-01-24 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir 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. If that's the case, consider adding the option to the style in a follow-up patch: GoogleStyle.AllowShortLambdasOnASingleLine =

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

2020-01-24 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. General comment: I think this is useful and could also be useful for other languages too (some folks have asked for this for some C++ code). As this is a non-whitespace only change, it's a bit more risky than whitespace-only changes. I think we need to establish a pol

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

2020-01-24 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added inline comments. This revision is now accepted and ready to land. Comment at: clang/unittests/Format/FormatTestJS.cpp:1793 verifyFormat("export default [];"); - verifyFormat("export default () => {};"); verifyFormat("export i

[PATCH] D73353: [clang-format] Handle escaped " in C# string-literals

2020-01-27 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG36a8f7f6d8f5: [clang-format] Handle escaped " in C# string-literals (authored by krasimir). Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo CH

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

2020-01-27 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. An alternative approach (I'm not endorsing this) that would *in theory* circumvent non-idempotency issue (but would be more fiddly~fiddly to implement and spill across different layers of the formatter): This is just a rough idea and can have multiple issues in itself.

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

2020-01-27 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clang/lib/Format/Format.cpp:1482 +/// ]; +class TrailingCommaInserter : public TokenAnalyzer { +public: sammccall wrote: > Worth a comment (somewhere) about the fact that this never rewraps, in > particular if the

[PATCH] D72401: Fixes for spaces around C# object initializers

2020-01-31 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Thank you! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72401/new/ https://reviews.llvm.org/D72401 ___ cfe-commits mailing list cfe

[PATCH] D44695: [clang-format] Partially revert r322749, replacing array with DenseSet

2018-03-20 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added subscribers: cfe-commits, klimek. The array + binary_search requires the initializer list of identifiers to be sorted. I can imagine how this list might change frequently while the support for ObjectiveC improves (https://reviews.llvm.org/D44632). The a

[PATCH] D44632: [clang-format] Add a few more Core Graphics identifiers to ObjC heuristic

2018-03-20 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: lib/Format/Format.cpp:1450 // Keep this array sorted, since we are binary searching over it. static constexpr llvm::StringLiteral FoundationIdentifiers[] = { "CGFloat", jolesiak wrote: > benhamilton w

[PATCH] D44695: [clang-format] Partially revert r322749, replacing array with DenseSet

2018-03-20 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. One way in which `DenseSet` is better is that it supports `StringRef`s - we don't have to define `hash`. Seems like the lack of this override in core LLVM suggests that `unordered_set` is not commonly used with `StringRef`s. Repository: rC Clang https://reviews.llv

[PATCH] D44765: PR36643 Make clang-format support more generic TMarcos

2018-03-27 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. I don't have preferences over names, but I agree with Alex that the option should have more detailed description. Comment at: lib/Format/FormatToken.h:138 + /// \brief Whether this is a string literal similar to _T("sdfsdf"). + bool TMacroStringLite

[PATCH] D42034: [clang-format] In tests, expected code should be format-stable

2018-03-27 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir requested changes to this revision. krasimir added a comment. This revision now requires changes to proceed. Thank you! If this works, we should apply it to all files in `unittest/Format`. Repository: rC Clang https://reviews.llvm.org/D42034 ___

[PATCH] D44765: PR36643 Make clang-format support more generic TMarcos

2018-03-29 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: lib/Format/FormatTokenLexer.cpp:386 String->HasUnescapedNewline = Macro->HasUnescapedNewline; + String->TMacroStringLiteral = true; In the original code, TMacro detection was done as: ``` (Text.startswith(Prefix =

[PATCH] D42034: [clang-format] In tests, expected code should be format-stable

2018-04-04 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Thank you! Repository: rC Clang https://reviews.llvm.org/D42034 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.

[PATCH] D44203: [clang-format] Improve Incomplete detection for (text) protos

2018-04-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 141121. krasimir marked 2 inline comments as done. krasimir added a comment. - Address review comments Repository: rC Clang https://reviews.llvm.org/D44203 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestProto.cpp unittests/Format/

[PATCH] D44203: [clang-format] Improve Incomplete detection for (text) protos

2018-04-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:665 } + if ((Style.Language == FormatStyle::LK_Proto || + Style.Language == FormatStyle::LK_TextProto) && sammccall wrote: > I don't really understand what this is doi

[PATCH] D45373: [clang-format] Don't remove empty lines before namespace endings

2018-04-06 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. krasimir added a reviewer: djasper. Herald added subscribers: cfe-commits, klimek. This implements an alternative to r327861, namely preserving empty lines before namespace endings. Repository: rC Clang https://reviews.llvm.org/D45373 Files: lib/Format/Name

[PATCH] D39430: [clangd] formatting: don't ignore style

2017-10-30 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. For testing you could do something similar to how clang-format does it . https://reviews.llvm.org/D39430 ___ cfe-commits mailing list

[PATCH] D39498: [clang-format] Make parseUnaryOperator non-recursive, NFCI

2017-11-01 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 121156. krasimir added a comment. - Address review comments https://reviews.llvm.org/D39498 Files: lib/Format/TokenAnnotator.cpp Index: lib/Format/TokenAnnotator.cpp === --- lib/Format/Tok

[PATCH] D39498: [clang-format] Make parseUnaryOperator non-recursive, NFCI

2017-11-01 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:1671 +parse(PrecedenceArrowAndPeriod); +for (size_t I = 0, E = Tokens.size(); I < E; ++I) + // The actual precedence doesn't matter. bkramer wrote: > `for (FormatToken *Token :

[PATCH] D39498: [clang-format] Make parseUnaryOperator non-recursive, NFCI

2017-11-01 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL317113: [clang-format] Make parseUnaryOperator non-recursive, NFCI (authored by krasimir). Repository: rL LLVM https://reviews.llvm.org/D39498 Files: cfe/trunk/lib/Format/TokenAnnotator.cpp Index:

[PATCH] D39549: [clang-format] Sort using-declarations case sensitively with a special case for '_'

2017-11-03 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 121465. krasimir added a comment. - Remove SortLabel https://reviews.llvm.org/D39549 Files: lib/Format/UsingDeclarationsSorter.cpp unittests/Format/UsingDeclarationsSorterTest.cpp Index: unittests/Format/UsingDeclarationsSorterTest.cpp ===

[PATCH] D39549: [clang-format] Sort using-declarations case sensitively with a special case for '_'

2017-11-03 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. How about this trade-off? I don't really want to re-implement comparison (it makes the code harder to read), so I replaced the state with an explicit computation. https://reviews.llvm.org/D39549 ___ cfe-commits mailing li

[PATCH] D39549: [clang-format] Sort using-declarations case sensitively with a special case for '_'

2017-11-03 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 121475. krasimir added a comment. - Address review comment https://reviews.llvm.org/D39549 Files: lib/Format/UsingDeclarationsSorter.cpp unittests/Format/UsingDeclarationsSorterTest.cpp Index: unittests/Format/UsingDeclarationsSorterTest.cpp =

[PATCH] D39549: [clang-format] Sort using-declarations case sensitively with a special case for '_'

2017-11-03 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL317325: [clang-format] Sort using-declarations case sensitively with a special case for… (authored by krasimir). Repository: rL LLVM https://reviews.llvm.org/D39549 Files: cfe/trunk/lib/Format/Using

[PATCH] D39787: [clang-tidy] Add a note about modernize-replace-random-shuffle

2017-11-08 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL317689: [clang-tidy] Add a note about modernize-replace-random-shuffle (authored by krasimir). Repository: rL LLVM https://reviews.llvm.org/D39787 Files: clang-tools-extra/trunk/docs/clang-tidy/che

[PATCH] D39786: [clang-format] Sort using declarations by splitting on '::'

2017-11-08 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 122069. krasimir added a comment. - Remove dead code https://reviews.llvm.org/D39786 Files: docs/ClangFormatStyleOptions.rst docs/tools/dump_format_style.py include/clang/Format/Format.h lib/Format/UsingDeclarationsSorter.cpp unittests/Format/Usi

[PATCH] D39786: [clang-format] Sort using declarations by splitting on '::'

2017-11-09 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL317794: [clang-format] Sort using declarations by splitting on '::' (authored by krasimir). Repository: rL LLVM https://reviews.llvm.org/D39786 Files: cfe/trunk/docs/ClangFormatStyleOptions.rst cf

[PATCH] D39806: [clang-format] Support python-style comments in text protos

2017-11-10 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 122420. krasimir marked 3 inline comments as done. krasimir added a comment. - [clang-format] Address review comments https://reviews.llvm.org/D39806 Files: lib/Format/BreakableToken.cpp lib/Format/FormatTokenLexer.cpp lib/Format/FormatTokenLexer.h

[PATCH] D39806: [clang-format] Support python-style comments in text protos

2017-11-10 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL317886: [clang-format] Support python-style comments in text protos (authored by krasimir). Repository: rL LLVM https://reviews.llvm.org/D39806 Files: cfe/trunk/lib/Format/BreakableToken.cpp cfe/t

[PATCH] D39900: Refactor ContinuationIndenter's breakProtrudingToken logic into slightly moreorthogonal pieces.

2017-11-10 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:1028 + unsigned Penalty = + handleEndOfLine(Current, State, DryRun, AllowBreak); Why `handleEndOfLine`? Is it guaranteed that here we've reached the end of the line? ==

[PATCH] D39900: Refactor ContinuationIndenter's breakProtrudingToken logic into slightly moreorthogonal pieces.

2017-11-10 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Maybe we should further refactor `getRawStringStyle` into `llvm::Optional> getRawStringStyleAndDelimiter` and that would nicely take care of the duplicated effort? https://reviews.llvm.o

[PATCH] D40068: Implement more accurate penalty & trade-offs while breaking protruding tokens.

2017-11-15 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:1517 ReflowInProgress = SplitBefore.first != StringRef::npos; +DEBUG(if (ReflowInProgress) llvm::dbgs() << " Reflowing.\n"); TailOffset = I'd rather ``` DEBUG({ if (R

[PATCH] D40120: [clang-format] Add text proto filename detection

2017-11-16 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Adds text proto filename detection. https://reviews.llvm.org/D40120 Files: lib/Format/Format.cpp Index: lib/Format/Format.cpp === --- lib/Format/Format.cpp +++ lib/Format/Format.cpp @@ -2084,6 +2

[PATCH] D40120: [clang-format] Add text proto filename detection

2017-11-17 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 123308. krasimir added a comment. - Remove METADATA https://reviews.llvm.org/D40120 Files: lib/Format/Format.cpp Index: lib/Format/Format.cpp === --- lib/Format/Format.cpp +++ lib/Format/F

[PATCH] D40068: Implement more accurate penalty & trade-offs while breaking protruding tokens.

2017-11-17 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:1616 + + if (!DryRun) nit: remove an empty line Comment at: unittests/Format/FormatTest.cpp:9951 + "\n*/", + Style)); + -

[PATCH] D40120: [clang-format] Add text proto filename detection

2017-11-17 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL318525: [clang-format] Add text proto filename detection (authored by krasimir). Repository: rL LLVM https://reviews.llvm.org/D40120 Files: cfe/trunk/lib/Format/Format.cpp Index: cfe/trunk/lib/For

[PATCH] D40288: [clang-format] Add option to group multiple #include blocks when sorting includes

2017-11-22 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. Looks good! Just a few nits: Comment at: lib/Format/Format.cpp:1570 IncludesInBlock.push_back({IncludeName, Line, Prev, Category}); + } else if (Style.IncludeBlocks > FormatStyle::IBS_Preserve && + Trimmed.empty()) { -

[PATCH] D40310: Restructure how we break tokens.

2017-11-22 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. Here're a few nits. I'll need an evening to review the meaty part :) Comment at: lib/Format/BreakableToken.cpp:73 + if (ColumnLimit <= ContentStartColumn + 1) { return BreakableToken::Split(StringRef::npos, 0); + } nit: no brace

[PATCH] D40068: Implement more accurate penalty & trade-offs while breaking protruding tokens.

2017-11-22 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir requested changes to this revision. krasimir added a comment. This revision now requires changes to proceed. looks like there are more changes needed. https://reviews.llvm.org/D40068 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

<    1   2   3   4   5   6   7   8   9   10   >