Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Hi I have a bug thats been in Xamarin Studios 5.x + thats been around for a very long time now.
I don't think it existed in 4.0.x and does not exist in Unity3Ds version of MonoDevelop.
This bug has existed for at least 6 months on both OSX and Windows (not sure about Linux).
I write a lot of Unity3D plugin code that uses "Compiler Directives" in many areas throughout the projects. This is about the most annoying thing ever. I also run into this bug on any code project that uses any code complexity. iOS, Android, OSX, Windows ect ect... platform or .NET version doesn't matter.
NOTE: Make sure you set "Automatic" formatting settings in XamarinStudios under "Preferences->Text Editor->Behavior".
On this basic console example i'm running into it not adding a tab if: (NOTE: it will start to break everywhere once the project gets bigger)
1) Set your cursor to the end of the line "// Some test code here bla baaa..."
2) Then hit return and will not add the tab.
Here is the code you can copy in a Console app: http://pastebin.com/EnJtY0rZ
// Some test code here bla baaa...
public static void Main (string args)
public static void Main (string args)
int i = 0;
Console.WriteLine ("Hello World!");
if (0 == 0)
else if (i == 123)
int i2 = i;
throw new Exception("Blaa");
catch (Exception e)
I have checked this issue and I am able to reproduce the reported behavior.
When I set the "Indentation Mode" to "Automatic" and hit the return key after following statement I observed that XS removes the tab. I am getting the same behavior when I set the "Indentation Mode" to "None"
I’ll need confirmation from the developer if this is a bug. Leaving as NEW for now.
Mac OS X 10.10.0
Xamarin Studio : 5.5.4 (build 15)
Mono 3.10.0 ((detached/92c4884)
GTK+ 2.24.23 (Raleigh theme)
Package version: 310000031
=== Build Information ===
Release ID: 505040015
Git revision: f93940a35458a18052f1a25e106e62ca970d9c40
Build date: 2014-11-19 15:32:41-05
Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8
fixed in 220.127.116.11
btw. we're discussing about removing that feature at all and only support one way of indenting.
Why are you using automatic indent ?
"Why are you using automatic indent ?"
-- Because I hate the IDE formatting my code in a way that doesn't fit the code block correctly in particular contexts. One size does not fit all.
NOTE: This bug also effects "Smart" mode as well. Try to copy and paste code around in a larger project that makes heavy use of compiler directives and you will see this behavior (and its almost worse).
If you need a project that replicates this behavior I might be able to come up with something...?
I couldn't repro that with smart mode. If you've failing smart mode indentation I'm interested in these use cases.
btw. that bug has been fixed. If you find smart indentation bugs please file a new one otherwise it's hard to track these issues.
Ok here is a repo case for both "Indent" AND "Smart" modes.
Dropbox link: https://www.dropbox.com/s/5zk1lzyg2gq0yh5/WaterTest.zip?dl=0
Its a Unity3D project Water simulation. You don't need Unity3D to test this though as the CS project is included.
Directions to repo (Tested on OSX 10.10, XamarianStudios 5.5.4):
1) Download and extract the zip file.
2) Open to "WaterTest-csharp.sln".
3) In the "Assembly-CSharp-vs" project, open the file "Water.cs".
4) In "Indent" mode, copy line #11.
5) Hit return to add a new line after and paste the code you copied.
5.5) Notice how it adds and extra tab.
6) Undo what you just did.
7) In "Smart" mode, set your carrot to the end of line #11.
8) Hit return and will notice an extra tab is added.
Are you able to repo with your build?
I will make a new case for "Smart" mode.
Also NOTE: The MonoDevelop version that comes with Unity does not have this issue. Thats version 4.0.1
It's a weird project setting.
The indentation is set to 8. Open the solution options
source code->code formatting->text
tab is set to 4 and indent is set to 8. That's why 2 tabs get inserted to get to the indent level. Set both values to the same and it'll work.
"tab is set to 4 and indent is set to 8."
-- But the project setting is set to "Inherited Policy". This means it should ignore that setting? So still looks like a bug to me just in a different area. Probably some if statement is out of wack or was removed.
EDIT: This means it should ignore that project setting and use the global one from preferences thats set correctly to 4 by 4?
It's defined in the solution.
Settings are layered
global -> solution -> project
and if project inherits it takes the solution settings if that's set to inherit it takes the global ones. In that solution the setting is set on solution level.
Why is there no "Inherited Policy" for SLN files in XamarianStudios?
So now I can't use global settings unless I create a new solution... thats silly. I might look into adding that myself later if I have time.
This is a good question - I didn't change that :(.
I always thought that we have that at this level. It may make sense because that prevents that a solution opened with different global settings behaves the same.