Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Code alignment feature

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
chanwai1219 Posted - Jun 13 2011 : 10:42:26 PM
Programming is slightly different, we often have a lot of assignments underneath each other, and although they not the same like maths, there's a close relationship. As such aligning the equals allows us to quickly spot the relationship.

Further it makes your code so much readable, by not aligning, it's like opening up a CSV file in notepad. If you open up that CSV file in Excel, it's becomes so much easier to read since the columns have meaning.

Compare these


person.FirstName = "Chris";                
person.Surname = "McGrath";               
person.Age = 24;                           
person.Occupation = "Software Developer"; 
person.HomeTown = "Brisbane";              

=>  

person.FirstName  = "Chris";
person.Surname    = "McGrath";
person.Age        = 24;
person.Occupation = "Software Developer";
person.HomeTown   = "Brisbane";


will va do these alignment for me ? thank you for your advising
4   L A T E S T    R E P L I E S    (Newest First)
Vertexwahn Posted - Jun 21 2011 : 6:08:18 PM
@chanwai1219
use Visual Studio 2010 G?? Productivity tools

as described here: http://codereflect.com/2010/08/11/visual-studio-2010-productivity-tools/
quote:

Align Assignments
This extension is useful for making your code a little more readable by aligning the assignments when you type Ctrl+Alt+] such that it takes this:
...

feline Posted - Jun 15 2011 : 10:06:11 AM
Using AStyle as a tool is certainly an interesting option, but it still needs to be configured, and based on a quick glance at the documentation it does not offer any where near as many options, as much control over code formatting, as people tend to want. When this question comes up, people often want very detailed control over their code formatting.

We are considering adding a feature to automatically word wrap comments, so the lines don't get to long:

case=3866
Vertexwahn Posted - Jun 14 2011 : 9:15:25 PM
I think the assignment operator alignment is to specific to be of great use for the majority of the VAssistX users, but you should definitely think about an automatically indenting feature as offered by http://astyle.sourceforge.net/. AStyle is under LGPL license so you don't have to reinvent the wheel. Besides that a automatic line breaker would be nice - for example a line should not contain more than 90 characters
feline Posted - Jun 14 2011 : 3:21:18 PM
Unfortunately we don't have any current plans to get into code formatting like this, since to do this properly is quite complex, and requires a massive number of options.

If you just want this formatting, have a look at the IDE macro's that should have been installed by default. In VS2005 I have the macro:

Macro Explorer -> Samples -> VSEditor -> LineEmUp

the description of this macro says that it is designed to do just this.

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