Bug 30103 - Formatting doesn't trigger on save for xaml or xml files
Summary: Formatting doesn't trigger on save for xaml or xml files
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: XML Editor ()
Version: 5.9
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-05-14 18:54 UTC by George Cook
Modified: 2015-07-08 15:52 UTC (History)
2 users (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 George Cook 2015-05-14 18:54:24 UTC
save on format triggers formatting for c# files when saving. It does not in xaml/xml files.



Xamarin Studio
Version 5.9.1 (build 3)
Installation UUID: d7363558-28ec-4976-84a9-41fb9357ce07
Runtime:
	Mono 4.0.0 ((detached/d136b79)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400000143

Apple Developer Tools
Xcode 6.3.1 (7703)
Build 6D1002

Xamarin.Mac
Version: 2.0.0.262 (Starter Edition)

Xamarin.iOS
Version: 8.10.0.267 (Indie Edition)
Hash: 6481535
Branch: master
Build date: 2015-04-27 04:38:13-0400

Xamarin.Android
Version: 5.1.1.0 (Indie Edition)
Android SDK: /Users/georgecook/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Xamarin Android Player
Version: Unknown version
Location: /Applications/Xamarin Android Player.app

Build Information
Release ID: 509010003
Git revision: aad75a6e7e48f18120ce41f47d0ff2c6216f49c3
Build date: 2015-05-08 12:46:18-04
Xamarin addins: 1246b3044cbb7f56a217334f8fc5489ef8eefe3f

Operating System
Mac OS X 10.10.3
Darwin hobbiton.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 1 Saurabh 2015-06-09 05:55:39 UTC
Hi George,

I have observed that when I change format in xml file and save it, I am not seeing the changed format after reopening xml file . This is the screencast for the same: http://www.screencast.com/t/SvxQUR4wlR

Please let me know it is the same behavior which you are getting? OR please provide me steps or screencast if this is different
 
X.S 5.9.4 (build 3)
X.Android 5.1.4.8 (Enterprise Edition)
Comment 2 George Cook 2015-06-10 08:08:44 UTC
In your video you are not formatting anything at all.

your document contains illegal xaml, (becuase you've not copy and pasted just my example xaml; but instead the entire comment).

so you are not actually running the formatter.. you can see this very easily.. 1. the resulting format doesn't match the settings, 2. if you still don't believe me, just change the attributes, padding, etc and run the formatter - you will observe nothing happens.

as it goes, this is another very irritating but.. if the xaml is not perfectly formed, the formatter does NOTHING, with no warning or indicaiton to help one resolve the xaml issue. very tedious indeed.

Please run this again, with just the xaml, not the entire message and verify the xaml actually formats. you will see it re-produce the behaviour.

I'll also raise a ticket about the formatter not reporting errors.
Comment 3 George Cook 2015-06-10 08:11:18 UTC
raised https://bugzilla.xamarin.com/show_bug.cgi?id=30970 about the silent formatter failure.
Comment 4 George Cook 2015-06-10 08:12:46 UTC
oops. that comment #2 is for the wrong bug!!

You are correctly identifying that formatting is not triggered on save. saving a document should format it first.
Comment 5 xamarin-release-manager 2015-07-08 15:52:09 UTC
Fixed in version 5.10.0.337 (master)