Auto Indent fails for ASP.NET MVC3 Razor documents - by Simon Mattes

Status : 

  Deferred<br /><br />
		The product team has reviewed this issue and has deferred it for consideration at a later time.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 650455 Comments
Status Closed Workarounds
Type Bug Repros 14
Opened 3/9/2011 1:42:25 PM
Access Restriction Public


When creating a view for a controller, auto format (Ctrl+E, D) fails to format the document properly:

	ViewBag.Title = "Test";
	@using( Html.BeginForm() )

Sign in to post a comment.
Posted by Sachelis on 8/13/2013 at 10:11 AM
Arg. This is really frustrating. The workaround of using spaces works, but I want tabs in my document. Without the workaround, the alignment is terrible. If a code editor should do anything, it should be able to line up statements and brackets.
Posted by neooleg on 5/27/2013 at 5:02 AM
Visual Studio 2012 has this issue too!

Detailed version info:
Microsoft Visual Studio Ultimate 2012
Version 11.0.60315.01 Update 2
Microsoft .NET Framework
Version 4.5.50709
Posted by Microsoft on 3/25/2011 at 8:57 AM
Thank you for passing along this issue to us. At this point, we are pulling together this and other feedback as part of our planning and evaluation for the next release. We know that our customers are the most qualified people to help us learn how to make our products better, and we greatly appreciate hearing from you.
Posted by Duckboy on 3/10/2011 at 6:22 AM
Oh, and this isn't just a "re-format" issue; this happens just on regular editing, too. When pressing Enter in a Razor document, the cursor comes up in the wrong place on the following line (for me, it's always less indented than it should be).
Posted by Duckboy on 3/10/2011 at 6:19 AM
When editing a Razor document (cshtml in my case), the Visual Studio editor appears to be using 2-space indents (" ") rather than honouring the setting specified in Tools/Options/Editor/All Languages/Tabs.

I'm using VS 2010 SP1.
Posted by Microsoft on 3/9/2011 at 7:25 PM
Thank you for reporting the issue.
We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution.These specialized experts will follow-up with your issue.
Posted by Microsoft on 3/9/2011 at 2:13 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(