Bug 3586 - Format code is removing try { code blocks
Summary: Format code is removing try { code blocks
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 2.8.6
Hardware: Macintosh Mac OS
: High normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-02-22 10:10 UTC by Florin Antoci
Modified: 2012-02-24 07:13 UTC (History)
1 user (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 Florin Antoci 2012-02-22 10:10:59 UTC
In version 2.8.6.5 if I use format code, it's removing the

"try {" part from try-catch blocks.
Comment 1 Mike Krüger 2012-02-23 06:03:55 UTC
Are you using spaces or tabs ?
I think you're using \n line endings on mac and not \r\n ones, right ?

Does it happen for:
----------------------------
public class Foo
{
	void Bar ()
	{
		try {
			Something ();
		} catch (Foo foo) {
			
		}
	}
}
----------------------------

Try to remove some whitespaces or something, I need a use case for this bug to repro it.
Comment 2 Florin Antoci 2012-02-23 11:29:42 UTC
Hi

If I'm using this code, for example:

public object GetValue(string p_columnName)
        {
            try
            {
				
                EntityProperty property = this.GetPropertyByName(p_columnName);
                if (this.Values == null)
                    throw new TableIsEmptyException();
                if (base.Count > property.PropertyIndex)
                    return base[property.PropertyIndex].CurrentValue;
                else
                    throw new TableStructureIncorrectException();
            }
            catch
            {
                return null;
            }
        }

Regards

Florin Antoci
Comment 3 Mike Krüger 2012-02-24 04:21:37 UTC
I could verify & fix the issue.

Thanks for the test case.