Bug 547947 - the default text when creating a new class has too many newlines
Summary: the default text when creating a new class has too many newlines
Status: RESOLVED DUPLICATE of bug 549472
Alias: None
Product: MonoDevelop
Classification: Mono
Component: C# Binding (show other bugs)
Version: 2.2 Beta 2
Hardware: Other Other
: P5 - None : Minor
Target Milestone: 2.4
Assignee: Michael Hutchinson
QA Contact: MD Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-17 22:56 UTC by nicolò chieffo
Modified: 2010-04-09 05:28 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nicolò chieffo 2009-10-17 22:56:38 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20091007 Ubuntu/9.10 (karmic) Firefox/3.5.3

remove all blank newlines from newly created classes

Reproducible: Always

Steps to Reproduce:
1. Right click on project
2. Add
3. New file
4. select class or interface, .... (what you like)
Actual Results:  

using System;

namespace Test
{


	public class NewClass
	{

		public NewClass ()
		{
		}
	}
}


Expected Results:  

using System;

namespace Test
{
	public class NewClass
	{
		public NewClass ()
		{
		}
	}
}
Comment 1 Mike Krueger 2009-10-19 11:59:51 UTC
fixed.
Comment 2 nicolò chieffo 2009-10-21 09:53:11 UTC
revision 144519

It still has too many newlines. Only 1 has been removed

namespace Test
{
### this line ###
	public class Refactor
	{
### this line ###
		public Refactor ()
		{
		}
	}
}
Comment 3 Mike Krueger 2009-10-22 07:13:52 UTC
My bugfix was reverted by Michael Hutchinson. 

@mhutch: what is with this bug ?
Comment 4 Michael Hutchinson 2009-10-22 15:22:26 UTC
@mkeruger: your fix broke the code generation for iPhone. I reverted it and then reapplied your fix and some fixes of my own as more granular patches with comments on exactly what had been changed.

I probably missed some of your fixes. It was hard to see what you'd changed in the imported code. Hopefully the comments and more granular changes will make it easier for others to understand.

Btw, what's the PrivateImplementationType fix? Should it be fixed in the original too?
Comment 5 Mike Krueger 2009-10-23 07:36:55 UTC
Ok, then I've just added the newline removal again. I thougt this broke something - but I thought the fix is safe.

Both things the PrivateImplementationType and the new lines should be fixed in the original. If we don't want to write a CodeDOM genarator that takes directly our output settings there is no need to deliver an own implementation.

I've already opened a bug for the PrivateImplementationType - because this generates non compiling code out of valid CodeDOM.

Bug 540051 - Bug in CSharpCodeGenerator.cs/PrivateImplementationType output

For the new lines I opened a new bug:

Bug 549472 - CodeDOM produces unwanted newlines in C# output

... I really hope that these two are fixed for the next mono version, because then we can just throw out our CodeDOM generator hack. (yes this is a hack!)
Comment 6 Michael Hutchinson 2009-10-24 01:05:49 UTC
Now there are not enough.

Code generated by stetic has the class on the same line as the namespace:

namespace MonoDevelop.IPhone.Gui {internal partial class IPhoneSigningKeyPanelWidget {
Comment 7 Mike Krueger 2009-10-26 06:54:28 UTC
fixed.
Comment 8 Michael Hutchinson 2009-10-26 18:33:05 UTC
FYI Geoff reverted the patches over the weekend because it was not inserting newlines at the end of code snippets, which broke the #pragma directives MonoTouch generates.
Comment 9 Lluis Sanchez 2009-12-09 17:38:28 UTC
Not yet fixed.
Comment 10 Mike Krueger 2010-04-09 05:28:38 UTC
It's a bug that should be fixed in mono:

https://bugzilla.novell.com/show_bug.cgi?id=549472

as well with:

https://bugzilla.novell.com/show_bug.cgi?id=540051

This is something like 10 minutes work (including booting the computer) for the people working on the codedom code.

*** This bug has been marked as a duplicate of bug 549472 ***