Bug 4702 - Brace in array initializer causes excessive deindentation
Summary: Brace in array initializer causes excessive deindentation
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2012-04-27 16:44 UTC by Mikayla Hutchinson [MSFT]
Modified: 2012-04-30 10:25 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Mikayla Hutchinson [MSFT] 2012-04-27 16:44:06 UTC
In the following code, remove and re-type the }. The code will be re-indented one level too shallow.

var s = "".Split (new char[] {' '});
Comment 1 Mike Krüger 2012-04-28 07:39:08 UTC
It's the indenter - not fixable atm.
Comment 2 Mike Krüger 2012-04-28 07:39:37 UTC
I mean I want to replace it with the formatting engine :)
Comment 3 Mikayla Hutchinson [MSFT] 2012-04-28 08:51:06 UTC
But why is it reindenting when I type "{"? That's definitely a change.

It also seems to reindent when I type a semicolon inside a string, e.g.

val = "".Split (new string[] { ":", ";
Comment 4 Mike Krüger 2012-04-28 10:53:55 UTC
indenting is corrected now at more places to ensure that the code is correct - some keys were broken in 2.8.x I assume - the redindenting on '}' was always there since I've known this text editor extension. 

I don't know why it changes the indent on { ... } the indent shouldn't change. But I'm sure that I didn't touch the algorithm (redindent with tab malforms that one as well).

It redindents blindly on } and ;. But ; corrects it for me as there the on the fly formatter starts.
Comment 5 Mike Krüger 2012-04-30 06:58:22 UTC
Comment 6 Mikayla Hutchinson [MSFT] 2012-04-30 10:25:27 UTC
Well, the other issue was that it reindents/formats on ";" inside a string. That's wrong, surely?