Bug 8887 - Indentation of brackets & lack of brackets
Summary: Indentation of brackets & lack of brackets
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: 2.8.2
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-12-11 15:40 UTC by Pencil88
Modified: 2012-12-12 16:16 UTC (History)
1 user (show)

Tags:
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:
Status:
RESOLVED FIXED

Description Pencil88 2012-12-11 15:40:57 UTC
When you format, all else if statements indent their brackets.  This could be because there is now specific else if option in the formatting options.

Expected:

if(...)
{
    ...;
}
else if(...)
{
    ...;
}
else
{
    ...;
}

Results:

if(...)
{
    ...;
}
else if(...)
    {
        ...;
    }
else
{
    ...;
}

Secondly, foreach doesn't put any brackets, also no option in formatting for this.

Hope this helps, and this could be resolved in the near future or if it is fixed in a later version that still works with Unity, let me know.  Thanks.  I am currently using Unity 4.0 & Mono 2.8.2.
Comment 1 Mike Krüger 2012-12-12 00:13:39 UTC
2.8.2 is outdated (the formatting engine there is  +3 years old) - should work in newer versions.

(I don't know why unity uses such an old monodevelop version)
Comment 2 Pencil88 2012-12-12 10:00:15 UTC
Hmm Ok that makes sense, Do you know if you can use the newest version or will it not work for other Unity operations?  Thanks.
Comment 3 Mikayla Hutchinson [MSFT] 2012-12-12 16:16:07 UTC
You can't use MD 3.x for debugging Unity, for editing UnityScript or for editing Boo. Unity has written custom MD addins for these features, and they have not ported the addins to MD 3.x yet. If you're interested you could try porting them yourself, see http://forum.unity3d.com/threads/160432-Monodevelop-is-kinda-weak.-Can-we-fix-it-together?p=1105928&viewfull=1#post1105928 for more info.

However, you *can* use MD 3.x for editing and compiling C# code that can be used in a Unity project. For example, when I was using Unity for MolyJam, I used MD 3.x to edit and build a C# library project, and debug it via a simple console test app. I had a postbuild step to copy the library into the Unity project, and my MolyJam partner used some UnityScript to consume my library from within Unity.