Browse Source

[NRefactory] Removed extra new line for fields.

newNRvisualizers
mike 14 years ago
parent
commit
1911868ad2
  1. 2
      ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs
  2. 4
      ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateFieldTests.cs
  3. 1
      ICSharpCode.NRefactory.Tests/CSharp/CodeActions/IntroduceConstantTests.cs

2
ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs

@ -263,8 +263,6 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
node.AcceptVisitor (visitor); node.AcceptVisitor (visitor);
string text = stringWriter.ToString().TrimEnd(); string text = stringWriter.ToString().TrimEnd();
if (node is FieldDeclaration)
text += Options.EolMarker;
return new NodeOutput(text, formatter.NewSegments); return new NodeOutput(text, formatter.NewSegments);
} }

4
ICSharpCode.NRefactory.Tests/CSharp/CodeActions/CreateFieldTests.cs

@ -83,7 +83,6 @@ namespace ICSharpCode.NRefactory.CSharp.CodeActions
"class TestClass" + Environment.NewLine + "class TestClass" + Environment.NewLine +
"{" + Environment.NewLine + "{" + Environment.NewLine +
" object foo;" + Environment.NewLine + " object foo;" + Environment.NewLine +
"" + Environment.NewLine +
" void Test ()" + Environment.NewLine + " void Test ()" + Environment.NewLine +
" {" + Environment.NewLine + " {" + Environment.NewLine +
" Console.WriteLine (foo);" + Environment.NewLine + " Console.WriteLine (foo);" + Environment.NewLine +
@ -111,7 +110,6 @@ namespace ICSharpCode.NRefactory.CSharp.CodeActions
"class TestClass" + Environment.NewLine + "class TestClass" + Environment.NewLine +
"{" + Environment.NewLine + "{" + Environment.NewLine +
" int foo;" + Environment.NewLine + " int foo;" + Environment.NewLine +
"" + Environment.NewLine +
" void Test ()" + Environment.NewLine + " void Test ()" + Environment.NewLine +
" {" + Environment.NewLine + " {" + Environment.NewLine +
" foo = 0x10;" + Environment.NewLine + " foo = 0x10;" + Environment.NewLine +
@ -141,7 +139,6 @@ namespace ICSharpCode.NRefactory.CSharp.CodeActions
"{" + Environment.NewLine + "{" + Environment.NewLine +
" void FooBar(out string par) {}" + Environment.NewLine + " void FooBar(out string par) {}" + Environment.NewLine +
" string foo;" + Environment.NewLine + " string foo;" + Environment.NewLine +
"" + Environment.NewLine +
" void Test ()" + Environment.NewLine + " void Test ()" + Environment.NewLine +
" {" + Environment.NewLine + " {" + Environment.NewLine +
" FooBar(out foo);" + Environment.NewLine + " FooBar(out foo);" + Environment.NewLine +
@ -162,7 +159,6 @@ namespace ICSharpCode.NRefactory.CSharp.CodeActions
}", @"static class TestClass }", @"static class TestClass
{ {
static int foo; static int foo;
public TestClass () public TestClass ()
{ {
foo = 5; foo = 5;

1
ICSharpCode.NRefactory.Tests/CSharp/CodeActions/IntroduceConstantTests.cs

@ -83,7 +83,6 @@ namespace ICSharpCode.NRefactory.CSharp.CodeActions
}", @"class TestClass }", @"class TestClass
{ {
const string HelloWorld = ""Hello World""; const string HelloWorld = ""Hello World"";
public void Hello () public void Hello ()
{ {
System.Console.WriteLine (HelloWorld); System.Console.WriteLine (HelloWorld);

Loading…
Cancel
Save