Search

Auto-formatting removes tabs by mteper

Closed
as Fixed Help for as Fixed

15
Sign in to vote
0
Sign in to vote
Sign in
to vote
Type: Bug
ID: 93488
Opened: 7/23/2004 9:53:12 AM
Access Restriction: Public
Duplicates: 91398 106932 114901 122307
0
Workaround(s)
3
User(s) can reproduce this bug
I wasn't able to find an option that would allow me to leave auto-formatting on but have it preserve tabs in a line, such as in example below:

int i =<tab>45;

the <tab> gets converted to a space when I enter the semicolon.
Details (expand)
Product Language
English
Version
Visual Studio 2005 Beta 1
Category
IDE
Operating System
Windows XP Professional
Operating System Language
US English
Steps to Reproduce
on a new line, type:

int i =<tab>45;
Actual Results
The line is converted to:

int i = 45;
Expected Results
The line remains:

int i =<tab>45;
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 7/27/2004 at 2:35 PM
You're right, there currently isn't an option to do this. Are you putting the tab there to line up the constant with other constants? In this case is i a field or local (or do you find yourself wanting to do this for both)?

Thanks!
Anson Horton [ansonh@microsoft.com]
Visual C# IDE PM
Posted by Microsoft on 8/2/2004 at 5:35 AM
The Microsoft Sub-status is now "Working on solution"
Posted by mteper on 8/6/2004 at 8:17 PM
I would like to be able to align both locals and fields, thanks!!!
Posted by Microsoft on 8/30/2004 at 4:00 PM
Unfortunately we're not going to be able to do this for the 2005 release; however, we'll deifnitely keep it on the radar for a future release. We really appreciate the feedback.

Thanks!
Anson Horton [ansonh@microsoft.com]
Visual C# IDE PM
Posted by mteper on 1/4/2005 at 1:04 AM
Is there a way to disable this auto-formatting? It is REALLY REALLY annoying. Thanks! (Note: I otherwise like the auto-formatting on ";" and would rather keep it on). Perhaps add an option to not replace tabs with spaces if they started out as tabs?
Posted by Microsoft on 1/11/2005 at 1:38 AM
Thanks for reporting the issue.

In the VS IDE, go to the menu items Tools->Options. Once the Options dialog box opens, from the list box select the Text Editor-->C# . In the right window by default, the Indenting is "SMART".
Select the "Block" radio button. Click Ok. Now, the auto-formatting would be disabled.

Thank you,
Vivek, VS2005 Product Team
Posted by Microsoft on 1/11/2005 at 2:23 AM
Thanks for reporting the issue.

In the VS IDE, go to the menu items Tools->Options. Once the Options dialog box opens, from the list box select the Text Editor-->C# . In the right window by default, the Indenting is "SMART".
Select the "Block" radio button. Click Ok. Now, the auto-formatting would be disabled.

Thank you,
Vivek, VS2005 Product Team
Posted by mteper on 1/27/2005 at 9:34 AM
Vivek,

That's not a solution! The "block" setting turns off automatic indenting for loop constructs which is very useful. That's not something I'm willing to give up to work around this limitation in your code.

All you need to is ignore tabs between variable types and names when you do the auto-formatting (either always or as an optional behavior).

Thanks!
-Michael
Posted by Microsoft on 1/28/2005 at 12:03 AM
Thanks for reporting this bug, we have been able to repro this issue and are investigating.

Thank you,
Vivek, VS2005 Product Team
Posted by Microsoft on 1/28/2005 at 11:33 AM
Michael,

There is no way to disable the formatting at the level of ignoring tabs in statements with the current formatting engine. You can disable automatic formatting (not by disabling smart indenting), but rather by going to Tools | Options | Text Editor | C# | Formatting | General. You can choose to only have formatting happen on code generation and when you explicit invoke it by unchekcing the options there.

I hope this helps!
Anson Horton [ansonh@microsoft.com]
Visual C# IDE PM
Posted by mteper on 2/1/2005 at 9:17 AM
Anson,

Granted, I don't know what other priorities are overriding this request, but what I find disappointing is that the IDE team is not giving enough emphasis to basic *code editing* productivity. I understand you can't be all things to everybody and that you are being pulled in all directions, but by ignoring issues like this you are failing your basic customer, the developer. Just look at JetBrains for an example of a company that is doing the exact opposite in concentrating first and foremost on basic code productivity. Their products have a cult-like following and its certainly not because of size or marketing. Just something to consider.
Posted by Microsoft on 2/14/2005 at 12:18 PM
Michael -
No matter how much we'd like to do this, we won't be able to do this for VS2005. We have already shut-down on adding new features for Whidbey and there's no way we'd be able to get this through the division wide bar that is currently in place. As Anson mentioned, you can go to Tools | Options | Text Editor | C# | Formatting | General and choose not to format on ";", which will allow you to keep your tabs (but still allow auto-formatting on loop constructs). I wish I had a better solution to give you now, but we do hear you, and have already listed this as a possible feature for our next version. Please feel free to email me at karenliu@microsoft.com to discuss this further.

Thanks,
Karen Liu
Visual C# IDE PM
Posted by Microsoft on 10/24/2005 at 5:57 PM
This issue has been reactivated as we begin planning for the next version of Visual Studio. Over the coming months we will reconsider feedback that was previously postponed. We welcome your comments and participation in this process.

-- Visual Studio Team
Posted by mteper on 10/19/2006 at 11:53 AM
Is this getting resolved for Orcas?
Posted by mteper on 12/7/2006 at 1:10 PM
I see it is now marked postponed. Does that mean it is getting postponed post-Orcas?
Posted by mteper on 12/7/2006 at 1:11 PM
I see it is now marked postponed. Does that mean it is getting postponed post-Orcas?
Posted by Microsoft on 9/24/2007 at 4:17 PM
Michael -
It's been a long time since we originally talked and your responses to the different options we were considering were extremely helpful in deciding what to do. We've added a new formatting option under Tools | Options | Text Editor | C# | Formatting | Spacing | Set other spacing options called "Ignore spaces in declaration statements". The option is OFF by default.

I wrote up more details here:
http://blogs.msdn.com/karenliu/archive/2007/09/24/auto-formatting-removes-tabs.aspx

Thanks!
Karen Liu [karenliu@microsoft.com]
Visual C# IDE Program Manager