[PATCH] D34552: [clang-format] Update dump_format_style.py to indent nested fields

2017-06-23 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. This updates the format options documentation script to indent the documentation of nested fields. The previous format caused some problems, as when a bulleted list ends with a multiline comment. See the buildbot failure http://lab.llvm.org:8011/builders/clang-sphin

[PATCH] D34552: [clang-format] Update dump_format_style.py to indent nested fields

2017-06-23 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL306093: [clang-format] Update dump_format_style.py to indent nested fields (authored by krasimir). Changed prior to commit: https://reviews.llvm.org/D34552?vs=103709&id=103711#toc Repository: rL LLVM

[PATCH] D34623: [clang-format] Add a test for associative map proto buffer fields

2017-06-26 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 103962. krasimir added a comment. - Add map declarations spanning multiple lines https://reviews.llvm.org/D34623 Files: unittests/Format/FormatTestProto.cpp Index: unittests/Format/FormatTestProto.cpp ===

[PATCH] D41487: [clang-format] Adds a FormatStyleSet

2017-12-21 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. krasimir added reviewers: klimek, djasper. This patch adds a FormatStyleSet for storing per-language FormatStyles for the purposes of formatting code blocks inside the main code. Repository: rC Clang https://reviews.llvm.org/D41487 Files: include/clang/Forma

[PATCH] D41487: [clang-format] Adds a FormatStyleSet

2017-12-21 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: lib/Format/Format.cpp:903-907 + for (int i = Styles.size() - 1; i >= 0; --i) { +if (Styles[i].Language != FormatStyle::LK_None) { + Style->AddLanguageStyle(Styles[i]); } } klimek wrote: > This seems a

[PATCH] D41487: [clang-format] Adds a FormatStyleSet

2017-12-21 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 127887. krasimir added a comment. - Address review comments Repository: rC Clang https://reviews.llvm.org/D41487 Files: ; include/clang/Format/Format.h lib/Format/Format.cpp Index: include/clang/Format/Format.h ===

[PATCH] D41487: [clang-format] Adds a FormatStyleSet

2017-12-21 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 127888. krasimir added a comment. - Remove accidentally created file Repository: rC Clang https://reviews.llvm.org/D41487 Files: include/clang/Format/Format.h lib/Format/Format.cpp Index: lib/Format/Format.cpp ==

[PATCH] D41448: Fix counting parameters/arguments for ObjC.

2018-01-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. Can we have tests please? Repository: rC Clang https://reviews.llvm.org/D41448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D41487: [clang-format] Adds a FormatStyleSet

2018-01-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 128743. krasimir added a comment. - Address review comments Repository: rC Clang https://reviews.llvm.org/D41487 Files: include/clang/Format/Format.h lib/Format/Format.cpp Index: lib/Format/Format.cpp ===

[PATCH] D41487: [clang-format] Adds a FormatStyleSet

2018-01-08 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 128921. krasimir added a comment. - Address review comments Repository: rC Clang https://reviews.llvm.org/D41487 Files: include/clang/Format/Format.h lib/Format/Format.cpp Index: lib/Format/Format.cpp ===

[PATCH] D41487: [clang-format] Adds a FormatStyleSet

2018-01-08 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 128932. krasimir marked 5 inline comments as done. krasimir added a comment. - Address review comments Repository: rC Clang https://reviews.llvm.org/D41487 Files: 2 include/clang/Format/Format.h lib/Format/Format.cpp Index: lib/Format/Format.cpp

[PATCH] D41487: [clang-format] Adds a FormatStyleSet

2018-01-08 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 128933. krasimir added a comment. - Remove accidentally added file Repository: rC Clang https://reviews.llvm.org/D41487 Files: include/clang/Format/Format.h lib/Format/Format.cpp Index: lib/Format/Format.cpp

[PATCH] D43830: [clang-format] Format operator key in protos

2018-02-27 Thread Krasimir Georgiev 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 rL326227: [clang-format] Format operator key in protos (authored by krasimir, committed by ). Herald added a subscriber: llv

[PATCH] D43830: [clang-format] Format operator key in protos

