[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2023-01-28 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment.

In D14484#4087879 , @HantaoPan wrote:

> Thank you! Is there a similar flag wrt function parameter? (say a "Never" 
> other than "false", which can always put each function parameter on its own 
> line.)

Nope.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2023-01-28 Thread Hantao Pan via Phabricator via cfe-commits
HantaoPan added a comment.

In D14484#4087827 , @owenpan wrote:

> In D14484#4079711 , @HantaoPan wrote:
>
>> Hi,
>> I am interesting in this feature too. You know, consistency is crucial to a 
>> large program...
>>
>> regards,
>
> As mentioned above, it has been added in D108752 
> . See also 
> https://clang.llvm.org/docs/ClangFormatStyleOptions.html#packconstructorinitializers.

Thank you! Is there a similar flag with respect to function parameter?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2023-01-27 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment.

In D14484#4079711 , @HantaoPan wrote:

> Hi,
> I am interesting in this feature too. You know, consistency is crucial to a 
> large program...
>
> regards,

As mentioned above, it has been added in D108752 
. See also 
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#packconstructorinitializers.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2023-01-25 Thread Hantao Pan via Phabricator via cfe-commits
HantaoPan added a comment.
Herald added a project: All.

Hi,
I am interesting in this feature too. You know, consistency is crucial to a 
large program...

regards,


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2021-12-18 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment.

See D108752 .


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2021-06-01 Thread Nikolai Hlubek via Phabricator via cfe-commits
nhlubek added a comment.

In order to push this forward I have written a bug ticket that highlights this 
issue:

https://bugs.llvm.org/show_bug.cgi?id=50549

The patch is also really simple with the clang-format options that are 
available nowadays
https://github.com/Nikolai-Hlubek/clang/tree/ConstructorInitializer_AlwaysBreakAfterColon


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2021-05-31 Thread Jeroen Van Antwerpen via Phabricator via cfe-commits
Jeroen added a comment.

In D14484#2788953 , @FStefanni wrote:

> Hi,
>
> in case of any doubt: yet it is of interest.
> 6 years old means only that it has not been "fixed" in the meanwhile...
>
> Please consider that there are not many code formatters for C++, since it is 
> quite a complex language (and a lot of different formatting conventions!).
> So we are just waiting to have integrated the formatting rules that we need.
>
> Regards.

Feel free to revive my patch, I'll be very happy to finally start using this.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2021-05-31 Thread Francesco Stefanni via Phabricator via cfe-commits
FStefanni added a comment.

Hi,

in case of any doubt: yet it is of interest.
6 years old means only that it has not been "fixed" in the meanwhile...

Please consider that there are not many code formatters for C++, since it is 
quite a complex language (and a lot of different formatting conventions!).
So we are just waiting to have integrated the formatting rules that we need.

Regards.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2021-05-30 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment.

We can't rename options without giving some form of backwards compatibility, 
personally, I think we need to start again with this review if its still of 
interest, this one is 6 years old.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2021-05-30 Thread Timo Suoranta via Phabricator via cfe-commits
tksuoran added a comment.

I would like to use exactly the same formatting (really exactly one initializer 
(and nother else) per line). 
Some comments:

- Keep `ConstructorInitializerAllOnOneLineOrOnePerLine` so that the change does 
not break any existing behavior
- Default value for `ConstructorInitializerKind` would make 
`ConstructorInitializerAllOnOneLineOrOnePerLine` to be used
- Non-default values for `ConstructorInitializerKind` would enable for example 
really exactly one initializer per line - yay!
- End result:
  - Old style settings keep working and it just works, giving old results
  - New style settings can omit  
`ConstructorInitializerAllOnOneLineOrOnePerLine` and use 
`ConstructorInitializerKind` and it just works


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2020-10-26 Thread Andrew Somerville via Phabricator via cfe-commits
catskul added a comment.

@FStefanni, after managing to update this patch to work with the latest code, 
and trying out your example it appears this patch doesn't quite cover your case.

I did manage to fix it to cover your case, but I suppose at this point I should 
ask @MyDeveloperDay and @djasper, can/should I upload my diff to replace this 
one?

I'd like to adopt this diff and get it past the finish line if possible.

In D14484#2338756 , @FStefanni wrote:

> Hi,
>
> thank you for the suggestion, but it does **not**, at least with 
> `BreakConstructorInitializers: AfterColon` (which is what I use).
> If initializers are "small enough" to fit the constructor line, all will 
> finish on the same line.
>
> ...




Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2020-10-19 Thread Francesco Stefanni via Phabricator via cfe-commits
FStefanni added a comment.

Hi,

thank you for the suggestion, but it does **not**, at least with 
`BreakConstructorInitializers: AfterColon` (which is what I use).
If initializers are "small enough" to fit the constructor line, all will finish 
on the same line.

E.g.

  MyClass::MyClass(): a(), b()
  {}

But what I like is:

  MyClass::MyClass(): 
  a(), 
  b()
  {}

Regards.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2020-10-15 Thread Andrew Somerville via Phabricator via cfe-commits
catskul added a comment.

In D14484#2246171 , @FStefanni wrote:

> Hi to all,
>
> I am also interested to this option, since match my personal style, but more 
> important, in my experience, this kind of formatting is very used.
> I hope it will be implemented in a near future.
>
> Which is the current status? Is someone going to support this?
>
> Regards.

@FStefanni it seems `ConstructorInitializerAllOnOneLineOrOnePerLine =  false` 
may do the trick per @MyDeveloperDay .

I tried this and had success so far. Try it out and see if it resolves your use 
case.

In D14484#1689271 , @MyDeveloperDay 
wrote:

> Looking at this I'm wondering if this Isn't at least partially handled by the 
> `BreakConstructorInitializersStyle`  in combination with 
> `ConstructorInitializerAllOnOneLineOrOnePerLine` style?
>
> I can't be exactly sure but I think BreakConstructorInitializersStyle  didn't 
> exist before 2017 D32479: clang-format: Introduce 
> BreakConstructorInitializers option  when 
> this original patch was submitted
>
>   BreakConstructorInitializers: BeforeComma
>   ConstructorInitializerAllOnOneLineOrOnePerLine: true
>   
>   SomeClass::Constructor() : aa(aaa), bb(bbb), cc(cc) {}
>   
>   SomeClass::Constructor()
>   : aa(a, aaa,
>aaa)
>   , bb(bbb)
>   , cc(cc) {}
>
>
>
>   BreakConstructorInitializers: BeforeComma
>   ConstructorInitializerAllOnOneLineOrOnePerLine: false
>   
>   SomeClass::Constructor()
>   : aa(aaa)
>   , bb(bbb)
>   , cc(cc) {}
>   
>   SomeClass::Constructor()
>   : aa(a, aaa,
>aaa)
>   , bb(bbb)
>   , cc(cc) {}
>
> At least the unit tests appear to be covered by using those styles?
>
> Nit: At a minimum, this patch would need to be rebased and be a full context 
> diff, can anyone see a  use case that can't be covered with what we have?
>
> Moving to "request changes" (really request to abandon if not necessary any 
> longer)




Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2020-08-29 Thread Francesco Stefanni via Phabricator via cfe-commits
FStefanni added a comment.
Herald added a subscriber: danielkiss.

Hi to all,

I am also interested to this option, since match my personal style, but more 
important, in my experience, this kind of formatting is very used.
I hope it will be implemented in a near future.

Which is the current status? Is someone going to support this?

Regards.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2020-01-02 Thread Nikolai Hlubek via Phabricator via cfe-commits
nhlubek added a comment.

Required change for break after colon:

https://github.com/llvm-mirror/clang/pull/67

New unit test shows use case that is not covered currently.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2019-10-21 Thread Nikolai Hlubek via Phabricator via cfe-commits
nhlubek added a comment.

In D14484#1689271 , @MyDeveloperDay 
wrote:

> Looking at this I'm wondering if this Isn't at least partially handled by the 
> `BreakConstructorInitializersStyle`  in combination with 
> `ConstructorInitializerAllOnOneLineOrOnePerLine` style?




> [...]



> At least the unit tests appear to be covered by using those styles?

I checked with https://zed0.co.uk/clang-format-configurator/ and it isn't 
handled.

The reason is that `BreakConstructorInitializersStyle` only comes into play if 
the constructor initializers don't fit on a line. 
The unit tests work because they have

  Style.ColumnLimit = 60;




Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2019-10-01 Thread Pooya Daravi via Phabricator via cfe-commits
puya added a comment.

> Looking at this I'm wondering if this Isn't at least partially handled by the 
> BreakConstructorInitializersStyle in combination with 
> ConstructorInitializerAllOnOneLineOrOnePerLine style?

I’m fairly certain that’s only true when line is long enough to be broken. In 
which case second one ensures one per line (as opposed to different number of 
initializations per line) and the first one determines the style. They would 
not result in the requestes behavior if the line is not longer than max column. 
(I will double check when I am in front of a computer)


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D14484: [clang-format] Formatting constructor initializer lists by putting them always on different lines

2019-10-01 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay requested changes to this revision.
MyDeveloperDay added a comment.
This revision now requires changes to proceed.

Looking at this I'm wondering if this Isn't at least partially handled by the 
`BreakConstructorInitializersStyle`  in combination with 
`ConstructorInitializerAllOnOneLineOrOnePerLine` style?

I can't be exactly sure but I think BreakConstructorInitializersStyle  didn't 
exist before 2017 D32479: clang-format: Introduce BreakConstructorInitializers 
option  when this original patch was submitted

  BreakConstructorInitializers: BeforeComma
  ConstructorInitializerAllOnOneLineOrOnePerLine: true
  
  SomeClass::Constructor() : aa(aaa), bb(bbb), cc(cc) {}
  
  SomeClass::Constructor()
  : aa(a, aaa,
   aaa)
  , bb(bbb)
  , cc(cc) {}



  BreakConstructorInitializers: BeforeComma
  ConstructorInitializerAllOnOneLineOrOnePerLine: false
  
  SomeClass::Constructor()
  : aa(aaa)
  , bb(bbb)
  , cc(cc) {}
  
  SomeClass::Constructor()
  : aa(a, aaa,
   aaa)
  , bb(bbb)
  , cc(cc) {}

At least the unit tests appear to be covered by using those styles?

Nit: At a minimum, this patch would need to be rebased and be a full context 
diff, can anyone see a  use case that can't be covered with what we have?

Moving to "request changes" (really request to abandon if not necessary any 
longer)


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D14484/new/

https://reviews.llvm.org/D14484



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits