Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Code alignment feature
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

chanwai1219
New Member

2 Posts

Posted - Jun 13 2011 :  10:42:26 PM  Show Profile  Reply with Quote
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

Edited by - chanwai1219 on Jun 13 2011 10:44:47 PM

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jun 14 2011 :  3:21:18 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

Vertexwahn
Senior Member

35 Posts

Posted - Jun 14 2011 :  9:15:25 PM  Show Profile  Reply with Quote
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
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jun 15 2011 :  10:06:11 AM  Show Profile  Reply with Quote
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

zen is the art of being at one with the two'ness
Go to Top of Page

Vertexwahn
Senior Member

35 Posts

Posted - Jun 21 2011 :  6:08:18 PM  Show Profile  Reply with Quote
@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:
...

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000