2018-02-27 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added subscribers: cfe-commits, klimek. This fixes a glitch where ``operator: value`` in a text proto would mess up the underlying formatting since it gets parsed as a kw_operator instead of an identifier. Repository: rC Clang https://reviews.llvm.org/

[PATCH] D43830: [clang-format] Format operator key in protos

2018-02-27 Thread Krasimir Georgiev 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 rC326227: [clang-format] Format operator key in protos (authored by krasimir, committed by ). Changed prior to commit: ht

[PATCH] D43731: [clang-format] Fix documentation for SpaceAfterCStyleCast option

2018-03-01 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. This rst file is generated from include/clang/Format/Format.h using docs/tools/dump_format_style.py. Update it there and run the tool to regenerate the .rst file. Repository:

[PATCH] D43902: [clang-format] Don't detect C++11 attribute specifiers as ObjC

2018-03-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:323 + const FormatToken *parseCpp11Attribute(const FormatToken &Tok, + bool NamespaceAllowed) { Please inline this into the other function: it's u

[PATCH] D43904: [clang-format] Improve detection of ObjC for-in statements

2018-03-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: unittests/Format/FormatTest.cpp:12002 +TEST_F(FormatTest, GuessLanguageWithForIn) { + EXPECT_EQ(FormatStyle::LK_Cpp, Please also add this instances as formatting tests. Repository: rC Clang https://reviews.llvm.

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: unittests/Format/FormatTest.cpp:12027 +TEST_F(FormatTest, GuessLanguageWithCaret) { + EXPECT_EQ(FormatStyle::LK_Cpp, guessLanguage("foo.h", "FOO(^);")); Please also add formatting tests. This might require changes to

[PATCH] D43731: [clang-format] Fix documentation for SpaceAfterCStyleCast option

2018-03-05 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! https://reviews.llvm.org/D43731 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/list

[PATCH] D44141: [clang-format] Use NestedBlockIndent as a 0 column in formatted raw strings

2018-03-06 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. krasimir added reviewers: djasper, sammccall. Herald added subscribers: cfe-commits, klimek. This makes the formatter of raw string literals use NestedBlockIndent for determining the 0 column of the content inside. This makes the formatting use less horizonal space

[PATCH] D43906: [clang-format] Improve detection of Objective-C block types

2018-03-06 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: unittests/Format/FormatTest.cpp:7698 +TEST_F(FormatTest, ObjCBlockTypesAndVariables) { + verifyFormat("void DoStuffWithBlockType(int (^)(char));"); This should be in `FormatTestObjC.cpp`. Repository: rC Clang ht

[PATCH] D43904: [clang-format] Improve detection of ObjC for-in statements

2018-03-06 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: unittests/Format/FormatTest.cpp:778 +TEST_F(FormatTest, ObjCForInLoop) { + verifyFormat("for (Foo *x = 0; x != in; x++) {\n}"); Please move the ObjC-specific instances to `FormatTestObjC.cpp`. Repository: rC Clan

[PATCH] D43731: [clang-format] Fix documentation for SpaceAfterCStyleCast option

2018-03-06 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. I'll commit this for you. https://reviews.llvm.org/D43731 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D43731: [clang-format] Fix documentation for SpaceAfterCStyleCast option

2018-03-06 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL326781: [clang-format] Fix documentation for SpaceAfterCStyleCast option (authored by krasimir, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org

[PATCH] D43312: [clang-format] fix handling of consecutive unary operators

2018-03-06 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL326792: [clang-format] fix handling of consecutive unary operators (authored by krasimir, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D4331

[PATCH] D43902: [clang-format] Don't detect C++11 attribute specifiers as ObjC

2018-03-07 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: unittests/Format/FormatTest.cpp:6068-6069 + verifyFormat("void f() [[deprecated(\"so sorry\")]];"); + verifyFormat("aa\n" + "[[unused]] aaa(int i);"); +

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

2018-03-07 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. krasimir added a reviewer: sammccall. Herald added subscribers: cfe-commits, klimek. This patch improves detection of incomplete code for protos and text protos. This is especially important for text protos in raw string literals, since they might be partial strings

[PATCH] D44204: [clang-format] Break consecutive string literals in text protos

2018-03-07 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added subscribers: cfe-commits, klimek. This patch fixes a bug where consecutive string literals in text protos were put on the same line. Repository: rC Clang https://reviews.llvm.org/D44204 Files: lib/Format/TokenAnnotator.cpp unittests/Format/For

[PATCH] D44204: [clang-format] Break consecutive string literals in text protos

2018-03-07 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL326945: [clang-format] Break consecutive string literals in text protos (authored by krasimir, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D442

[PATCH] D44141: [clang-format] Use NestedBlockIndent as a 0 column in formatted raw strings

2018-03-08 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL326996: [clang-format] Use NestedBlockIndent as a 0 column in formatted raw strings (authored by krasimir, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.l

[PATCH] D44563: [clang-format] Fix raw string prefix penalty

2018-03-16 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added subscribers: cfe-commits, klimek. We weren't penalizing cases where the raw string prefix goes over the column limit. Repository: rC Clang https://reviews.llvm.org/D44563 Files: lib/Format/ContinuationIndenter.cpp unittests/Format/FormatTestR

[PATCH] D44563: [clang-format] Fix raw string prefix penalty

2018-03-16 Thread Krasimir Georgiev 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 rC327708: [clang-format] Fix raw string prefix penalty (authored by krasimir, committed by ). Changed prior to commit: ht

[PATCH] D44569: [clang-format] Disallow breaks before ']' in text proto extensions

2018-03-16 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added subscribers: cfe-commits, klimek. This disallows patterns like `[ext.name\n]` in text protos. Repository: rC Clang https://reviews.llvm.org/D44569 Files: lib/Format/ContinuationIndenter.cpp lib/Format/TokenAnnotator.cpp unittests/Format/Form

[PATCH] D44569: [clang-format] Disallow breaks before ']' in text proto extensions

2018-03-16 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 138710. krasimir added a comment. - Remove newlines Repository: rC Clang https://reviews.llvm.org/D44569 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestTextProto.cpp Index: unittests/Format/FormatTestTextProto.cpp

[PATCH] D44569: [clang-format] Disallow breaks before ']' in text proto extensions

2018-03-16 Thread Krasimir Georgiev 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 rL327716: [clang-format] Disallow breaks before ']' in text proto extensions (authored by krasimir, committed by ). Herald a

[PATCH] D44631: [clang-format] Remove empty lines before }[; ] // comment

2018-03-19 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added subscribers: cfe-commits, klimek. This addresses bug 36766 and a FIXME in tests about empty lines before `}[;] // comment` lines. Repository: rC Clang https://reviews.llvm.org/D44631 Files: lib/Format/UnwrappedLineFormatter.cpp unittests/Form

[PATCH] D44631: [clang-format] Remove empty lines before }[; ] // comment

2018-03-19 Thread Krasimir Georgiev 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 rC327861: [clang-format] Remove empty lines before }[;] // comment (authored by krasimir, committed by ). Changed prior to

[PATCH] D47519: [clang-format] Detect amp type as TT_PointerOrReference in function annotations

2018-06-06 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:1566 -if (PrevToken->is(tok::coloncolon)) +if (PrevToken->isOneOf(tok::coloncolon, tok::kw_const)) return TT_PointerOrReference; I'd also check for `volatile` here, for exa

[PATCH] D46757: [clang-format] Break inside submessages containing a submessage and something else

2018-06-07 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 150273. krasimir added a comment. - Polish Repository: rC Clang https://reviews.llvm.org/D46757 Files: lib/Format/ContinuationIndenter.cpp lib/Format/TokenAnnotator.cpp lib/Format/UnwrappedLineFormatter.cpp unittests/Format/FormatTestProto.cpp

[PATCH] D47870: [clang-format] Consider tok::hashhash in python-style comments

2018-06-07 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added a subscriber: cfe-commits. We were missing the case when python-style comments in text protos start with `##`. Repository: rC Clang https://reviews.llvm.org/D47870 Files: lib/Format/BreakableToken.cpp lib/Format/FormatTokenLexer.cpp unittes

[PATCH] D47870: [clang-format] Consider tok::hashhash in python-style comments

2018-06-07 Thread Krasimir Georgiev 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 rC334179: [clang-format] Consider tok::hashhash in python-style comments (authored by krasimir, committed by ). Changed pri

[PATCH] D46757: [clang-format] Break inside submessages containing a submessage and something else

2018-06-07 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 150317. krasimir added a comment. - Update comments Repository: rC Clang https://reviews.llvm.org/D46757 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestProto.cpp unittests/Format/FormatTestRawStrings.cpp unittests/Format/FormatT

[PATCH] D46757: [clang-format] Break inside submessages containing a submessage and something else

2018-06-07 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 150320. krasimir added a comment. - Add comments tests Repository: rC Clang https://reviews.llvm.org/D46757 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestProto.cpp unittests/Format/FormatTestRawStrings.cpp unittests/Format/Form

[PATCH] D47577: [clang-format] Separate block comments with CRLF correctly

2018-06-08 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: lib/Format/BreakableToken.cpp:327 + TokenText.substr(2, TokenText.size() - 4) + .split(Lines, TokenText.count('\r') > 0 ? "\r\n" : "\n");

[PATCH] D46757: [clang-format] text protos: put entries on separate lines if there is a submessage

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

[PATCH] D46757: [clang-format] text protos: put entries on separate lines if there is a submessage

2018-06-11 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC334401: [clang-format] text protos: put entries on separate lines if there is a… (authored by krasimir, committed by ). Changed prior to commit: https://reviews.llvm.org/D46757?vs=150730&id=150731#toc

[PATCH] D48034: [clang-format] Discourage breaks in submessage entries

2018-06-11 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added a subscriber: cfe-commits. Currently clang-format allows this for text protos: submessage: { key: 'aa' } when it is under the column limit and when putting it all on one line exceeds the column limit. This

[PATCH] D48034: [clang-format] Discourage breaks in submessage entries

2018-06-11 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. In https://reviews.llvm.org/D48034#1128475, @sammccall wrote: > All else equal, I'd expect this to be a hard rule, at least in google-style. > > "foo\n { a: b }" --> "foo {\n a: b\n}" only makes the first line longer, by > 2 chars. So if 78 < indent + len("foo") <= 80

[PATCH] D48063: [clang-format] Discourage breaks in submessage entries, hard rule

2018-06-12 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added a subscriber: cfe-commits. This is an alternative to https://reviews.llvm.org/D48034. Repository: rC Clang https://reviews.llvm.org/D48063 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestTextProto.cpp Index: unittests/Format/

[PATCH] D48063: [clang-format] Discourage breaks in submessage entries, hard rule

2018-06-12 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 150926. krasimir added a comment. - Add tests Repository: rC Clang https://reviews.llvm.org/D48063 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestProto.cpp unittests/Format/FormatTestTextProto.cpp Index: unittests/Format/FormatTe

[PATCH] D48063: [clang-format] Discourage breaks in submessage entries, hard rule

2018-06-12 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 150980. krasimir added a comment. - Split-up the if-condition Repository: rC Clang https://reviews.llvm.org/D48063 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestProto.cpp unittests/Format/FormatTestTextProto.cpp Index: unittests

[PATCH] D48063: [clang-format] Discourage breaks in submessage entries, hard rule

2018-06-12 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL334517: [clang-format] Discourage breaks in submessage entries, hard rule (authored by krasimir, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D4

[PATCH] D48089: [clang-format] Fix crash while reflowing backslash in comments

2018-06-12 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added a subscriber: cfe-commits. The added test case was currently crashing with an assertion: Repository: rC Clang https://reviews.llvm.org/D48089 Files: lib/Format/BreakableToken.cpp unittests/Format/FormatTestComments.cpp Index: unittests/Forma

[PATCH] D48089: [clang-format] Fix crash while reflowing backslash in comments

2018-06-12 Thread Krasimir Georgiev 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 rC334527: [clang-format] Fix crash while reflowing backslash in comments (authored by krasimir, committed by ). Changed pri

[PATCH] D48098: clang-format-diff: Switch to python3 by default, support python 2.7

2018-06-13 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. Sorry, I'm not familiar with this tool. Could you elaborate: - why is this switch necessary? - what's expected to be supported with it? - how do I test it? https://reviews.llvm.

[PATCH] D48098: clang-format-diff: Switch to python3 by default, support python 2.7

2018-06-14 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: tools/clang-format/clang-format-diff.py:1 -#!/usr/bin/env python +#!/usr/bin/env python3 # lebedev.ri wrote: > Why do you need to *switch* the default? > What's wrong with [at least starting with] just making sure it w

[PATCH] D48363: [clang-format] Enable text proto formatting in common functions

2018-06-20 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added a subscriber: cfe-commits. Repository: rC Clang https://reviews.llvm.org/D48363 Files: lib/Format/Format.cpp Index: lib/Format/Format.cpp === --- lib/Format/Format.cpp +++ lib/Forma

[PATCH] D48539: [clang-format] Fix end-of-file comments text proto formatting

2018-06-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added a subscriber: cfe-commits. The case of end-of-file comments was formatted badly: key: value # end-of-file comment This patch fixes that formatting: key: value # end-of-file comment Repository: rC Clang https://reviews.llvm.org/D48539

[PATCH] D48539: [clang-format] Fix end-of-file comments text proto formatting

2018-06-25 Thread Krasimir Georgiev 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 rL335449: [clang-format] Fix end-of-file comments text proto formatting (authored by krasimir, committed by ). Herald added

[PATCH] D50403: [clang-format]AlignConsecutiveAssignments

2018-10-17 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: include/clang/Format/Format.h:85 + /// matching assignment operators. This includes consecutive |=, += + /// -=, /=, *=. This will result in formattings like /// \code Please add tests for these. Also it's not clea

[PATCH] D53072: [clang-format] Introduce the flag which allows not to shrink lines

2018-10-18 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. In general there's a high bar for adding new style options to clang-format: https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options https://revie

[PATCH] D52527: [clang-format] fix Bug 38686: add AfterCaseLabel to BraceWrapping

2018-10-18 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. OK, so this is not a real bug in the sense of non-working current features, it's more like a feature request. As per https://clang.llvm.org/docs/ClangFormatStyleOptions.html#addi

[PATCH] D52150: [clang-format] BeforeHash added to IndentPPDirectives

2018-10-18 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. As per https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options, could you please provide more info about the need for this option first? https:

[PATCH] D53520: Update the example of BS_Stroustrup to match what is done by clang-format

2018-10-22 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: docs/ClangFormatStyleOptions.rst:904 * ``BS_Stroustrup`` (in configuration: ``Stroustrup``) -Like ``Attach``, but break before function d

[PATCH] D53482: Add clang-format stability check with FormatTests

2018-10-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. Sadly I tried this out a year ago and hit the same thing. A root cause is that tabs have variable column length depending on their start column, and in clang-format tokens are mo

[PATCH] D52676: [clang-format] tweaked another case of lambda formatting

2018-10-22 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: unittests/Format/FormatTest.cpp:11604 + " x.end(), //\n" + " [&](int, int) { return 1; });\n" "}\n"); This looks a bit suspicious: I'd expect a break before the fi

[PATCH] D53520: Update the example of BS_Stroustrup to match what is done by clang-format

2018-10-24 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/D53520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.

[PATCH] D52676: [clang-format] tweaked another case of lambda formatting

2018-10-24 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: unittests/Format/FormatTest.cpp:11736 + // line and there are no further args. + verifyFormat("function(1, [this, that] {\n" + " //\n" oleg.smolsky wrote: > djasper wrote: > > oleg.smolsky wrote: > > >

[PATCH] D52448: [clang-format] Break before next parameter after a formatted multiline raw string parameter

2018-10-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir marked an inline comment as done. krasimir added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:1594 StartColumn + NewPrefixSize - Style.ColumnLimit : 0; - return Fixes.second + PrefixExcessCharacters * Style.PenaltyExcessCharacter; + unsigned

[PATCH] D52448: [clang-format] Break before next parameter after a formatted multiline raw string parameter

2018-10-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 171041. krasimir marked an inline comment as done. krasimir added a comment. - Address review comment Repository: rC Clang https://reviews.llvm.org/D52448 Files: lib/Format/ContinuationIndenter.cpp unittests/Format/FormatTestRawStrings.cpp Index: u

[PATCH] D52448: [clang-format] Break before next parameter after a formatted multiline raw string parameter

2018-10-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL345242: [clang-format] Break before next parameter after a formatted multiline raw… (authored by krasimir, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.l

[PATCH] D53482: Add clang-format stability check with FormatTests

2018-10-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. The problem with this is that I believe fixing this issue is not worth it, hence this patch is unnecessary. Feel free to reach out to djasper@ for a second opinion. For completeness, was the unstability a problem just in FormatTest.cpp, how about the other FormatTest*.

[PATCH] D52676: [clang-format] tweaked another case of lambda formatting

2018-10-31 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. Looks good! Will stamp when the scopes are removed. Oleg, do you need someone to commit this for you? Repository: rC Clang https://reviews.llvm.org/D52676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://l

[PATCH] D52676: [clang-format] tweaked another case of lambda formatting

2018-10-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! Repository: rC Clang https://reviews.llvm.org/D52676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.

[PATCH] D52676: [clang-format] tweaked another case of lambda formatting

2018-10-31 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL345753: [clang-format] tweaked another case of lambda formatting (authored by krasimir, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D52676?

[PATCH] D54110: [Format] Add debugging to ObjC language guesser

2018-11-05 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. Helpful! Thanks! Repository: rC Clang https://reviews.llvm.org/D54110 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists

[PATCH] D54111: [clang-format] Do not threat the asm clobber [ as ObjCExpr

2018-11-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added a subscriber: cfe-commits. The opening square of an inline asm clobber was being annotated as an ObjCExpr. This caused, amongst other things, the ObjCGuesser to guess header files containing that pattern as ObjC files. Repository: rC Clang https:/

[PATCH] D54111: [clang-format] Do not threat the asm clobber [ as ObjCExpr

2018-11-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 172602. krasimir added a comment. - Clean-up Repository: rC Clang https://reviews.llvm.org/D54111 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp =

[PATCH] D54111: [clang-format] Do not treat the asm clobber [ as ObjCExpr

2018-11-06 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 172738. krasimir added a comment. - Address review comments Repository: rC Clang https://reviews.llvm.org/D54111 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp ==

[PATCH] D54111: [clang-format] Do not treat the asm clobber [ as ObjCExpr

2018-11-13 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL346756: [clang-format] Do not treat the asm clobber [ as ObjCExpr (authored by krasimir, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D54111 Fi

[PATCH] D54753: [clang-format] JS: don't treat is: as a type matcher

2018-11-20 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added a subscriber: cfe-commits. Clang-format is treating all occurences of `is` in js as type matchers. In some cases this is wrong, as it might be a dict key. Repository: rC Clang https://reviews.llvm.org/D54753 Files: lib/Format/TokenAnnotator.cpp

[PATCH] D54753: [clang-format] JS: don't treat is: as a type matcher

2018-11-20 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC347307: [clang-format] JS: don't treat is: as a type matcher (authored by krasimir, committed by ). Changed prior to commit: https://reviews.llvm.org/D54753?vs=174759&id=174764#toc Repository: rC Cla

[PATCH] D54795: [clang-format] Do not treat asm clobber [ as ObjCExpr, refined

2018-11-21 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added a subscriber: cfe-commits. r346756 refined clang-format to not treat the `[` in `asm (...: [] ..)` as an ObjCExpr. However that's not enough, as we might have a comma-separated list of such clobbers as in the newly added test. This updates the detection

[PATCH] D54795: [clang-format] Do not treat asm clobber [ as ObjCExpr, refined

2018-11-22 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 175038. krasimir added a comment. - Add tests for _asm etc Repository: rC Clang https://reviews.llvm.org/D54795 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp ===

[PATCH] D54795: [clang-format] Do not treat asm clobber [ as ObjCExpr, refined

2018-11-22 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. In https://reviews.llvm.org/D54795#1305395, @djasper wrote: > Does this also work for _asm and __asm? Thanks! Turns out, yes. I added tests for those. Repository: rC Clang https://reviews.llvm.org/D54795 ___ cfe-commi

[PATCH] D54795: [clang-format] Do not treat asm clobber [ as ObjCExpr, refined

2018-11-22 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC347465: [clang-format] Do not treat asm clobber [ as ObjCExpr, refined (authored by krasimir, committed by ). Changed prior to commit: https://reviews.llvm.org/D54795?vs=175038&id=175049#toc Repository

[PATCH] D59210: clang-format: distinguish ObjC call subexpressions after r355434

2019-03-11 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The revision r355434 had the unfortunate side-effect that it started to recognize certain ObjC expressions with a call subexpression followed by a `a->b` subexpression as C++ lambda expressions.

[PATCH] D59210: clang-format: distinguish ObjC call subexpressions after r355434

2019-03-11 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL355831: clang-format: distinguish ObjC call subexpressions after r355434 (authored by krasimir, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Repository: rL LLVM

[PATCH] D59774: [clang-format] Refine structured binding detection

2019-03-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Revision r356575 had the unfortunate consequence that now clang-format never detects an ObjC call expression after `&&`. This patch tries harder to distinguish between C++17 structured bindings

[PATCH] D59774: [clang-format] Refine structured binding detection

2019-03-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 192117. krasimir added a comment. - Use exsiting implementation Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59774/new/ https://reviews.llvm.org/D59774 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.c

[PATCH] D59774: [clang-format] Refine structured binding detection

2019-03-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 192118. krasimir added a comment. - Cleanup Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59774/new/ https://reviews.llvm.org/D59774 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestObjC.cpp Index: unit

[PATCH] D59774: [clang-format] Refine structured binding detection

2019-03-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL356928: [clang-format] Refine structured binding detection (authored by krasimir, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINC

[PATCH] D60199: [clang-format] Do not emit replacements while regrouping if Cpp includes are OK

2019-04-03 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: ioeric. Currently clang-format would always emit a replacement for multi-block #include sections if `IBS_Regroup`, even if the sections are correct: % cat ~/test.h

[PATCH] D60199: [clang-format] Do not emit replacements while regrouping if Cpp includes are OK

2019-04-03 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 193500. krasimir added a comment. - Address review comments Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60199/new/ https://reviews.llvm.org/D60199 Files: lib/Format/Format.cpp unittests/Format/SortIncludesTest.cpp In

[PATCH] D60199: [clang-format] Do not emit replacements while regrouping if Cpp includes are OK

2019-04-03 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC357599: [clang-format] Do not emit replacements while regrouping if Cpp includes are OK (authored by krasimir, committed by ). Changed prior to commit: https://reviews.llvm.org/D60199?vs=193500&id=19350

[PATCH] D60263: [clang-format] Preserve include blocks in ObjC Google style

2019-04-04 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. krasimir added a reviewer: ioeric. Herald added a project: clang. Herald added a subscriber: cfe-commits. r357567 started to regroup include block for Google style; it was meant to apply only for C++. This patch reverts this for ObjC. Repository: rC Clang https

[PATCH] D60263: [clang-format] Preserve include blocks in ObjC Google style

2019-04-04 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir marked 2 inline comments as done. krasimir added inline comments. Comment at: lib/Format/Format.cpp:787 GoogleStyle.IncludeStyle.IncludeIsMainRegex = "([-_](test|unittest))?$"; GoogleStyle.IncludeStyle.IncludeBlocks = tooling::IncludeStyle::IBS_Regroup; GoogleSt

[PATCH] D60263: [clang-format] Preserve include blocks in ObjC Google style

2019-04-04 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir marked an inline comment as done. krasimir added a comment. In D60263#1454812 , @thakis wrote: > Why would we want this to be different in Obj-C and C++? Only the C++ Style Guide had been updated. Practically, clang-format would need to be updat

[PATCH] D60263: [clang-format] Preserve include blocks in ObjC Google style

2019-04-04 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 193699. krasimir added a comment. - Add a note about intent Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60263/new/ https://reviews.llvm.org/D60263 Files: lib/Format/Format.cpp unittests/Format/SortIncludesTest.cpp I

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