Browse Source

Renamed CSharpFormattingPolicy to CSharpFormattingOptions.

newNRvisualizers
Mike Krüger 15 years ago
parent
commit
16715bb854
  1. 4
      ICSharpCode.NRefactory.Demo/MainForm.cs
  2. 4
      ICSharpCode.NRefactory.Tests/CSharp/InsertParenthesesVisitorTests.cs
  3. 4
      ICSharpCode.NRefactory.Tests/CSharp/Parser/ParseUtil.cs
  4. 14
      ICSharpCode.NRefactory.Tests/FormattingTests/TestBlankLineFormatting.cs
  5. 32
      ICSharpCode.NRefactory.Tests/FormattingTests/TestBraceStlye.cs
  6. 16
      ICSharpCode.NRefactory.Tests/FormattingTests/TestFormattingBugs.cs
  7. 168
      ICSharpCode.NRefactory.Tests/FormattingTests/TestSpacingVisitor.cs
  8. 120
      ICSharpCode.NRefactory.Tests/FormattingTests/TestStatementIndentation.cs
  9. 40
      ICSharpCode.NRefactory.Tests/FormattingTests/TestTypeLevelIndentation.cs
  10. 6
      ICSharpCode.NRefactory.Tests/FormattingTests/TextEditorTestAdapter.cs
  11. 2
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/Expression.cs
  12. 4
      ICSharpCode.NRefactory/CSharp/Ast/PatternMatching/Pattern.cs
  13. 2
      ICSharpCode.NRefactory/CSharp/Ast/Statements/Statement.cs
  14. 4
      ICSharpCode.NRefactory/CSharp/Formatter/AstFormattingVisitor.cs
  15. 24
      ICSharpCode.NRefactory/CSharp/Formatter/CSharpFormattingOptions.cs
  16. 6
      ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs
  17. 4
      ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj

4
ICSharpCode.NRefactory.Demo/MainForm.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
@ -126,7 +126,7 @@ namespace ICSharpCode.NRefactory.Demo @@ -126,7 +126,7 @@ namespace ICSharpCode.NRefactory.Demo
void CSharpGenerateCodeButtonClick(object sender, EventArgs e)
{
StringWriter w = new StringWriter();
OutputVisitor output = new OutputVisitor(w, new CSharpFormattingPolicy());
OutputVisitor output = new OutputVisitor(w, new CSharpFormattingOptions());
compilationUnit.AcceptVisitor(output, null);
csharpCodeTextBox.Text = w.ToString();
}

4
ICSharpCode.NRefactory.Tests/CSharp/InsertParenthesesVisitorTests.cs

@ -10,12 +10,12 @@ namespace ICSharpCode.NRefactory.CSharp @@ -10,12 +10,12 @@ namespace ICSharpCode.NRefactory.CSharp
[TestFixture]
public class InsertParenthesesVisitorTests
{
CSharpFormattingPolicy policy;
CSharpFormattingOptions policy;
[SetUp]
public void SetUp()
{
policy = new CSharpFormattingPolicy();
policy = new CSharpFormattingOptions();
}
string InsertReadable(Expression expr)

4
ICSharpCode.NRefactory.Tests/CSharp/Parser/ParseUtil.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2010 AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// Copyright (c) 2010 AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
@ -100,7 +100,7 @@ namespace ICSharpCode.NRefactory.CSharp.Parser @@ -100,7 +100,7 @@ namespace ICSharpCode.NRefactory.CSharp.Parser
static string ToCSharp(AstNode node)
{
StringWriter w = new StringWriter();
node.AcceptVisitor(new OutputVisitor(w, new CSharpFormattingPolicy()), null);
node.AcceptVisitor(new OutputVisitor(w, new CSharpFormattingOptions()), null);
return w.ToString();
}
}

14
ICSharpCode.NRefactory.Tests/FormattingTests/TestBlankLineFormatting.cs

