Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 One function parameter per line with alignment

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
cpp_john Posted - Feb 07 2015 : 04:27:39 AM
Would it be possible to implement a formatting feature that converts a function signature written with each parameter on the same line like this:



void DoSomething(int abc, int def, int xyz)
{
    ...
}



or with parameters distributed on different lines with multiple parameters per line, like this:



void DoSomething(int abc, int def, int longName,
    int anotherParam, DWORD foo, int bar)
{
    ...
}



into another form in which there is one parameter per line, and the parameters are horizontally aligned properly, like the following example?



void DoSomething(int abc,
                 int def,
                 int xyz)
{
    ...
}



This feature could be applied to:



  • current selection: reformat one or more functions in the current selection


  • current file: reformat all functions in the current file





Thank you very much.
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Feb 07 2015 : 4:13:06 PM
Unfortunately we don't have any plans to do code formatting. It is a complex area, since everyone tends to have a different view of the correct formatting for their code.

Depending on the IDE you are using you could look into an IDE macro to help with this. In VS2010, there is a sample macro called LineEmUp, which should help to get you started.

Alternatively you could consider a third-party extension or external program, e.g. GC GreatCode, Uncrustify, and StyleManager.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000