Bug 59890 - Inserting or sorting usages reformats the whole document
Summary: Inserting or sorting usages reformats the whole document
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding (show other bugs)
Version: Trunk
Hardware: PC Mac OS
: High normal
Target Milestone: 15.6
Assignee: Mike Krüger
URL:
: 60084 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-10-02 12:54 UTC by Lopatkin Ilja
Modified: 2017-10-30 06:39 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: Yes
Last known good build: 7.3.0.639 (d15-5)

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 Lopatkin Ilja 2017-10-02 12:54:40 UTC
This behavior appeared after merge with master-roslyncompletion branch though I'm not really sure if these things are related.
Comment 1 Mike Krüger 2017-10-04 08:46:01 UTC
that branch doesn't change this behavior.

I can't repro it with current master:

https://bugzilla.xamarin.com/show_bug.cgi?id=39274
Comment 2 Matt Ward 2017-10-04 09:15:12 UTC
My repro:

1) Create a C# library.
2) In MyClass.cs reformat it and save the file so it looks like this:

using System.Collections;
using System;
using System.CodeDom;

namespace Test
{
	public class MyClass {
		public MyClass() {
		}
	}
}

3) Right click on the using System.Collections line and select Quick Fixes - Sort and remove usings.

Expected result:

File is not yet saved.
All usings removed
MyClass code not reformatted.

Actual result:

File is not yet saved.
All usings removed.
MyClass code reformatted:

namespace Test
{
	public class MyClass
	{
		public MyClass()
		{
		}
	}
}

Tested with VS Mac 7.4.0.216 (master).

VS Mac 7.3.0.639 (d15-5) will remove all the usings but the code still has the original formatting.


In preferences both Enable on the fly formatting and Format document on save are disabled for me.
Comment 3 David Karlaš 2017-10-10 10:49:25 UTC
*** Bug 60084 has been marked as a duplicate of this bug. ***
Comment 4 xamarin-release-manager 2017-10-30 06:39:06 UTC
Fixed in version 7.4.0.468 (master)

Pull Request #3271 merged by: Mike Kr??ger
Author: mono
Commit: 35267d24ffde067a16992a384519cb02d621f75b (mono/monodevelop)