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 for Bug 20144 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
I can't seem to change any code formatting settings that will affect tab usage in Android AXML files.
I've got a bunch of AXML files in a project that are using 4 spaces instead of tabs. (Even new AXML files in Xamarin Studio seem to use spaces by default.) Unfortunately, Xamarin Studio wants to use real tab characters whenever I modify indenting in source-mode for an AXML file, and I cannot seem to change that preference. It seems as if AXML files are not affected by XML code formatting settings.
1. Spin up new Android Application
2. Set XML files to use spaces instead of tabs (e.g., check "Convert tabs to spaces" and/or setting the document/attribute "indent string" to spaces)
3. Open /Resources/layout/Main.axml
4. Switch to Source editing mode
5. Increase indent on any line (tag or wrapped attribute)
It seems that a tab character will always be used for increasing indent in AXML files, no matter what settings are used in Preferences (or solution-/project-level) for XML code formatting.
Xamarin Studio would just use any XML code formatting for AXML files as well.
What version of XS? Where did you set the policy?
Works for .xml files but fails for .xaml.
For me it looks like the android designer is using a custom editor or broken extension chain ?
It seems that the Project isn't set for for the SourceEditorView.
Btw. I would've recommended not implementing an own editor component ... it's hard to get that right. We not just adding the designer as a subview ?
In this case, I'm running version 5.0 (build 878).
At various times I've tried setting the policy at the application level (Xamarin Studio -> Preferences), the solution level, and the project level (all under Source Code -> Code Formatting -> XML document). However you try to set it, in the "XML document" section, there are two spots that look like they would allow for tab settings in XML: Text Style -> Whitespace and XML Format -> Document -> Indent string (combined with XML Format -> Attributes -> Attributes indent string).
It' s probably because the default AXML editor is not a well-linked editor.
Can you confirm your policy work if instead of opening the layout in the designer and then clicking on "Source" you instead open it up by right-clicking it and "Open With > Source Code Editor"
Created attachment 7272 [details]
Showing identical issues in AXML designer source and Source Code Editor
Sorry for the double email. I slipped and forgot to comment with that image upload.
TL;DR: Source Code Editor on an AXML file doesn't seem to help.
Here's the walkthrough of what is shown in the GIF:
Starts with solution text formatting settings to show what is set in this new project. I set XML to 2 spaces (and XML tab to " ", though it seems irrelevant) and text to 3 spaces to see which was going to be used.
The Test.axml window is opened by Source Code Editor and Main.axml is opened by viewing source from the designer.
Despite both tab settings as spaces, inserting a tab in either window inserts an actual tab character rather than spaces.
Finally, I show what happens (in both windows, only shown in one) when choosing to format the document. That was just an oddity I noticed, but it may not be related to this bug directly.
No update on this? Same issue with the Xamarin Studio 6 preview 3. It's kind of pointless to customize XML formatting settings if they don't apply to 90% of the XML files we edit (Android layout files). Why does this bug still have a status of NEEDINFO?
I can CONFIRM that axml files seem to be ignored by XML policies in Visual Studio for Mac 7.1 Preview.
I also attempted to rename the axml file to an xml extension, but the policy doesn't seem to work either. In all scenarios it seems to insert a full tab when my tab is set to 1-3 characters.
I then made sure I created a new project as per the warning mentioning that these changes will only occur in a new project.
I also tried to adjust the per project policies, but between the XML document, Android layout, and Text file custom policies, I am not seeing anything change in the Android Designer. It all seems to be the default 4 spaces regardless of a custom policy.
Thus I'm marking this issue as CONFIRMED
There are some changes coming in the future that should help enable us to fix this bug.