@ -37,7 +37,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -37,7 +37,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestBlankLinesAfterUsings ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.BlankLinesAfterUsings = 2;
var adapter = Test (policy, @"using System;
@ -65,7 +65,7 @@ namespace Test @@ -65,7 +65,7 @@ namespace Test
[Test()]
public void TestBlankLinesBeforeUsings ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.BlankLinesAfterUsings = 0;
policy.BlankLinesBeforeUsings = 2;
@ -94,7 +94,7 @@ namespace Test @@ -94,7 +94,7 @@ namespace Test
[Test()]
public void TestBlankLinesBeforeFirstDeclaration ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.BlankLinesBeforeFirstDeclaration = 2;
var adapter = Test (policy, @"namespace Test
@ -125,7 +125,7 @@ namespace Test @@ -125,7 +125,7 @@ namespace Test
[Test()]
public void TestBlankLinesBetweenTypes ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.BlankLinesBetweenTypes = 1;
var adapter = Test (policy, @"namespace Test
@ -173,7 +173,7 @@ namespace Test @@ -173,7 +173,7 @@ namespace Test
[Test()]
public void TestBlankLinesBetweenFields ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.BlankLinesBetweenFields = 1;
var adapter = Test (policy, @"class Test
@ -203,7 +203,7 @@ namespace Test @@ -203,7 +203,7 @@ namespace Test
[Test()]
public void TestBlankLinesBetweenEventFields ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.BlankLinesBetweenEventFields = 1;
var adapter = Test (policy, @"class Test
@ -234,7 +234,7 @@ namespace Test @@ -234,7 +234,7 @@ namespace Test
[Test()]
public void TestBlankLinesBetweenMembers ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.BlankLinesBetweenMembers = 1;
var adapter = Test (policy,@"class Test

32
ICSharpCode.NRefactory.Tests/FormattingTests/TestBraceStlye.cs

@ -37,7 +37,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -37,7 +37,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestNamespaceBraceStyle ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.NamespaceBraceStyle = BraceStyle.EndOfLine;
policy.ClassBraceStyle = BraceStyle.DoNotChange;
@ -67,7 +67,7 @@ namespace B { @@ -67,7 +67,7 @@ namespace B {
[Test()]
public void TestClassBraceStlye ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy,
@ -79,7 +79,7 @@ namespace B { @@ -79,7 +79,7 @@ namespace B {
[Test()]
public void TestStructBraceStyle ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StructBraceStyle = BraceStyle.NextLine;
Test (policy,
@ -92,7 +92,7 @@ namespace B { @@ -92,7 +92,7 @@ namespace B {
[Test()]
public void TestInterfaceBraceStyle ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.InterfaceBraceStyle = BraceStyle.NextLine;
Test (policy,
@ -105,7 +105,7 @@ namespace B { @@ -105,7 +105,7 @@ namespace B {
[Test()]
public void TestEnumBraceStyle ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.EnumBraceStyle = BraceStyle.NextLineShifted;
Test (policy, @"enum Test {
@ -120,7 +120,7 @@ namespace B { @@ -120,7 +120,7 @@ namespace B {
[Test()]
public void TestMethodBraceStlye ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.MethodBraceStyle = BraceStyle.NextLine;
Test (policy, @"class Test
@ -138,7 +138,7 @@ namespace B { @@ -138,7 +138,7 @@ namespace B {
[Test()]
public void TestConstructorBraceStyle ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ConstructorBraceStyle = BraceStyle.NextLine;
Test (policy, @"class Test
@ -156,7 +156,7 @@ namespace B { @@ -156,7 +156,7 @@ namespace B {
[Test()]
public void TestDestructorBraceStyle ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.DestructorBraceStyle = BraceStyle.NextLine;
Test (policy, @"class Test
@ -174,7 +174,7 @@ namespace B { @@ -174,7 +174,7 @@ namespace B {
[Test()]
public void TestPropertyBraceStyle ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PropertyBraceStyle = BraceStyle.NextLine;
Test (policy, @"class Test
@ -197,7 +197,7 @@ namespace B { @@ -197,7 +197,7 @@ namespace B {
[Test()]
public void TestPropertyGetBraceStyle ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PropertyGetBraceStyle = BraceStyle.NextLine;
Test (policy, @"class Test
@ -225,7 +225,7 @@ namespace B { @@ -225,7 +225,7 @@ namespace B {
public void TestAllowPropertyGetBlockInline ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PropertyBraceStyle = BraceStyle.DoNotChange;
policy.AllowPropertyGetBlockInline = true;
policy.AllowPropertySetBlockInline = false;
@ -265,7 +265,7 @@ namespace B { @@ -265,7 +265,7 @@ namespace B {
[Test()]
public void TestAllowPropertySetBlockInline ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PropertyBraceStyle = BraceStyle.DoNotChange;
policy.AllowPropertyGetBlockInline = false;
policy.AllowPropertySetBlockInline = true;
@ -305,7 +305,7 @@ namespace B { @@ -305,7 +305,7 @@ namespace B {
[Test()]
public void TestPropertySetBraceStyle ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PropertySetBraceStyle = BraceStyle.NextLine;
Test (policy, @"class Test
@ -332,7 +332,7 @@ namespace B { @@ -332,7 +332,7 @@ namespace B {
[Test()]
public void TestEventBraceStyle ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.EventBraceStyle = BraceStyle.NextLine;
policy.EventAddBraceStyle = BraceStyle.NextLine;
policy.EventRemoveBraceStyle = BraceStyle.NextLine;
@ -363,7 +363,7 @@ namespace B { @@ -363,7 +363,7 @@ namespace B {
[Test()]
public void TestAllowEventAddBlockInline ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.AllowEventAddBlockInline = true;
policy.AllowEventRemoveBlockInline = false;
@ -388,7 +388,7 @@ namespace B { @@ -388,7 +388,7 @@ namespace B {
[Test()]
public void TestAllowEventRemoveBlockInline ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.AllowEventAddBlockInline = false;
policy.AllowEventRemoveBlockInline = true;

16
ICSharpCode.NRefactory.Tests/FormattingTests/TestFormattingBugs.cs

@ -40,7 +40,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -40,7 +40,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestBug325187 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PlaceElseOnNewLine = true;
TestStatementFormatting (policy,
@ -62,7 +62,7 @@ Console.WriteLine (""Bad indent"");", @@ -62,7 +62,7 @@ Console.WriteLine (""Bad indent"");",
[Test()]
public void TestBug415469 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
TestStatementFormatting (policy,
@"switch (condition) {
@ -86,7 +86,7 @@ case CONDITION2: @@ -86,7 +86,7 @@ case CONDITION2:
[Test()]
public void TestBug540043 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
TestStatementFormatting (policy,
@"using (IDisposable a = null)
@ -105,7 +105,7 @@ using (IDisposable b = null) { @@ -105,7 +105,7 @@ using (IDisposable b = null) {
[Test()]
public void TestBug655635 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
TestStatementFormatting (policy,
@"try {
@ -121,7 +121,7 @@ using (IDisposable b = null) { @@ -121,7 +121,7 @@ using (IDisposable b = null) {
}");
}
void TestStatementFormatting (CSharpFormattingPolicy policy, string input, string expectedOutput)
void TestStatementFormatting (CSharpFormattingOptions policy, string input, string expectedOutput)
{
var result = GetResult (policy, @"class Test
{
@ -143,7 +143,7 @@ using (IDisposable b = null) { @@ -143,7 +143,7 @@ using (IDisposable b = null) {
[Test()]
public void TestBug659675 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
TestStatementFormatting (policy, "@string=@int;", "@string = @int;");
}
@ -153,7 +153,7 @@ using (IDisposable b = null) { @@ -153,7 +153,7 @@ using (IDisposable b = null) {
[Test()]
public void TestBug670213 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.MethodBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test
@ -176,7 +176,7 @@ using (IDisposable b = null) { @@ -176,7 +176,7 @@ using (IDisposable b = null) {
[Test()]
public void TestBug677261 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ConstructorBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test

168
ICSharpCode.NRefactory.Tests/FormattingTests/TestSpacingVisitor.cs

@ -37,7 +37,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -37,7 +37,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestFieldSpacesBeforeComma1 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
policy.SpaceBeforeFieldDeclarationComma = false;
policy.SpaceAfterFieldDeclarationComma = false;
@ -53,7 +53,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -53,7 +53,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestFieldSpacesBeforeComma2 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
policy.SpaceBeforeFieldDeclarationComma = true;
policy.SpaceAfterFieldDeclarationComma = true;
@ -69,7 +69,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -69,7 +69,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestFixedFieldSpacesBeforeComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
policy.SpaceAfterFieldDeclarationComma = true;
policy.SpaceBeforeFieldDeclarationComma = true;
@ -85,7 +85,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -85,7 +85,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestConstFieldSpacesBeforeComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
policy.SpaceAfterFieldDeclarationComma = false;
policy.SpaceBeforeFieldDeclarationComma = false;
@ -101,7 +101,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -101,7 +101,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestBeforeMethodDeclarationParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeMethodDeclarationParentheses = true;
Test (policy, @"public abstract class Test
@ -117,7 +117,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -117,7 +117,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestBeforeConstructorDeclarationParenthesesDestructorCase ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeConstructorDeclarationParentheses = true;
Test (policy, @"class Test
@ -134,7 +134,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -134,7 +134,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
}");
}
static void TestBinaryOperator (CSharpFormattingPolicy policy, string op)
static void TestBinaryOperator (CSharpFormattingOptions policy, string op)
{
var result = GetResult (policy, "class Test { void TestMe () { result = left" + op + "right; } }");
@ -148,7 +148,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -148,7 +148,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestSpacesAroundMultiplicativeOperator ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceAroundMultiplicativeOperator = true;
TestBinaryOperator (policy, "*");
@ -158,7 +158,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -158,7 +158,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestSpacesAroundShiftOperator ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceAroundShiftOperator = true;
TestBinaryOperator (policy, "<<");
TestBinaryOperator (policy, ">>");
@ -167,7 +167,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -167,7 +167,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestSpacesAroundAdditiveOperator ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceAroundAdditiveOperator = true;
TestBinaryOperator (policy, "+");
@ -177,7 +177,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -177,7 +177,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestSpacesAroundBitwiseOperator ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceAroundBitwiseOperator = true;
TestBinaryOperator (policy, "&");
@ -188,7 +188,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -188,7 +188,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestSpacesAroundRelationalOperator ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceAroundRelationalOperator = true;
TestBinaryOperator (policy, "<");
@ -200,7 +200,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -200,7 +200,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestSpacesAroundEqualityOperator ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceAroundEqualityOperator = true;
TestBinaryOperator (policy, "==");
@ -210,7 +210,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -210,7 +210,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestSpacesAroundLogicalOperator ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceAroundLogicalOperator = true;
TestBinaryOperator (policy, "&&");
@ -220,7 +220,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -220,7 +220,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestConditionalOperator ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeConditionalOperatorCondition = true;
policy.SpaceAfterConditionalOperatorCondition = true;
policy.SpaceBeforeConditionalOperatorSeparator = true;
@ -256,7 +256,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -256,7 +256,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestBeforeMethodCallParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeMethodCallParentheses = true;
var result = GetResult (policy, @"class Test {
@ -288,7 +288,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -288,7 +288,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestWithinMethodCallParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceWithinMethodCallParentheses = true;
var result = GetResult (policy, @"class Test {
@ -318,7 +318,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -318,7 +318,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestBeforeIfParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeIfParentheses = true;
var result = GetResult (policy, @"class Test {
@ -335,7 +335,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -335,7 +335,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestWithinIfParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinIfParentheses = true;
var result = GetResult (policy, @"class Test {
@ -352,7 +352,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -352,7 +352,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestBeforeWhileParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeWhileParentheses = true;
var result = GetResult (policy, @"class Test {
@ -369,7 +369,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -369,7 +369,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestWithinWhileParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinWhileParentheses = true;
var result = GetResult (policy, @"class Test {
@ -387,7 +387,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -387,7 +387,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestBeforeForParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeForParentheses = true;
var result = GetResult (policy, @"class Test {
@ -404,7 +404,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -404,7 +404,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestWithinForParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinForParentheses = true;
var result = GetResult (policy, @"class Test {
@ -421,7 +421,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -421,7 +421,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestBeforeForeachParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeForeachParentheses = true;
var result = GetResult (policy, @"class Test {
@ -438,7 +438,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -438,7 +438,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestWithinForeachParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinForeachParentheses = true;
var result = GetResult (policy, @"class Test {
@ -455,7 +455,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -455,7 +455,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestBeforeCatchParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeCatchParentheses = true;
var result = GetResult (policy, @"class Test {
@ -472,7 +472,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -472,7 +472,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestWithinCatchParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinCatchParentheses = true;
var result = GetResult (policy, @"class Test {
@ -489,7 +489,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -489,7 +489,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestBeforeLockParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeLockParentheses = true;
var result = GetResult (policy, @"class Test {
@ -506,7 +506,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -506,7 +506,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestWithinLockParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinLockParentheses = true;
var result = GetResult (policy, @"class Test {
@ -523,7 +523,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -523,7 +523,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestSpacesAfterForSemicolon ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceAfterForSemicolon = true;
var result = GetResult (policy, @"class Test {
@ -541,7 +541,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -541,7 +541,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestSpacesBeforeForSemicolon ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeForSemicolon = true;
policy.SpaceAfterForSemicolon = false;
@ -560,7 +560,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -560,7 +560,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestSpacesAfterTypecast ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceAfterTypecast = true;
var result = GetResult (policy, @"class Test {
@ -578,7 +578,7 @@ return (Test)null; @@ -578,7 +578,7 @@ return (Test)null;
[Test()]
public void TestBeforeUsingParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeUsingParentheses = true;
var result = GetResult (policy, @"class Test {
@ -595,7 +595,7 @@ return (Test)null; @@ -595,7 +595,7 @@ return (Test)null;
[Test()]
public void TestWithinUsingParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinUsingParentheses = true;
var result = GetResult (policy, @"class Test {
@ -609,7 +609,7 @@ return (Test)null; @@ -609,7 +609,7 @@ return (Test)null;
Assert.AreEqual (@"( a )", result.GetTextAt (i1, i2 - i1));
}
static void TestAssignmentOperator (CSharpFormattingPolicy policy, string op)
static void TestAssignmentOperator (CSharpFormattingOptions policy, string op)
{
var result = GetResult (policy, "class Test { void TestMe () { left" + op + "right; } }");
@ -623,7 +623,7 @@ return (Test)null; @@ -623,7 +623,7 @@ return (Test)null;
[Test()]
public void TestAroundAssignmentSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceAroundAssignment = true;
TestAssignmentOperator (policy, "=");
@ -642,7 +642,7 @@ return (Test)null; @@ -642,7 +642,7 @@ return (Test)null;
[Test()]
public void TestAroundAssignmentSpaceInDeclarations ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceAroundAssignment = true;
var result = GetResult (policy, @"class Test {
void TestMe ()
@ -659,7 +659,7 @@ return (Test)null; @@ -659,7 +659,7 @@ return (Test)null;
[Test()]
public void TestBeforeSwitchParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeSwitchParentheses = true;
var result = GetResult (policy, @"class Test {
@ -676,7 +676,7 @@ return (Test)null; @@ -676,7 +676,7 @@ return (Test)null;
[Test()]
public void TestWithinSwitchParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinSwitchParentheses = true;
var result = GetResult (policy, @"class Test {
@ -693,7 +693,7 @@ return (Test)null; @@ -693,7 +693,7 @@ return (Test)null;
[Test()]
public void TestWithinParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinParentheses = true;
var result = GetResult (policy, @"class Test {
@ -710,7 +710,7 @@ return (Test)null; @@ -710,7 +710,7 @@ return (Test)null;
[Test()]
public void TestWithinMethodDeclarationParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceWithinMethodDeclarationParentheses = true;
var result = GetResult (policy, @"class Test {
@ -726,7 +726,7 @@ return (Test)null; @@ -726,7 +726,7 @@ return (Test)null;
[Test()]
public void TestWithinCastParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinCastParentheses = true;
var result = GetResult (policy, @"class Test {
@ -743,7 +743,7 @@ return (Test)null; @@ -743,7 +743,7 @@ return (Test)null;
[Test()]
public void TestWithinSizeOfParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinSizeOfParentheses = true;
var result = GetResult (policy, @"class Test {
@ -760,7 +760,7 @@ return (Test)null; @@ -760,7 +760,7 @@ return (Test)null;
[Test()]
public void TestBeforeSizeOfParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeSizeOfParentheses = true;
var result = GetResult (policy, @"class Test {
@ -777,7 +777,7 @@ return (Test)null; @@ -777,7 +777,7 @@ return (Test)null;
[Test()]
public void TestWithinTypeOfParenthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinTypeOfParentheses = true;
var result = GetResult (policy, @"class Test {
@ -794,7 +794,7 @@ return (Test)null; @@ -794,7 +794,7 @@ return (Test)null;
[Test()]
public void TestBeforeTypeOfParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeTypeOfParentheses = true;
var result = GetResult (policy, @"class Test {
@ -812,7 +812,7 @@ return (Test)null; @@ -812,7 +812,7 @@ return (Test)null;
[Test()]
public void TestWithinCheckedExpressionParanthesesSpace ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinCheckedExpressionParantheses = true;
var result = GetResult (policy, @"class Test {
@ -841,7 +841,7 @@ return (Test)null; @@ -841,7 +841,7 @@ return (Test)null;
[Test()]
public void TestSpaceBeforeNewParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeNewParentheses = true;
var result = GetResult (policy, @"class Test {
@ -858,7 +858,7 @@ return (Test)null; @@ -858,7 +858,7 @@ return (Test)null;
[Test()]
public void TestWithinNewParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinNewParentheses = true;
var result = GetResult (policy, @"class Test {
@ -875,7 +875,7 @@ return (Test)null; @@ -875,7 +875,7 @@ return (Test)null;
[Test()]
public void TestBetweenEmptyNewParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesBetweenEmptyNewParentheses = true;
var result = GetResult (policy, @"class Test {
@ -892,7 +892,7 @@ return (Test)null; @@ -892,7 +892,7 @@ return (Test)null;
[Test()]
public void TestBeforeNewParameterComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeNewParameterComma = true;
policy.SpaceAfterNewParameterComma = false;
@ -910,7 +910,7 @@ return (Test)null; @@ -910,7 +910,7 @@ return (Test)null;
[Test()]
public void TestAfterNewParameterComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceAfterNewParameterComma = true;
var result = GetResult (policy, @"class Test {
@ -927,7 +927,7 @@ return (Test)null; @@ -927,7 +927,7 @@ return (Test)null;
[Test()]
public void TestFieldDeclarationComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeFieldDeclarationComma = false;
policy.SpaceAfterFieldDeclarationComma = true;
@ -955,7 +955,7 @@ return (Test)null; @@ -955,7 +955,7 @@ return (Test)null;
[Test()]
public void TestBeforeMethodDeclarationParameterComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeMethodDeclarationParameterComma = true;
policy.SpaceAfterMethodDeclarationParameterComma = false;
@ -976,7 +976,7 @@ return (Test)null; @@ -976,7 +976,7 @@ return (Test)null;
[Test()]
public void TestAfterMethodDeclarationParameterComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeMethodDeclarationParameterComma = false;
policy.SpaceAfterMethodDeclarationParameterComma = true;
@ -997,7 +997,7 @@ return (Test)null; @@ -997,7 +997,7 @@ return (Test)null;
[Test()]
public void TestSpacesInLambdaExpression ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinWhileParentheses = true;
var result = GetResult (policy, @"class Test {
@ -1014,7 +1014,7 @@ return (Test)null; @@ -1014,7 +1014,7 @@ return (Test)null;
[Test()]
public void TestBeforeLocalVariableDeclarationComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeLocalVariableDeclarationComma = true;
policy.SpaceAfterLocalVariableDeclarationComma = false;
@ -1041,7 +1041,7 @@ return (Test)null; @@ -1041,7 +1041,7 @@ return (Test)null;
[Test()]
public void TestLocalVariableDeclarationComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeLocalVariableDeclarationComma = true;
policy.SpaceAfterLocalVariableDeclarationComma = true;
@ -1071,7 +1071,7 @@ return (Test)null; @@ -1071,7 +1071,7 @@ return (Test)null;
[Test()]
public void TestBeforeConstructorDeclarationParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeConstructorDeclarationParentheses = true;
var result = GetResult (policy, @"class Test
@ -1092,7 +1092,7 @@ return (Test)null; @@ -1092,7 +1092,7 @@ return (Test)null;
[Test()]
public void TestBeforeConstructorDeclarationParameterComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeConstructorDeclarationParameterComma = true;
policy.SpaceAfterConstructorDeclarationParameterComma = false;
@ -1115,7 +1115,7 @@ return (Test)null; @@ -1115,7 +1115,7 @@ return (Test)null;
[Test()]
public void TestAfterConstructorDeclarationParameterComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeConstructorDeclarationParameterComma = false;
policy.SpaceAfterConstructorDeclarationParameterComma = true;
@ -1136,7 +1136,7 @@ return (Test)null; @@ -1136,7 +1136,7 @@ return (Test)null;
[Test()]
public void TestWithinConstructorDeclarationParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceWithinConstructorDeclarationParentheses = true;
var result = GetResult (policy, @"class Test {
@ -1152,7 +1152,7 @@ return (Test)null; @@ -1152,7 +1152,7 @@ return (Test)null;
[Test()]
public void TestBetweenEmptyConstructorDeclarationParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBetweenEmptyConstructorDeclarationParentheses = true;
var result = GetResult (policy, @"class Test {
@ -1171,7 +1171,7 @@ return (Test)null; @@ -1171,7 +1171,7 @@ return (Test)null;
[Test()]
public void TestBeforeDelegateDeclarationParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeDelegateDeclarationParentheses = true;
var result = GetResult (policy, @"delegate void Test();");
@ -1182,7 +1182,7 @@ return (Test)null; @@ -1182,7 +1182,7 @@ return (Test)null;
[Test()]
public void TestBeforeDelegateDeclarationParenthesesComplex ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeDelegateDeclarationParentheses = true;
var result = GetResult (policy, "delegate void TestDelegate\t\t\t();");
@ -1193,7 +1193,7 @@ return (Test)null; @@ -1193,7 +1193,7 @@ return (Test)null;
[Test()]
public void TestBeforeDelegateDeclarationParameterComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeDelegateDeclarationParameterComma = true;
policy.SpaceAfterDelegateDeclarationParameterComma = false;
@ -1213,7 +1213,7 @@ return (Test)null; @@ -1213,7 +1213,7 @@ return (Test)null;
[Test()]
public void TestAfterDelegateDeclarationParameterComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeDelegateDeclarationParameterComma = false;
policy.SpaceAfterDelegateDeclarationParameterComma = true;
@ -1233,7 +1233,7 @@ return (Test)null; @@ -1233,7 +1233,7 @@ return (Test)null;
[Test()]
public void TestWithinDelegateDeclarationParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceWithinDelegateDeclarationParentheses = true;
var result = GetResult (policy, @"delegate void Test (int a);");
@ -1245,7 +1245,7 @@ return (Test)null; @@ -1245,7 +1245,7 @@ return (Test)null;
[Test()]
public void TestBetweenEmptyDelegateDeclarationParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBetweenEmptyDelegateDeclarationParentheses = true;
var result = GetResult (policy, @"delegate void Test();");
@ -1260,7 +1260,7 @@ return (Test)null; @@ -1260,7 +1260,7 @@ return (Test)null;
[Test()]
public void TestBeforeMethodCallParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeMethodCallParentheses = true;
var result = GetResult (policy, @"class FooBar
@ -1283,7 +1283,7 @@ return (Test)null; @@ -1283,7 +1283,7 @@ return (Test)null;
[Test()]
public void TestBeforeMethodCallParameterComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeMethodCallParameterComma = true;
policy.SpaceAfterMethodCallParameterComma = false;
@ -1308,7 +1308,7 @@ return (Test)null; @@ -1308,7 +1308,7 @@ return (Test)null;
[Test()]
public void TestAfterMethodCallParameterComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeMethodCallParameterComma = false;
policy.SpaceAfterMethodCallParameterComma = true;
@ -1333,7 +1333,7 @@ return (Test)null; @@ -1333,7 +1333,7 @@ return (Test)null;
[Test()]
public void TestWithinMethodCallParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceWithinMethodCallParentheses = true;
var result = GetResult (policy, @"class FooBar
@ -1351,7 +1351,7 @@ return (Test)null; @@ -1351,7 +1351,7 @@ return (Test)null;
[Test()]
public void TestBetweenEmptyMethodCallParentheses ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBetweenEmptyMethodCallParentheses = true;
var result = GetResult (policy, @"class FooBar
@ -1373,7 +1373,7 @@ return (Test)null; @@ -1373,7 +1373,7 @@ return (Test)null;
public void TestBeforeIndexerDeclarationBracket ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeIndexerDeclarationBracket = true;
var result = GetResult (policy, @"class FooBar
@ -1397,7 +1397,7 @@ return (Test)null; @@ -1397,7 +1397,7 @@ return (Test)null;
[Test()]
public void TestBeforeIndexerDeclarationParameterComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeIndexerDeclarationParameterComma = true;
policy.SpaceAfterIndexerDeclarationParameterComma = false;
@ -1418,7 +1418,7 @@ return (Test)null; @@ -1418,7 +1418,7 @@ return (Test)null;
[Test()]
public void TestAfterIndexerDeclarationParameterComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceAfterIndexerDeclarationParameterComma = true;
var result = GetResult (policy, @"class FooBar
@ -1437,7 +1437,7 @@ return (Test)null; @@ -1437,7 +1437,7 @@ return (Test)null;
[Test()]
public void TestWithinIndexerDeclarationBracket ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceWithinIndexerDeclarationBracket = true;
var result = GetResult (policy, @"class FooBar
@ -1460,7 +1460,7 @@ return (Test)null; @@ -1460,7 +1460,7 @@ return (Test)null;
[Test()]
public void TestSpacesWithinBrackets ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesWithinBrackets = true;
policy.SpacesBeforeBrackets = false;
@ -1484,7 +1484,7 @@ return (Test)null; @@ -1484,7 +1484,7 @@ return (Test)null;
[Test()]
public void TestSpacesBeforeBrackets ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpacesBeforeBrackets = true;
var result = GetResult (policy, @"class Test
@ -1508,7 +1508,7 @@ return (Test)null; @@ -1508,7 +1508,7 @@ return (Test)null;
[Test()]
public void TestBeforeBracketComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeBracketComma = true;
policy.SpaceAfterBracketComma = false;
@ -1527,7 +1527,7 @@ return (Test)null; @@ -1527,7 +1527,7 @@ return (Test)null;
[Test()]
public void TestAfterBracketComma ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceAfterBracketComma = true;
var result = GetResult (policy, @"class Test {
@ -1547,7 +1547,7 @@ return (Test)null; @@ -1547,7 +1547,7 @@ return (Test)null;
[Test()]
public void TestSpacesBeforeArrayDeclarationBrackets ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.SpaceBeforeArrayDeclarationBrackets = true;
var result = GetResult (policy, @"class Test {
@ -1567,7 +1567,7 @@ return (Test)null; @@ -1567,7 +1567,7 @@ return (Test)null;
[Test()]
public void TestRemoveWhitespacesBeforeSemicolon ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
var result = GetResult (policy, @"class Test {
void TestMe ()
{

120
ICSharpCode.NRefactory.Tests/FormattingTests/TestStatementIndentation.cs

@ -37,7 +37,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -37,7 +37,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestInvocationIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy,
@ -58,7 +58,7 @@ this.TestMethod (); @@ -58,7 +58,7 @@ this.TestMethod ();
[Test()]
public void TestIndentBlocks ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.IndentBlocks = true;
var adapter = Test (policy,
@ -94,7 +94,7 @@ this.TestMethod (); @@ -94,7 +94,7 @@ this.TestMethod ();
[Test()]
public void TestBreakIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy,
@ -115,7 +115,7 @@ this.TestMethod (); @@ -115,7 +115,7 @@ this.TestMethod ();
[Test()]
public void TestCheckedIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
@ -137,7 +137,7 @@ checked { @@ -137,7 +137,7 @@ checked {
[Test()]
public void TestBaseIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test {
@ -156,7 +156,7 @@ checked { @@ -156,7 +156,7 @@ checked {
[Test()]
public void TestUncheckedIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test {
@ -178,7 +178,7 @@ unchecked { @@ -178,7 +178,7 @@ unchecked {
[Test()]
public void TestContinueIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test {
@ -198,7 +198,7 @@ continue; @@ -198,7 +198,7 @@ continue;
[Test()]
public void TestEmptyStatementIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test {
@ -217,7 +217,7 @@ continue; @@ -217,7 +217,7 @@ continue;
[Test()]
public void TestFixedStatementIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test {
@ -239,7 +239,7 @@ fixed (object* obj = &obj) @@ -239,7 +239,7 @@ fixed (object* obj = &obj)
[Test()]
public void TestFixedForcementAdd ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
policy.FixedBraceForcement = BraceForcement.AddBraces;
@ -269,7 +269,7 @@ fixed (object* obj = &obj) @@ -269,7 +269,7 @@ fixed (object* obj = &obj)
[Test()]
public void TestForeachIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test
@ -292,7 +292,7 @@ foreach (var obj in col) { @@ -292,7 +292,7 @@ foreach (var obj in col) {
[Test()]
public void TestForIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
@ -314,7 +314,7 @@ for (;;) { @@ -314,7 +314,7 @@ for (;;) {
[Test()]
public void TestGotoIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test {
@ -334,7 +334,7 @@ goto label; @@ -334,7 +334,7 @@ goto label;
[Test()]
public void TestReturnIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test {
@ -354,7 +354,7 @@ return; @@ -354,7 +354,7 @@ return;
[Test()]
public void TestLockIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test {
@ -376,7 +376,7 @@ lock (this) { @@ -376,7 +376,7 @@ lock (this) {
[Test()]
public void TestThrowIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
@ -397,7 +397,7 @@ throw new NotSupportedException (); @@ -397,7 +397,7 @@ throw new NotSupportedException ();
[Test()]
public void TestUnsafeIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
@ -420,7 +420,7 @@ unsafe { @@ -420,7 +420,7 @@ unsafe {
[Test()]
public void TestUsingIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
@ -442,7 +442,7 @@ using (var o = new MyObj()) { @@ -442,7 +442,7 @@ using (var o = new MyObj()) {
[Test()]
public void TestUsingForcementAdd ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
policy.UsingBraceForcement = BraceForcement.AddBraces;
@ -472,7 +472,7 @@ using (var o = new MyObj()) { @@ -472,7 +472,7 @@ using (var o = new MyObj()) {
[Test()]
public void TestUsingForcementDoNotChange ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
policy.UsingBraceForcement = BraceForcement.DoNotChange;
@ -501,7 +501,7 @@ using (var o = new MyObj()) { @@ -501,7 +501,7 @@ using (var o = new MyObj()) {
[Test()]
public void TestUsingAlignment ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.AlignEmbeddedUsingStatements = true;
policy.ClassBraceStyle = BraceStyle.EndOfLine;
@ -535,7 +535,7 @@ using (var o = new MyObj()) { @@ -535,7 +535,7 @@ using (var o = new MyObj()) {
[Test()]
public void TestVariableDeclarationIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test {
@ -555,7 +555,7 @@ Test a; @@ -555,7 +555,7 @@ Test a;
[Test()]
public void TestConstantVariableDeclarationIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test {
@ -575,7 +575,7 @@ const int a = 5; @@ -575,7 +575,7 @@ const int a = 5;
[Test()]
public void TestYieldIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test {
@ -595,7 +595,7 @@ yield return null; @@ -595,7 +595,7 @@ yield return null;
[Test()]
public void TestWhileIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
@ -618,7 +618,7 @@ while (true) @@ -618,7 +618,7 @@ while (true)
[Test()]
public void TestDoWhileIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test {
@ -640,7 +640,7 @@ do { @@ -640,7 +640,7 @@ do {
[Test()]
public void TestForeachBracketPlacement ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
Test (policy, @"class Test
@ -663,7 +663,7 @@ do { @@ -663,7 +663,7 @@ do {
[Test()]
public void TestForeachBracketPlacement2 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.NextLineShifted2;
Test (policy, @"class Test
@ -688,7 +688,7 @@ do { @@ -688,7 +688,7 @@ do {
[Test()]
public void TestForEachBraceForcementAdd ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.NextLine;
policy.ForEachBraceForcement = BraceForcement.AddBraces;
@ -720,7 +720,7 @@ do { @@ -720,7 +720,7 @@ do {
[Test()]
public void TestForBraceForcementAdd ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.NextLine;
policy.ForBraceForcement = BraceForcement.AddBraces;
@ -753,7 +753,7 @@ do { @@ -753,7 +753,7 @@ do {
[Test()]
public void TestForEachBraceForcementRemove ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.NextLine;
policy.ForEachBraceForcement = BraceForcement.RemoveBraces;
@ -790,7 +790,7 @@ do { @@ -790,7 +790,7 @@ do {
[Test()]
public void TestIfBracketPlacement ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
@ -814,7 +814,7 @@ do { @@ -814,7 +814,7 @@ do {
[Test()]
public void TestAllowIfBlockInline ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
policy.AllowIfBlockInline = true;
@ -884,7 +884,7 @@ do { @@ -884,7 +884,7 @@ do {
[Test()]
public void TestIfElseBracketPlacement ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
@ -909,7 +909,7 @@ do { @@ -909,7 +909,7 @@ do {
[Test()]
public void TestIfForcementRemove ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.NextLine;
policy.IfElseBraceForcement = BraceForcement.RemoveBraces;
@ -947,7 +947,7 @@ do { @@ -947,7 +947,7 @@ do {
[Test()]
public void TestIfAlignment ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.AlignEmbeddedIfStatements = true;
policy.ClassBraceStyle = BraceStyle.EndOfLine;
@ -981,7 +981,7 @@ if (b) { @@ -981,7 +981,7 @@ if (b) {
[Test()]
public void TestIfForcementAdd ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
policy.IfElseBraceForcement = BraceForcement.AddBraces;
@ -1008,7 +1008,7 @@ if (b) { @@ -1008,7 +1008,7 @@ if (b) {
[Test()]
public void TestIfForcementWithComment ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
policy.IfElseBraceForcement = BraceForcement.AddBraces;
@ -1036,7 +1036,7 @@ if (b) { @@ -1036,7 +1036,7 @@ if (b) {
[Test()]
public void TestIfElseForcementAdd ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
policy.IfElseBraceForcement = BraceForcement.AddBraces;
@ -1067,7 +1067,7 @@ if (b) { @@ -1067,7 +1067,7 @@ if (b) {
[Test()]
public void TestIfElseIFForcementAdd ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
policy.IfElseBraceForcement = BraceForcement.AddBraces;
@ -1098,7 +1098,7 @@ if (b) { @@ -1098,7 +1098,7 @@ if (b) {
[Test()]
public void TestElseOnNewLine ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PlaceElseOnNewLine = true;
Test (policy, @"class Test
@ -1129,7 +1129,7 @@ if (b) { @@ -1129,7 +1129,7 @@ if (b) {
[Test()]
public void TestElseIfOnNewLine ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PlaceElseIfOnNewLine = true;
Test (policy, @"class Test
@ -1160,7 +1160,7 @@ if (b) { @@ -1160,7 +1160,7 @@ if (b) {
[Test()]
public void TestElseOnNewLineOff ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PlaceElseOnNewLine = false;
Test (policy, @"class Test
@ -1191,7 +1191,7 @@ if (b) { @@ -1191,7 +1191,7 @@ if (b) {
[Test()]
public void TestSimpleIfElseComment ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
policy.PlaceElseIfOnNewLine = false; // for simple statements it must be new line.
@ -1218,7 +1218,7 @@ if (b) { @@ -1218,7 +1218,7 @@ if (b) {
[Test()]
public void TestWhileForcementRemove ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.NextLine;
policy.WhileBraceForcement = BraceForcement.RemoveBraces;
@ -1256,7 +1256,7 @@ if (b) { @@ -1256,7 +1256,7 @@ if (b) {
[Test()]
public void TestFixedBracketPlacement ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.NextLineShifted;
policy.FixedBraceForcement = BraceForcement.AddBraces;
@ -1285,7 +1285,7 @@ if (b) { @@ -1285,7 +1285,7 @@ if (b) {
[Test()]
public void TestForBracketPlacement ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLineWithoutSpace;
Test (policy, @"class Test
@ -1309,7 +1309,7 @@ if (b) { @@ -1309,7 +1309,7 @@ if (b) {
[Test()]
public void TestCheckedBracketPlacement ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLineWithoutSpace;
@ -1334,7 +1334,7 @@ if (b) { @@ -1334,7 +1334,7 @@ if (b) {
[Test()]
public void TestUncheckedBracketPlacement ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLineWithoutSpace;
@ -1359,7 +1359,7 @@ if (b) { @@ -1359,7 +1359,7 @@ if (b) {
[Test()]
public void TestLockBracketPlacement ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
@ -1387,7 +1387,7 @@ if (b) { @@ -1387,7 +1387,7 @@ if (b) {
[Test()]
public void TestUnsafeBracketPlacement ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
@ -1415,7 +1415,7 @@ if (b) { @@ -1415,7 +1415,7 @@ if (b) {
[Test()]
public void TestUsingBracketPlacement ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
@ -1443,7 +1443,7 @@ if (b) { @@ -1443,7 +1443,7 @@ if (b) {
[Test()]
public void TestWhileBracketPlacement ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
@ -1471,7 +1471,7 @@ if (b) { @@ -1471,7 +1471,7 @@ if (b) {
[Test()]
public void TestDoWhileBracketPlacement ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
@ -1499,7 +1499,7 @@ if (b) { @@ -1499,7 +1499,7 @@ if (b) {
[Test()]
public void TestSwitchFormatting1 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.IndentSwitchBody = true;
policy.IndentCaseBody = true;
@ -1532,7 +1532,7 @@ if (b) { @@ -1532,7 +1532,7 @@ if (b) {
[Test()]
public void TestSwitchFormatting2 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.IndentSwitchBody = false;
policy.IndentCaseBody = false;
@ -1565,7 +1565,7 @@ if (b) { @@ -1565,7 +1565,7 @@ if (b) {
[Test()]
public void TestTryCatchBracketPlacement ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.StatementBraceStyle = BraceStyle.EndOfLine;
@ -1592,7 +1592,7 @@ if (b) { @@ -1592,7 +1592,7 @@ if (b) {
[Test()]
public void TestPlaceCatchOnNewLine ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PlaceCatchOnNewLine = true;
@ -1624,7 +1624,7 @@ if (b) { @@ -1624,7 +1624,7 @@ if (b) {
[Test()]
public void TestPlaceFinallyOnNewLine ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PlaceFinallyOnNewLine = true;
Test (policy, @"class Test
@ -1655,7 +1655,7 @@ if (b) { @@ -1655,7 +1655,7 @@ if (b) {
[Test()]
public void TestPlaceWhileOnNewLine ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PlaceWhileOnNewLine = true;

40
ICSharpCode.NRefactory.Tests/FormattingTests/TestTypeLevelIndentation.cs

@ -37,7 +37,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -37,7 +37,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestClassIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.DoNotChange;
Test (policy,
@ -49,7 +49,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -49,7 +49,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestClassIndentationInNamespaces ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.NamespaceBraceStyle = BraceStyle.EndOfLine;
policy.ClassBraceStyle = BraceStyle.DoNotChange;
@ -63,7 +63,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -63,7 +63,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
[Test()]
public void TestNoIndentationInNamespaces ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.NamespaceBraceStyle = BraceStyle.EndOfLine;
policy.ClassBraceStyle = BraceStyle.DoNotChange;
policy.IndentNamespaceBody = false;
@ -78,7 +78,7 @@ class Test {} @@ -78,7 +78,7 @@ class Test {}
[Test()]
public void TestClassIndentationInNamespacesCase2 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.NamespaceBraceStyle = BraceStyle.NextLine;
policy.ClassBraceStyle = BraceStyle.NextLine;
policy.ConstructorBraceStyle = BraceStyle.NextLine;
@ -108,7 +108,7 @@ namespace MonoDevelop.CSharp.Formatting @@ -108,7 +108,7 @@ namespace MonoDevelop.CSharp.Formatting
[Test()]
public void TestIndentClassBody ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.IndentClassBody = true;
Test (policy,
@"class Test
@ -134,7 +134,7 @@ Test a; @@ -134,7 +134,7 @@ Test a;
[Test()]
public void TestIndentInterfaceBody ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.IndentInterfaceBody = true;
Test (policy,
@ -159,7 +159,7 @@ Test Foo (); @@ -159,7 +159,7 @@ Test Foo ();
[Test()]
public void TestIndentStructBody ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.IndentStructBody = true;
Test (policy,
@ -184,7 +184,7 @@ Test Foo (); @@ -184,7 +184,7 @@ Test Foo ();
[Test()]
public void TestIndentEnumBody ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.IndentEnumBody = true;
Test (policy,
@ -209,7 +209,7 @@ A @@ -209,7 +209,7 @@ A
[Test()]
public void TestIndentMethodBody ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.IndentMethodBody = true;
Test (policy,
@ -252,7 +252,7 @@ A @@ -252,7 +252,7 @@ A
[Test()]
public void TestIndentMethodBodyOperatorCase ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.IndentMethodBody = true;
var adapter = Test (policy,
@ -286,7 +286,7 @@ A @@ -286,7 +286,7 @@ A
[Test()]
public void TestIndentPropertyBody ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.IndentPropertyBody = true;
var adapter = Test (policy,
@ -319,7 +319,7 @@ set; @@ -319,7 +319,7 @@ set;
[Test()]
public void TestIndentPropertyOneLine ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PropertyFormatting = PropertyFormatting.AllowOneLine;
policy.AllowPropertyGetBlockInline = true;
policy.AllowPropertySetBlockInline = true;
@ -338,7 +338,7 @@ set; @@ -338,7 +338,7 @@ set;
[Test()]
public void TestIndentPropertyOneLineCase2 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PropertyFormatting = PropertyFormatting.AllowOneLine;
policy.AllowPropertyGetBlockInline = true;
policy.AllowPropertySetBlockInline = true;
@ -357,7 +357,7 @@ set; @@ -357,7 +357,7 @@ set;
[Test()]
public void TestIndentPropertyBodyIndexerCase ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.IndentPropertyBody = true;
var adapter = Test (policy,
@ -402,7 +402,7 @@ set { @@ -402,7 +402,7 @@ set {
[Test()]
public void TestPropertyAlignment ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PropertyFormatting = PropertyFormatting.AllowOneLine;
var adapter = Test (policy,
@"class Test
@ -435,7 +435,7 @@ set { @@ -435,7 +435,7 @@ set {
[Test()]
public void TestIndentNamespaceBody ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.ClassBraceStyle = BraceStyle.DoNotChange;
policy.NamespaceBraceStyle = BraceStyle.EndOfLine;
policy.IndentNamespaceBody = true;
@ -458,7 +458,7 @@ class FooBar {} @@ -458,7 +458,7 @@ class FooBar {}
[Test()]
public void TestMethodIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.MethodBraceStyle = BraceStyle.DoNotChange;
Test (policy,
@ -475,7 +475,7 @@ MyType TestMethod () {} @@ -475,7 +475,7 @@ MyType TestMethod () {}
[Test()]
public void TestPropertyIndentation ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.PropertyBraceStyle = BraceStyle.DoNotChange;
Test (policy,
@ -491,7 +491,7 @@ MyType TestMethod () {} @@ -491,7 +491,7 @@ MyType TestMethod () {}
[Test()]
public void TestPropertyIndentationCase2 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
Test (policy,
@"class Test
@ -514,7 +514,7 @@ set; @@ -514,7 +514,7 @@ set;
[Test()]
public void TestIndentEventBody ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharpFormattingOptions policy = new CSharpFormattingOptions ();
policy.IndentEventBody = true;
var adapter = Test (policy,

6
ICSharpCode.NRefactory.Tests/FormattingTests/TextEditorTestAdapter.cs

@ -221,7 +221,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -221,7 +221,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
public abstract class TestBase
{
protected static ITextEditorAdapter GetResult (CSharpFormattingPolicy policy, string input)
protected static ITextEditorAdapter GetResult (CSharpFormattingOptions policy, string input)
{
var adapter = new TextEditorTestAdapter (input);
var visitior = new AstFormattingVisitor (policy, adapter);
@ -233,7 +233,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -233,7 +233,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
return adapter;
}
protected static ITextEditorAdapter Test (CSharpFormattingPolicy policy, string input, string expectedOutput)
protected static ITextEditorAdapter Test (CSharpFormattingOptions policy, string input, string expectedOutput)
{
var adapter = new TextEditorTestAdapter (input);
var visitior = new AstFormattingVisitor (policy, adapter);
@ -245,7 +245,7 @@ namespace ICSharpCode.NRefactory.FormattingTests @@ -245,7 +245,7 @@ namespace ICSharpCode.NRefactory.FormattingTests
return adapter;
}
protected static void Continue (CSharpFormattingPolicy policy, ITextEditorAdapter adapter, string expectedOutput)
protected static void Continue (CSharpFormattingOptions policy, ITextEditorAdapter adapter, string expectedOutput)
{
var visitior = new AstFormattingVisitor (policy, adapter);

2
ICSharpCode.NRefactory/CSharp/Ast/Expressions/Expression.cs

@ -57,7 +57,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -57,7 +57,7 @@ namespace ICSharpCode.NRefactory.CSharp
if (IsNull)
return "Null";
StringWriter w = new StringWriter();
AcceptVisitor(new OutputVisitor(w, new CSharpFormattingPolicy()), null);
AcceptVisitor(new OutputVisitor(w, new CSharpFormattingOptions()), null);
return w.ToString();
}

4
ICSharpCode.NRefactory/CSharp/Ast/PatternMatching/Pattern.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
@ -88,7 +88,7 @@ namespace ICSharpCode.NRefactory.CSharp.PatternMatching @@ -88,7 +88,7 @@ namespace ICSharpCode.NRefactory.CSharp.PatternMatching
public override string ToString()
{
StringWriter w = new StringWriter();
AcceptVisitor(new OutputVisitor(w, new CSharpFormattingPolicy()), null);
AcceptVisitor(new OutputVisitor(w, new CSharpFormattingOptions()), null);
return w.ToString();
}
}

2
ICSharpCode.NRefactory/CSharp/Ast/Statements/Statement.cs

@ -92,7 +92,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -92,7 +92,7 @@ namespace ICSharpCode.NRefactory.CSharp
if (IsNull)
return "Null";
StringWriter w = new StringWriter();
AcceptVisitor(new OutputVisitor(w, new CSharpFormattingPolicy()), null);
AcceptVisitor(new OutputVisitor(w, new CSharpFormattingOptions()), null);
string text = w.ToString().TrimEnd().Replace("\t", "").Replace(w.NewLine, " ");
if (text.Length > 100)
return text.Substring(0, 97) + "...";

4
ICSharpCode.NRefactory/CSharp/Formatter/AstFormattingVisitor.cs

@ -33,7 +33,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -33,7 +33,7 @@ namespace ICSharpCode.NRefactory.CSharp
{
public class AstFormattingVisitor : DepthFirstAstVisitor<object, object>
{
CSharpFormattingPolicy policy;
CSharpFormattingOptions policy;
ITextEditorAdapter data;
List<Change> changes = new List<Change> ();
Indent curIndent = new Indent ();
@ -66,7 +66,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -66,7 +66,7 @@ namespace ICSharpCode.NRefactory.CSharp
set;
}
public AstFormattingVisitor (CSharpFormattingPolicy policy, ITextEditorAdapter data)
public AstFormattingVisitor (CSharpFormattingOptions policy, ITextEditorAdapter data)
{
this.policy = policy;
this.data = data;

24
ICSharpCode.NRefactory/CSharp/Formatter/CSharpFormattingPolicy.cs → ICSharpCode.NRefactory/CSharp/Formatter/CSharpFormattingOptions.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
//
// CSharpFormattingPolicy.cs
// CSharpFormattingOptions.cs
//
// Author:
// Mike Krüger <mkrueger@novell.com>
@ -60,7 +60,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -60,7 +60,7 @@ namespace ICSharpCode.NRefactory.CSharp
ForceNewLine
}
public class CSharpFormattingPolicy
public class CSharpFormattingOptions
{
public string Name {
get;
@ -72,9 +72,9 @@ namespace ICSharpCode.NRefactory.CSharp @@ -72,9 +72,9 @@ namespace ICSharpCode.NRefactory.CSharp
set;
}
public CSharpFormattingPolicy Clone ()
public CSharpFormattingOptions Clone ()
{
return (CSharpFormattingPolicy)MemberwiseClone ();
return (CSharpFormattingOptions)MemberwiseClone ();
}
#region Indentation
@ -766,7 +766,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -766,7 +766,7 @@ namespace ICSharpCode.NRefactory.CSharp
#endregion
public CSharpFormattingPolicy ()
public CSharpFormattingOptions ()
{
IndentNamespaceBody = true;
IndentClassBody = IndentInterfaceBody = IndentStructBody = IndentEnumBody = true;
@ -880,22 +880,22 @@ namespace ICSharpCode.NRefactory.CSharp @@ -880,22 +880,22 @@ namespace ICSharpCode.NRefactory.CSharp
BlankLinesBetweenMembers = 1;
}
/*public static CSharpFormattingPolicy Load (FilePath selectedFile)
/*public static CSharpFormattingOptions Load (FilePath selectedFile)
{
using (var stream = System.IO.File.OpenRead (selectedFile)) {
return Load (stream);
}
}
public static CSharpFormattingPolicy Load (System.IO.Stream input)
public static CSharpFormattingOptions Load (System.IO.Stream input)
{
CSharpFormattingPolicy result = new CSharpFormattingPolicy ();
CSharpFormattingOptions result = new CSharpFormattingOptions ();
result.Name = "noname";
using (XmlTextReader reader = new XmlTextReader (input)) {
while (reader.Read ()) {
if (reader.NodeType == XmlNodeType.Element) {
if (reader.LocalName == "Property") {
var info = typeof(CSharpFormattingPolicy).GetProperty (reader.GetAttribute ("name"));
var info = typeof(CSharpFormattingOptions).GetProperty (reader.GetAttribute ("name"));
string valString = reader.GetAttribute ("value");
object value;
if (info.PropertyType == typeof(bool)) {
@ -926,7 +926,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -926,7 +926,7 @@ namespace ICSharpCode.NRefactory.CSharp
writer.IndentChar = '\t';
writer.WriteStartElement ("FormattingProfile");
writer.WriteAttributeString ("name", Name);
foreach (PropertyInfo info in typeof (CSharpFormattingPolicy).GetProperties ()) {
foreach (PropertyInfo info in typeof (CSharpFormattingOptions).GetProperties ()) {
if (info.GetCustomAttributes (false).Any (o => o.GetType () == typeof(ItemPropertyAttribute))) {
writer.WriteStartElement ("Property");
writer.WriteAttributeString ("name", info.Name);
@ -938,9 +938,9 @@ namespace ICSharpCode.NRefactory.CSharp @@ -938,9 +938,9 @@ namespace ICSharpCode.NRefactory.CSharp
}
}
public bool Equals (CSharpFormattingPolicy other)
public bool Equals (CSharpFormattingOptions other)
{
foreach (PropertyInfo info in typeof (CSharpFormattingPolicy).GetProperties ()) {
foreach (PropertyInfo info in typeof (CSharpFormattingOptions).GetProperties ()) {
if (info.GetCustomAttributes (false).Any (o => o.GetType () == typeof(ItemPropertyAttribute))) {
object val = info.GetValue (this, null);
object otherVal = info.GetValue (other, null);

6
ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs

@ -20,7 +20,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -20,7 +20,7 @@ namespace ICSharpCode.NRefactory.CSharp
public class OutputVisitor : IPatternAstVisitor<object, object>
{
readonly IOutputFormatter formatter;
readonly CSharpFormattingPolicy policy;
readonly CSharpFormattingOptions policy;
readonly Stack<AstNode> containerStack = new Stack<AstNode>();
readonly Stack<AstNode> positionStack = new Stack<AstNode>();
@ -42,7 +42,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -42,7 +42,7 @@ namespace ICSharpCode.NRefactory.CSharp
Division
}
public OutputVisitor(TextWriter textWriter, CSharpFormattingPolicy formattingPolicy)
public OutputVisitor(TextWriter textWriter, CSharpFormattingOptions formattingPolicy)
{
if (textWriter == null)
throw new ArgumentNullException("textWriter");
@ -52,7 +52,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -52,7 +52,7 @@ namespace ICSharpCode.NRefactory.CSharp
this.policy = formattingPolicy;
}
public OutputVisitor(IOutputFormatter formatter, CSharpFormattingPolicy formattingPolicy)
public OutputVisitor(IOutputFormatter formatter, CSharpFormattingOptions formattingPolicy)
{
if (formatter == null)
throw new ArgumentNullException("formatter");

4
ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<ProjectGuid>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</ProjectGuid>
@ -157,7 +157,6 @@ @@ -157,7 +157,6 @@
<Compile Include="CSharp\Ast\TypeMembers\ParameterDeclaration.cs" />
<Compile Include="CSharp\Ast\TypeMembers\PropertyDeclaration.cs" />
<Compile Include="CSharp\Ast\TypeMembers\VariableInitializer.cs" />
<Compile Include="CSharp\Formatter\CSharpFormattingPolicy.cs" />
<Compile Include="CSharp\Formatter\Indent.cs" />
<Compile Include="CSharp\OutputVisitor\InsertParenthesesVisitor.cs" />
<Compile Include="CSharp\OutputVisitor\IOutputFormatter.cs" />
@ -350,6 +349,7 @@ @@ -350,6 +349,7 @@
<Compile Include="CSharp\Ast\TypeMembers\FixedFieldDeclaration.cs" />
<Compile Include="CSharp\Ast\TypeMembers\FixedVariableInitializer.cs" />
<Compile Include="CSharp\Ast\GeneralScope\ExternAliasDeclaration.cs" />
<Compile Include="CSharp\Formatter\CSharpFormattingOptions.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="CSharp\" />

Loading…
Cancel
Save