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
 Technical Support
 Code Formatting after refactor
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sdfox
New Member

USA
4 Posts

Posted - Apr 18 2014 :  12:28:55 PM  Show Profile  Reply with Quote
I have auto formatting rules setup within Visual Studio (VS2010), but VA doesn't use them or I don't know how to tell it to use them. Can someone explain this? At this point, the refactoring capability does not save me any time if I have to manually reformat the code after refactoring something. If I surround some code with an if() {} then I have to select the whole block and autoformat from the visual studio menu. I might as well just type it out myself if I have to do that. I would think that there is a way to get that behavior but I must not be finding the option within VA. Please help if you know how to rectify this.

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Apr 18 2014 :  2:01:51 PM  Show Profile  Reply with Quote
How are you doing the surround with an if block? If you are using a VA Snippet then editing the formatting inside the VA Snippet to match the formatting rules you are using is probably the best answer here:

http://docs.wholetomato.com/default.asp?W261

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

sdfox
New Member

USA
4 Posts

Posted - Apr 29 2014 :  6:42:41 PM  Show Profile  Reply with Quote
I simply highlight a block of code, right click, and select one of the many surround with refactoring options. I'm not sure that editing snippets is what I want. The primary issue here is tabs vs. spaces. Why is Visual assist inserting tabs, when I have visual studio setup to convert tabs to 4 spaces? I don't see anywhere within the snippet editor where I'd setup tabs vs spaces as an option.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - May 06 2014 :  09:44:55 AM  Show Profile  Reply with Quote
For me, this is working correctly. Testing the surround with "if" and "do" snippets, I have made sure the indented line in the snippet editor is indented with spaces. If you are using the current version of VA you will get the new improved VA Snippet editor in VS2010, which has a button to show white space in the editor window.

There is one "oddity" here, if the code you select to surround is indented with tabs, then more tabs will be entered, but the indenting with spaces in the VA Snippet will still be done correctly. If the code you selected to surround is indented with spaces, then more spaces will be inserted.

So with code indented with spaces, and the snippet edited to use spaces, no tabs are being inserted for me.

We are looking to make snippets insert spaces instead of tabs when this is set in the IDE options:

case=6712

As always, we need to keep an eye out for the edge cases when doing changes like this.

zen is the art of being at one with the two'ness
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