Bug 10654 - Auto-Fix of Generate Setter depends on formatting of the code
Summary: Auto-Fix of Generate Setter depends on formatting of the code
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: 4.0
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2013-02-25 14:37 UTC by Ciprian Khlud
Modified: 2013-02-25 15:10 UTC (History)
1 user (show)

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:

Description Ciprian Khlud 2013-02-25 14:37:44 UTC
Description of Problem:
Auto-Fix of Generate Setter depends on formatting of the code

Steps to reproduce the problem:
1. Create a console application
2. Paste this code as starting point:
using System;

namespace TestConsole
	public class Test
		string Name { get { return "test"; } }
	class MainClass
		public static void Main (string[] args)
			Console.WriteLine ("Hello World!");

3. set the cursor to the word: get; from the line: string Name {get { ... } }
4. Press Alt+Enter (to show quick fix)
5. It correctly states: Generate Setter
6. Click on Generate Setter
Expected result: 

		string Name { 
set { throw new NotImplementedException(); }
get { return "test"; } }

Actual result:
set {
			throw new NotImplementedException ();
		string Name { get { return "test"; } }

Expected Results:

How often does this happen? 
Every time.

Additional Information:
Formating the code like:
string Name { 
	get { return "test"; } //get is put on separate line
will generate correct code.
Comment 1 Mike Krüger 2013-02-25 15:10:55 UTC