Bug 467374 - Formatter: Newline before comma in constructor initializer list
Summary: Formatter: Newline before comma in constructor initializer list
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: Next   Edit
Hardware: All Linux
: P3 enhancement with 7 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-15 03:23 EDT by Deepak Yadav CLA
Modified: 2020-09-04 15:26 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Yadav CLA 2015-05-15 03:23:39 EDT
CDT code Formatter should give an option to format constructor initializer list like this (Note: New line before comma):

    class Point
    {
      public:
        Point(double a, double b, double c, double d)
          : a(a)
          , b(b)
          , c(c)
          , d(d)
          , e(0)
          , f(1)
        {
        }

Open Formatter : Project -> Properties -> C++ General -> Formatter

CDT already has this feature (in tab: 'New Line') :
  'insert new line' box :
     1) before colon in constructor initializer list

Please add this new option in above tab 
 (tab: New Line, Box: 'insert new line'):
    1) Newline before comma in constructor initializer list

This will avoid a 2-line edit in the constructor initialization line when adding a new field. So, This formatting is better than adding a trailing ',' to the existing line and then the new field on the next.

Thanks
Deepak