From 1911868ad25c9899274537be315fcde8fc820d04 Mon Sep 17 00:00:00 2001 From: mike Date: Fri, 25 May 2012 13:53:25 +0200 Subject: [PATCH] [NRefactory] Removed extra new line for fields. --- ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs | 2 -- .../CSharp/CodeActions/CreateFieldTests.cs | 4 ---- .../CSharp/CodeActions/IntroduceConstantTests.cs | 1 - 3 files changed, 7 deletions(-) diff --git a/ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs b/ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs index caf62c78f8..db7dba7edd 100644 --- a/ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs +++ b/ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs @@ -263,8 +263,6 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring node.AcceptVisitor (visitor); string text = stringWriter.ToString().TrimEnd(); - if (node is FieldDeclaration) - text += Options.EolMarker; return new NodeOutput(text, formatter.NewSegments); } diff --git a/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateFieldTests.cs b/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateFieldTests.cs index d705fb00c7..7c48571ca0 100644 --- a/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateFieldTests.cs +++ b/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateFieldTests.cs @@ -83,7 +83,6 @@ namespace ICSharpCode.NRefactory.CSharp.CodeActions "class TestClass" + Environment.NewLine + "{" + Environment.NewLine + " object foo;" + Environment.NewLine + - "" + Environment.NewLine + " void Test ()" + Environment.NewLine + " {" + Environment.NewLine + " Console.WriteLine (foo);" + Environment.NewLine + @@ -111,7 +110,6 @@ namespace ICSharpCode.NRefactory.CSharp.CodeActions "class TestClass" + Environment.NewLine + "{" + Environment.NewLine + " int foo;" + Environment.NewLine + - "" + Environment.NewLine + " void Test ()" + Environment.NewLine + " {" + Environment.NewLine + " foo = 0x10;" + Environment.NewLine + @@ -141,7 +139,6 @@ namespace ICSharpCode.NRefactory.CSharp.CodeActions "{" + Environment.NewLine + " void FooBar(out string par) {}" + Environment.NewLine + " string foo;" + Environment.NewLine + - "" + Environment.NewLine + " void Test ()" + Environment.NewLine + " {" + Environment.NewLine + " FooBar(out foo);" + Environment.NewLine + @@ -162,7 +159,6 @@ namespace ICSharpCode.NRefactory.CSharp.CodeActions }", @"static class TestClass { static int foo; - public TestClass () { foo = 5; diff --git a/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/IntroduceConstantTests.cs b/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/IntroduceConstantTests.cs index f555cd10b4..e1b601a8c2 100644 --- a/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/IntroduceConstantTests.cs +++ b/ICSharpCode.NRefactory.Tests/CSharp/CodeActions/IntroduceConstantTests.cs @@ -83,7 +83,6 @@ namespace ICSharpCode.NRefactory.CSharp.CodeActions }", @"class TestClass { const string HelloWorld = ""Hello World""; - public void Hello () { System.Console.WriteLine (HelloWorld);