Browse Source

Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger

pull/191/merge
Eusebiu Marcu 15 years ago
parent
commit
d93311b0f4
  1. 8
      ICSharpCode.Decompiler/Ast/AstBuilder.cs
  2. 43
      ILSpy/XmlDocKeyProvider.cs
  3. 10
      NRefactory/ICSharpCode.NRefactory.Demo/ICSharpCode.NRefactory.Demo.csproj
  4. 2
      NRefactory/ICSharpCode.NRefactory.Demo/VBAstView.Designer.cs
  5. 8
      NRefactory/ICSharpCode.NRefactory.Demo/VBAstView.cs
  6. 0
      NRefactory/ICSharpCode.NRefactory.Demo/VBAstView.resx
  7. 4
      NRefactory/ICSharpCode.NRefactory.Demo/VBDemo.Designer.cs
  8. 10
      NRefactory/ICSharpCode.NRefactory.Tests/CSharp/InsertParenthesesVisitorTests.cs
  9. 9
      NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/GeneralScope/TypeDeclarationTests.cs
  10. 2
      NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ResolverTestBase.cs
  11. 285
      NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestBlankLineFormatting.cs
  12. 369
      NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestBraceStlye.cs
  13. 133
      NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestFormattingBugs.cs
  14. 1672
      NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestSpacingVisitor.cs
  15. 1415
      NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestStatementIndentation.cs
  16. 508
      NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestTypeLevelIndentation.cs
  17. 261
      NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TextEditorTestAdapter.cs
  18. 21
      NRefactory/ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj
  19. 10
      NRefactory/ICSharpCode.NRefactory.VB.Tests/General/UnitTest.cs
  20. 2
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Lexer/LexerContextTests.cs
  21. 2
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Output/CodeDOM/CodeDOMParenthesizedExpressionTest.cs
  22. 2
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Output/CodeDOM/CodeDOMPrimitiveExpressionTest.cs
  23. 2
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Output/CodeDOM/CodeDOMTypeReferenceTest.cs
  24. 2
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Output/CodeDOM/InvocationExpressionTest.cs
  25. 2
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Output/SpecialOutputVisitorTest.cs
  26. 2
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Output/VBNet/VBNetOutputTest.cs
  27. 6
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/CheckParentVisitor.cs
  28. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/AddressOfExpressionTests.cs
  29. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/ArrayCreateExpressionTests.cs
  30. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/AssignmentExpressionTests.cs
  31. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/BaseReferenceExpressionTests.cs
  32. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/BinaryOperatorExpressionTests.cs
  33. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/CastExpressionTests.cs
  34. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/ClassReferenceExpressionTests.cs
  35. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/ConditionalExpressionTests.cs
  36. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/GlobalReferenceExpressionTests.cs
  37. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/IdentifierExpressionTests.cs
  38. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/InvocationExpressionTests.cs
  39. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/LambdaExpressionTests.cs
  40. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/MemberReferenceExpressionTests.cs
  41. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/ObjectCreateExpressionTests.cs
  42. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/ParenthesizedExpressionTest.cs
  43. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/PrimitiveExpressionTests.cs
  44. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/QueryExpressionTests.cs
  45. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/ThisReferenceExpressionTests.cs
  46. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/TypeOfExpressionTests.cs
  47. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/TypeOfIsExpressionTests.cs
  48. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/TypeReferenceExpressionTests.cs
  49. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/UnaryOperatorExpressionTests.cs
  50. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/XmlExpressionTests.cs
  51. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/XmlMemberAccessExpressionTests.cs
  52. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/GlobalScope/AttributeSectionTests.cs
  53. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/GlobalScope/DelegateDeclarationTests.cs
  54. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/GlobalScope/NamespaceDeclarationTests.cs
  55. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/GlobalScope/OptionDeclarationTests.cs
  56. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/GlobalScope/TypeDeclarationTests.cs
  57. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/GlobalScope/UsingDeclarationTests.cs
  58. 6
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/LocationAssignmentCheckVisitor.cs
  59. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/ParseUtil.cs
  60. 2
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/SnippetParserTests.cs
  61. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/AddHandlerStatementTests.cs
  62. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/BlockStatementTests.cs
  63. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ContinueStatementTests.cs
  64. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/DoLoopStatementTests.cs
  65. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/EndStatementTests.cs
  66. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/EraseStatementTests.cs
  67. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ErrorStatementTests.cs
  68. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ExpressionStatementTests.cs
  69. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ForNextStatementTests.cs
  70. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ForeachStatementTests.cs
  71. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/GotoStatementTests.cs
  72. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/IfElseStatementTests.cs
  73. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/LabelStatementTests.cs
  74. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/LocalVariableDeclarationTests.cs
  75. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/LockStatementTests.cs
  76. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/OnErrorStatementTest.cs
  77. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/RaiseEventStatementTest.cs
  78. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ReDimStatementTests.cs
  79. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/RemoveHandlerStatement.cs
  80. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ResumeStatement.cs
  81. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ReturnStatementTests.cs
  82. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/StopStatementTests.cs
  83. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/SwitchStatementTests.cs
  84. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ThrowStatementTests.cs
  85. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/TryCatchStatementTests.cs
  86. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/UsingStatementTests.cs
  87. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/WithStatementTests.cs
  88. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/ConstructorDeclarationTests.cs
  89. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/CustomEventTests.cs
  90. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/DeclareDeclarationTests.cs
  91. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/EventDeclarationTests.cs
  92. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/FieldDeclarationTests.cs
  93. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/MethodDeclarationTests.cs
  94. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/OperatorDeclarationTests.cs
  95. 4
      NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/PropertyDeclarationTests.cs
  96. 6
      NRefactory/ICSharpCode.NRefactory.VB/Ast/AbstractNode.cs
  97. 2
      NRefactory/ICSharpCode.NRefactory.VB/Ast/Enums.cs
  98. 8
      NRefactory/ICSharpCode.NRefactory.VB/Ast/General/BlockStatement.cs
  99. 4
      NRefactory/ICSharpCode.NRefactory.VB/Ast/General/CompilationUnit.cs
  100. 4
      NRefactory/ICSharpCode.NRefactory.VB/Ast/General/Expression.cs
  101. Some files were not shown because too many files have changed in this diff Show More

8
ICSharpCode.Decompiler/Ast/AstBuilder.cs

@ -88,10 +88,10 @@ namespace ICSharpCode.Decompiler.Ast
var outputFormatter = new TextOutputFormatter(output); var outputFormatter = new TextOutputFormatter(output);
var formattingPolicy = new CSharpFormattingPolicy(); var formattingPolicy = new CSharpFormattingPolicy();
// disable whitespace in front of parentheses: // disable whitespace in front of parentheses:
formattingPolicy.BeforeMethodCallParentheses = false; formattingPolicy.SpaceBeforeMethodCallParentheses = false;
formattingPolicy.BeforeMethodDeclarationParentheses = false; formattingPolicy.SpaceBeforeMethodDeclarationParentheses = false;
formattingPolicy.BeforeConstructorDeclarationParentheses = false; formattingPolicy.SpaceBeforeConstructorDeclarationParentheses = false;
formattingPolicy.BeforeDelegateDeclarationParentheses = false; formattingPolicy.SpaceBeforeDelegateDeclarationParentheses = false;
astCompileUnit.AcceptVisitor(new OutputVisitor(outputFormatter, formattingPolicy), null); astCompileUnit.AcceptVisitor(new OutputVisitor(outputFormatter, formattingPolicy), null);
} }

43
ILSpy/XmlDocKeyProvider.cs

@ -3,6 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Mono.Cecil; using Mono.Cecil;
@ -37,7 +38,12 @@ namespace ICSharpCode.ILSpy
if (member is PropertyDefinition) { if (member is PropertyDefinition) {
parameters = ((PropertyDefinition)member).Parameters; parameters = ((PropertyDefinition)member).Parameters;
} else if (member is MethodReference) { } else if (member is MethodReference) {
parameters = ((MethodReference)member).Parameters; MethodReference mr = (MethodReference)member;
if (mr.HasGenericParameters) {
b.Append("``");
b.Append(mr.GenericParameters.Count);
}
parameters = mr.Parameters;
} else { } else {
parameters = null; parameters = null;
} }
@ -55,7 +61,23 @@ namespace ICSharpCode.ILSpy
static void AppendTypeName(StringBuilder b, TypeReference type) static void AppendTypeName(StringBuilder b, TypeReference type)
{ {
if (type is TypeSpecification) { if (type is GenericInstanceType) {
GenericInstanceType giType = (GenericInstanceType)type;
if (type.DeclaringType != null) {
AppendTypeName(b, type.DeclaringType);
b.Append('.');
} else if (!string.IsNullOrEmpty(type.Namespace)) {
b.Append(type.Namespace);
b.Append('.');
}
b.Append(NRefactory.TypeSystem.ReflectionHelper.SplitTypeParameterCountFromReflectionName(type.Name));
b.Append('{');
for (int i = 0; i < giType.GenericArguments.Count; i++) {
if (i > 0) b.Append(',');
AppendTypeName(b, giType.GenericArguments[i]);
}
b.Append('}');
} else if (type is TypeSpecification) {
AppendTypeName(b, ((TypeSpecification)type).ElementType); AppendTypeName(b, ((TypeSpecification)type).ElementType);
ArrayType arrayType = type as ArrayType; ArrayType arrayType = type as ArrayType;
if (arrayType != null) { if (arrayType != null) {
@ -69,15 +91,6 @@ namespace ICSharpCode.ILSpy
if (refType != null) { if (refType != null) {
b.Append('@'); b.Append('@');
} }
GenericInstanceType giType = type as GenericInstanceType;
if (giType != null) {
b.Append('{');
for (int i = 0; i < giType.GenericArguments.Count; i++) {
if (i > 0) b.Append(',');
AppendTypeName(b, giType.GenericArguments[i]);
}
b.Append('}');
}
PointerType ptrType = type as PointerType; PointerType ptrType = type as PointerType;
if (ptrType != null) { if (ptrType != null) {
b.Append('*'); // TODO: is this correct? b.Append('*'); // TODO: is this correct?
@ -126,18 +139,22 @@ namespace ICSharpCode.ILSpy
static MemberReference FindMember(ModuleDefinition module, string key, Func<TypeDefinition, IEnumerable<MemberReference>> memberSelector) static MemberReference FindMember(ModuleDefinition module, string key, Func<TypeDefinition, IEnumerable<MemberReference>> memberSelector)
{ {
Debug.WriteLine("Looking for member " + key);
int pos = key.IndexOf('('); int pos = key.IndexOf('(');
int dotPos; int dotPos;
if (pos > 0) { if (pos > 0) {
dotPos = key.LastIndexOf('.', 0, pos); dotPos = key.LastIndexOf('.', pos - 1, pos);
} else { } else {
dotPos = key.LastIndexOf('.'); dotPos = key.LastIndexOf('.');
} }
TypeDefinition type = FindType(module, key.Substring(2, dotPos - 2)); TypeDefinition type = FindType(module, key.Substring(2, dotPos - 2));
if (type == null) if (type == null)
return null; return null;
Debug.WriteLine("Searching in type " + type.FullName);
foreach (MemberReference member in memberSelector(type)) { foreach (MemberReference member in memberSelector(type)) {
if (GetKey(member) == key) string memberKey = GetKey(member);
Debug.WriteLine(memberKey);
if (memberKey == key)
return member; return member;
} }
return null; return null;

10
NRefactory/ICSharpCode.NRefactory.Demo/ICSharpCode.NRefactory.Demo.csproj

@ -46,11 +46,11 @@
<Compile Include="VBEditDialog.Designer.cs"> <Compile Include="VBEditDialog.Designer.cs">
<DependentUpon>VBEditDialog.cs</DependentUpon> <DependentUpon>VBEditDialog.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="VBDomView.cs"> <Compile Include="VBAstView.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="VBDomView.Designer.cs"> <Compile Include="VBAstView.Designer.cs">
<DependentUpon>VBDomView.cs</DependentUpon> <DependentUpon>VBAstView.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="MainForm.cs"> <Compile Include="MainForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
@ -81,8 +81,8 @@
<EmbeddedResource Include="VBEditDialog.resx"> <EmbeddedResource Include="VBEditDialog.resx">
<DependentUpon>VBEditDialog.cs</DependentUpon> <DependentUpon>VBEditDialog.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="VBDomView.resx"> <EmbeddedResource Include="VBAstView.resx">
<DependentUpon>VBDomView.cs</DependentUpon> <DependentUpon>VBAstView.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="MainForm.resx"> <EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>

2
NRefactory/ICSharpCode.NRefactory.Demo/VBDomView.Designer.cs → NRefactory/ICSharpCode.NRefactory.Demo/VBAstView.Designer.cs generated

@ -3,7 +3,7 @@
namespace ICSharpCode.NRefactory.Demo namespace ICSharpCode.NRefactory.Demo
{ {
partial class VBDomView : System.Windows.Forms.UserControl partial class VBAstView : System.Windows.Forms.UserControl
{ {
/// <summary> /// <summary>
/// Designer variable used to keep track of non-visual components. /// Designer variable used to keep track of non-visual components.

8
NRefactory/ICSharpCode.NRefactory.Demo/VBDomView.cs → NRefactory/ICSharpCode.NRefactory.Demo/VBAstView.cs

@ -6,12 +6,12 @@ using System.Collections;
using System.Windows.Forms; using System.Windows.Forms;
using System.Reflection; using System.Reflection;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using ICSharpCode.NRefactory.VB; using ICSharpCode.NRefactory.VB;
namespace ICSharpCode.NRefactory.Demo namespace ICSharpCode.NRefactory.Demo
{ {
public partial class VBDomView public partial class VBAstView
{ {
CompilationUnit unit; CompilationUnit unit;
@ -34,7 +34,7 @@ namespace ICSharpCode.NRefactory.Demo
tree.SelectedNode = tree.Nodes[0]; tree.SelectedNode = tree.Nodes[0];
} }
public VBDomView() public VBAstView()
{ {
InitializeComponent(); InitializeComponent();
} }
@ -89,7 +89,7 @@ namespace ICSharpCode.NRefactory.Demo
((ElementNode)node).Update(); ((ElementNode)node).Update();
} }
public void ApplyTransformation(IDomVisitor visitor) public void ApplyTransformation(IAstVisitor visitor)
{ {
if (tree.SelectedNode == tree.Nodes[0]) { if (tree.SelectedNode == tree.Nodes[0]) {
unit.AcceptVisitor(visitor, null); unit.AcceptVisitor(visitor, null);

0
NRefactory/ICSharpCode.NRefactory.Demo/VBDomView.resx → NRefactory/ICSharpCode.NRefactory.Demo/VBAstView.resx

4
NRefactory/ICSharpCode.NRefactory.Demo/VBDemo.Designer.cs generated

@ -35,7 +35,7 @@ namespace ICSharpCode.NRefactory.Demo
this.codeView = new System.Windows.Forms.TextBox(); this.codeView = new System.Windows.Forms.TextBox();
this.editNodeButton = new System.Windows.Forms.Button(); this.editNodeButton = new System.Windows.Forms.Button();
this.clearSpecialsButton = new System.Windows.Forms.Button(); this.clearSpecialsButton = new System.Windows.Forms.Button();
this.syntaxTree = new ICSharpCode.NRefactory.Demo.VBDomView(); this.syntaxTree = new ICSharpCode.NRefactory.Demo.VBAstView();
this.generateCodeButton = new System.Windows.Forms.Button(); this.generateCodeButton = new System.Windows.Forms.Button();
this.parseButton = new System.Windows.Forms.Button(); this.parseButton = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
@ -154,7 +154,7 @@ namespace ICSharpCode.NRefactory.Demo
} }
private System.Windows.Forms.Button clearSpecialsButton; private System.Windows.Forms.Button clearSpecialsButton;
private System.Windows.Forms.Button editNodeButton; private System.Windows.Forms.Button editNodeButton;
private ICSharpCode.NRefactory.Demo.VBDomView syntaxTree; private ICSharpCode.NRefactory.Demo.VBAstView syntaxTree;
private System.Windows.Forms.TextBox codeView; private System.Windows.Forms.TextBox codeView;
private System.Windows.Forms.Button generateCodeButton; private System.Windows.Forms.Button generateCodeButton;
private System.Windows.Forms.Button parseButton; private System.Windows.Forms.Button parseButton;

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

@ -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) // This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System; using System;
@ -146,10 +146,10 @@ namespace ICSharpCode.NRefactory.CSharp
Assert.AreEqual("a is int? ? b : c", InsertRequired(expr)); Assert.AreEqual("a is int? ? b : c", InsertRequired(expr));
Assert.AreEqual("(a is int?) ? b : c", InsertReadable(expr)); Assert.AreEqual("(a is int?) ? b : c", InsertReadable(expr));
policy.ConditionalOperatorBeforeConditionSpace = false; policy.SpaceBeforeConditionalOperatorCondition = false;
policy.ConditionalOperatorAfterConditionSpace = false; policy.SpaceAfterConditionalOperatorCondition = false;
policy.ConditionalOperatorBeforeSeparatorSpace = false; policy.SpaceBeforeConditionalOperatorSeparator = false;
policy.ConditionalOperatorAfterSeparatorSpace = false; policy.SpaceAfterConditionalOperatorSeparator = false;
Assert.AreEqual("a is int? ?b:c", InsertRequired(expr)); Assert.AreEqual("a is int? ?b:c", InsertRequired(expr));
Assert.AreEqual("(a is int?)?b:c", InsertReadable(expr)); Assert.AreEqual("(a is int?)?b:c", InsertReadable(expr));

9
NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/GeneralScope/TypeDeclarationTests.cs

@ -272,5 +272,14 @@ public abstract class MyClass : MyBase, Interface1, My.Test.Interface2
Assert.AreEqual("N", ns.Name); Assert.AreEqual("N", ns.Name);
Assert.AreEqual("MyClass", ((TypeDeclaration)ns.Members.Single()).Name); Assert.AreEqual("MyClass", ((TypeDeclaration)ns.Members.Single()).Name);
} }
[Test]
public void EnumWithInitializer()
{
TypeDeclaration td = ParseUtilCSharp.ParseGlobal<TypeDeclaration>("enum MyEnum { Val1 = 10 }");
EnumMemberDeclaration member = (EnumMemberDeclaration)td.Members.Single();
Assert.AreEqual("Val1", member.Name);
Assert.AreEqual(10, ((PrimitiveExpression)member.Initializer).Value);
}
} }
} }

2
NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ResolverTestBase.cs

@ -171,7 +171,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver
protected T Resolve<T>(string code) where T : ResolveResult protected T Resolve<T>(string code) where T : ResolveResult
{ {
ResolveResult rr = Resolve(code); ResolveResult rr = Resolve(code);
Assert.IsInstanceOf(typeof(T), rr); Assert.IsTrue(rr is T, "Resolve should be " + typeof(T).Name + ", but was " + (rr != null ? rr.GetType().Name : "null"));
return (T)rr; return (T)rr;
} }

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

@ -0,0 +1,285 @@
//
// TastBlankLineFormatting.cs
//
// Author:
// Mike Krüger <mkrueger@novell.com>
//
// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.IO;
using NUnit.Framework;
using ICSharpCode.NRefactory.CSharp;
namespace ICSharpCode.NRefactory.FormattingTests
{
[TestFixture()]
public class TestBlankLineFormatting : TestBase
{
[Test()]
public void TestBlankLinesAfterUsings ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.BlankLinesAfterUsings = 2;
var adapter = Test (policy, @"using System;
using System.Text;
namespace Test
{
}",
@"using System;
using System.Text;
namespace Test
{
}");
policy.BlankLinesAfterUsings = 0;
Continue (policy, adapter,
@"using System;
using System.Text;
namespace Test
{
}");
}
[Test()]
public void TestBlankLinesBeforeUsings ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.BlankLinesAfterUsings = 0;
policy.BlankLinesBeforeUsings = 2;
var adapter = Test (policy, @"using System;
using System.Text;
namespace Test
{
}",
@"
using System;
using System.Text;
namespace Test
{
}");
policy.BlankLinesBeforeUsings = 0;
Continue (policy, adapter,
@"using System;
using System.Text;
namespace Test
{
}");
}
[Test()]
public void TestBlankLinesBeforeFirstDeclaration ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.BlankLinesBeforeFirstDeclaration = 2;
var adapter = Test (policy, @"namespace Test
{
class Test
{
}
}",
@"namespace Test
{
class Test
{
}
}");
policy.BlankLinesBeforeFirstDeclaration = 0;
Continue (policy, adapter,
@"namespace Test
{
class Test
{
}
}");
}
[Test()]
public void TestBlankLinesBetweenTypes ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.BlankLinesBetweenTypes = 1;
var adapter = Test (policy, @"namespace Test
{
class Test1
{
}
class Test2
{
}
class Test3
{
}
}",
@"namespace Test
{
class Test1
{
}
class Test2
{
}
class Test3
{
}
}");
policy.BlankLinesBetweenTypes = 0;
Continue (policy, adapter, @"namespace Test
{
class Test1
{
}
class Test2
{
}
class Test3
{
}
}");
}
[Test()]
public void TestBlankLinesBetweenFields ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.BlankLinesBetweenFields = 1;
var adapter = Test (policy, @"class Test
{
int a;
int b;
int c;
}",
@"class Test
{
int a;
int b;
int c;
}");
policy.BlankLinesBetweenFields = 0;
Continue (policy, adapter, @"class Test
{
int a;
int b;
int c;
}");
}
[Test()]
public void TestBlankLinesBetweenEventFields ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.BlankLinesBetweenEventFields = 1;
var adapter = Test (policy, @"class Test
{
public event EventHandler a;
public event EventHandler b;
public event EventHandler c;
}",
@"class Test
{
public event EventHandler a;
public event EventHandler b;
public event EventHandler c;
}");
policy.BlankLinesBetweenEventFields = 0;
Continue (policy, adapter,
@"class Test
{
public event EventHandler a;
public event EventHandler b;
public event EventHandler c;
}");
}
[Test()]
public void TestBlankLinesBetweenMembers ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.BlankLinesBetweenMembers = 1;
var adapter = Test (policy,@"class Test
{
void AMethod ()
{
}
void BMethod ()
{
}
void CMethod ()
{
}
}", @"class Test
{
void AMethod ()
{
}
void BMethod ()
{
}
void CMethod ()
{
}
}");
policy.BlankLinesBetweenMembers = 0;
Continue (policy, adapter, @"class Test
{
void AMethod ()
{
}
void BMethod ()
{
}
void CMethod ()
{
}
}");
}
}
}

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

@ -23,245 +23,184 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
/*
using System; using System;
using System.IO;
using NUnit.Framework; using NUnit.Framework;
using MonoDevelop.Ide.Gui; using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Projects;
using MonoDevelop.Core; namespace ICSharpCode.NRefactory.FormattingTests
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Projects.Dom.Parser;
using MonoDevelop.CSharp.Parser;
using MonoDevelop.CSharp.Resolver;
using MonoDevelop.CSharp.Completion;
using Mono.TextEditor;
using MonoDevelop.CSharp.Formatting;
namespace MonoDevelop.CSharpBinding.FormattingTests
{ {
[TestFixture()] [TestFixture()]
public class TestBraceStyle : UnitTests.TestBase public class TestBraceStyle : TestBase
{ {
[Test()] [Test()]
[Ignore("currently failing because namespaces are not inserted")]
public void TestNamespaceBraceStyle () public void TestNamespaceBraceStyle ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text = @"namespace A
{
namespace B {
class Test {}
}
}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.NamespaceBraceStyle = BraceStyle.EndOfLine; policy.NamespaceBraceStyle = BraceStyle.EndOfLine;
policy.ClassBraceStyle = BraceStyle.DoNotChange; policy.ClassBraceStyle = BraceStyle.DoNotChange;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); var adapter = Test (policy, @"namespace A
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); {
Assert.AreEqual (@"namespace A { namespace B {
class Test {}
}
}",
@"namespace A {
namespace B { namespace B {
class Test {} class Test {}
} }
}", data.Document.Text); }");
policy.NamespaceBraceStyle = BraceStyle.NextLineShifted; policy.NamespaceBraceStyle = BraceStyle.NextLineShifted;
compilationUnit = new CSharpParser ().Parse (data); Continue (policy, adapter,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"namespace A
Assert.AreEqual (@"namespace A
{ {
namespace B namespace B
{ {
class Test {} class Test {}
} }
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestClassBraceStlye () public void TestClassBraceStlye ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text = @"class Test {}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.ClassBraceStyle = BraceStyle.EndOfLine; policy.ClassBraceStyle = BraceStyle.EndOfLine;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); Test (policy,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"class Test {}",
Assert.AreEqual (@"class Test { @"class Test {
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestStructBraceStyle () public void TestStructBraceStyle ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text = @"struct Test {}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.StructBraceStyle = BraceStyle.NextLine; policy.StructBraceStyle = BraceStyle.NextLine;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); Test (policy,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"struct Test {}",
Assert.AreEqual (@"struct Test @"struct Test
{ {
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestInterfaceBraceStyle () public void TestInterfaceBraceStyle ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text = @"interface Test {}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.InterfaceBraceStyle = BraceStyle.NextLine; policy.InterfaceBraceStyle = BraceStyle.NextLine;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); Test (policy,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"interface Test {}",
Assert.AreEqual (@"interface Test @"interface Test
{ {
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestEnumBraceStyle () public void TestEnumBraceStyle ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text = @"enum Test {
A
}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.EnumBraceStyle = BraceStyle.NextLineShifted; policy.EnumBraceStyle = BraceStyle.NextLineShifted;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); Test (policy, @"enum Test {
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); A
Assert.AreEqual (@"enum Test }",
@"enum Test
{ {
A A
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestMethodBraceStlye () public void TestMethodBraceStlye ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text = @"class Test
{
Test MyMethod() {}
}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.MethodBraceStyle = BraceStyle.NextLine; policy.MethodBraceStyle = BraceStyle.NextLine;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); Test (policy, @"class Test
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); {
Test MyMethod() {}
Console.WriteLine (data.Document.Text); }",
Assert.AreEqual (@"class Test @"class Test
{ {
Test MyMethod() Test MyMethod ()
{ {
} }
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestConstructorBraceStyle () public void TestConstructorBraceStyle ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text = @"class Test
{
Test() {}
}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.ConstructorBraceStyle = BraceStyle.NextLine; policy.ConstructorBraceStyle = BraceStyle.NextLine;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); Test (policy, @"class Test
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Console.WriteLine (data.Document.Text);
Assert.AreEqual (@"class Test
{ {
Test() Test() {}
}",
@"class Test
{
Test ()
{ {
} }
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestDestructorBraceStyle () public void TestDestructorBraceStyle ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text = @"class Test
{
~Test() {}
}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.DestructorBraceStyle = BraceStyle.NextLine; policy.DestructorBraceStyle = BraceStyle.NextLine;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); Test (policy, @"class Test
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); {
~Test() {}
Console.WriteLine (data.Document.Text); }",
Assert.AreEqual (@"class Test @"class Test
{ {
~Test() ~Test ()
{ {
} }
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestPropertyBraceStyle () public void TestPropertyBraceStyle ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs"; policy.PropertyBraceStyle = BraceStyle.NextLine;
data.Document.Text = @"class Test
Test (policy, @"class Test
{ {
Test A { Test A {
get; get;
set; set;
} }
}"; }",
@"class Test
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.PropertyBraceStyle = BraceStyle.NextLine;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data);
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Console.WriteLine (data.Document.Text);
Assert.AreEqual (@"class Test
{ {
Test A Test A
{ {
get; get;
set; set;
} }
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestPropertyGetBraceStyle () public void TestPropertyGetBraceStyle ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs"; policy.PropertyGetBraceStyle = BraceStyle.NextLine;
data.Document.Text = @"class Test
Test (policy, @"class Test
{ {
Test A { Test A {
get { get {
@ -269,16 +208,8 @@ namespace B {
} }
set; set;
} }
}"; }",
@"class Test
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.PropertyGetBraceStyle = BraceStyle.NextLine;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data);
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Console.WriteLine (data.Document.Text);
Assert.AreEqual (@"class Test
{ {
Test A { Test A {
get get
@ -287,32 +218,26 @@ namespace B {
} }
set; set;
} }
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestAllowPropertyGetBlockInline () public void TestAllowPropertyGetBlockInline ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text = @"class Test
{
Test A {
get { return null; }
set { ; }
}
}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.PropertyBraceStyle = BraceStyle.DoNotChange; policy.PropertyBraceStyle = BraceStyle.DoNotChange;
policy.AllowPropertyGetBlockInline = true; policy.AllowPropertyGetBlockInline = true;
policy.AllowPropertySetBlockInline = false; policy.AllowPropertySetBlockInline = false;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); var adapter = Test (policy, @"class Test
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); {
Test A {
Console.WriteLine (data.Document.Text); get { return null; }
Assert.AreEqual (@"class Test set { ; }
}
}",
@"class Test
{ {
Test A { Test A {
get { return null; } get { return null; }
@ -320,13 +245,11 @@ namespace B {
; ;
} }
} }
}", data.Document.Text); }");
policy.AllowPropertyGetBlockInline = false; policy.AllowPropertyGetBlockInline = false;
compilationUnit = new CSharpParser ().Parse (data); Continue (policy, adapter,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"class Test
Assert.AreEqual (@"class Test
{ {
Test A { Test A {
get { get {
@ -336,32 +259,25 @@ namespace B {
; ;
} }
} }
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestAllowPropertySetBlockInline () public void TestAllowPropertySetBlockInline ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text = @"class Test
{
Test A {
get { return null; }
set { ; }
}
}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.PropertyBraceStyle = BraceStyle.DoNotChange; policy.PropertyBraceStyle = BraceStyle.DoNotChange;
policy.AllowPropertyGetBlockInline = false; policy.AllowPropertyGetBlockInline = false;
policy.AllowPropertySetBlockInline = true; policy.AllowPropertySetBlockInline = true;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); var adapter = Test (policy, @"class Test
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); {
Test A {
Console.WriteLine (data.Document.Text); get { return null; }
Assert.AreEqual (@"class Test set { ; }
}
}",
@"class Test
{ {
Test A { Test A {
get { get {
@ -369,13 +285,11 @@ namespace B {
} }
set { ; } set { ; }
} }
}", data.Document.Text); }");
policy.AllowPropertySetBlockInline = false; policy.AllowPropertySetBlockInline = false;
compilationUnit = new CSharpParser ().Parse (data); Continue (policy, adapter,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"class Test
Assert.AreEqual (@"class Test
{ {
Test A { Test A {
get { get {
@ -385,15 +299,16 @@ namespace B {
; ;
} }
} }
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestPropertySetBraceStyle () public void TestPropertySetBraceStyle ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs"; policy.PropertySetBraceStyle = BraceStyle.NextLine;
data.Document.Text = @"class Test
Test (policy, @"class Test
{ {
Test A { Test A {
get; get;
@ -401,16 +316,8 @@ namespace B {
; ;
} }
} }
}"; }",
@"class Test
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.PropertySetBraceStyle = BraceStyle.NextLine;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data);
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Console.WriteLine (data.Document.Text);
Assert.AreEqual (@"class Test
{ {
Test A { Test A {
get; get;
@ -419,15 +326,18 @@ namespace B {
; ;
} }
} }
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestEventBraceStyle () public void TestEventBraceStyle ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs"; policy.EventBraceStyle = BraceStyle.NextLine;
data.Document.Text = @"class Test policy.EventAddBraceStyle = BraceStyle.NextLine;
policy.EventRemoveBraceStyle = BraceStyle.NextLine;
Test (policy, @"class Test
{ {
public event EventHandler Handler { public event EventHandler Handler {
add { add {
@ -435,18 +345,8 @@ namespace B {
remove { remove {
} }
} }
}"; }",
@"class Test
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.EventBraceStyle = BraceStyle.NextLine;
policy.EventAddBraceStyle = BraceStyle.NextLine;
policy.EventRemoveBraceStyle = BraceStyle.NextLine;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data);
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Console.WriteLine (data.Document.Text);
Assert.AreEqual (@"class Test
{ {
public event EventHandler Handler public event EventHandler Handler
{ {
@ -457,31 +357,24 @@ namespace B {
{ {
} }
} }
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestAllowEventAddBlockInline () public void TestAllowEventAddBlockInline ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs"; policy.AllowEventAddBlockInline = true;
data.Document.Text = @"class Test policy.AllowEventRemoveBlockInline = false;
Test (policy, @"class Test
{ {
public event EventHandler Handler { public event EventHandler Handler {
add { ; } add { ; }
remove { ; } remove { ; }
} }
}"; }",
@"class Test
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.AllowEventAddBlockInline = true;
policy.AllowEventRemoveBlockInline = false;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data);
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Console.WriteLine (data.Document.Text);
Assert.AreEqual (@"class Test
{ {
public event EventHandler Handler { public event EventHandler Handler {
add { ; } add { ; }
@ -489,31 +382,24 @@ namespace B {
; ;
} }
} }
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestAllowEventRemoveBlockInline () public void TestAllowEventRemoveBlockInline ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs"; policy.AllowEventAddBlockInline = false;
data.Document.Text = @"class Test policy.AllowEventRemoveBlockInline = true;
Test (policy, @"class Test
{ {
public event EventHandler Handler { public event EventHandler Handler {
add { ; } add { ; }
remove { ; } remove { ; }
} }
}"; }",
@"class Test
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.AllowEventAddBlockInline = false;
policy.AllowEventRemoveBlockInline = true;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data);
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Console.WriteLine (data.Document.Text);
Assert.AreEqual (@"class Test
{ {
public event EventHandler Handler { public event EventHandler Handler {
add { add {
@ -521,10 +407,7 @@ namespace B {
} }
remove { ; } remove { ; }
} }
}", data.Document.Text); }");
} }
} }
}*/ }

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

@ -23,27 +23,16 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
/*
using System; using System;
using System.IO;
using NUnit.Framework; using NUnit.Framework;
using MonoDevelop.Ide.Gui; using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Projects;
using MonoDevelop.Core; namespace ICSharpCode.NRefactory.FormattingTests
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Projects.Dom.Parser;
using MonoDevelop.CSharp.Parser;
using MonoDevelop.CSharp.Resolver;
using MonoDevelop.CSharp.Completion;
using Mono.TextEditor;
using MonoDevelop.CSharp.Formatting;
using System.Collections.Generic;
using MonoDevelop.Refactoring;
namespace MonoDevelop.CSharpBinding.FormattingTests
{ {
[TestFixture()] [TestFixture()]
public class TestFormattingBugs : UnitTests.TestBase public class TestFormattingBugs : TestBase
{ {
/// <summary> /// <summary>
/// Bug 325187 - Bug in smart indent /// Bug 325187 - Bug in smart indent
@ -71,7 +60,6 @@ Console.WriteLine (""Bad indent"");",
/// Bug 415469 - return ternary in a switch is not tabbed properly /// Bug 415469 - return ternary in a switch is not tabbed properly
/// </summary> /// </summary>
[Test()] [Test()]
[Ignore("currently failing because of 'string' has the wrong offset - mcs bug")]
public void TestBug415469 () public void TestBug415469 ()
{ {
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
@ -111,52 +99,99 @@ using (IDisposable b = null) {
}"); }");
} }
/// <summary>
/// Bug 655635 - Auto format document doesn't indent comments as well
/// </summary>
[Test()]
public void TestBug655635 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
TestStatementFormatting (policy,
@"try {
// Comment 1
myObject.x = Run ();
} catch (InvalidOperationException e) {
Console.WriteLine (e.Message);
}", @"try {
// Comment 1
myObject.x = Run ();
} catch (InvalidOperationException e) {
Console.WriteLine (e.Message);
}");
}
void TestStatementFormatting (CSharpFormattingPolicy policy, string input, string expectedOutput)
static void TestStatementFormatting (CSharpFormattingPolicy policy, string input, string expectedOutput)
{ {
TextEditorData data = new TextEditorData (); var result = GetResult (policy, @"class Test
data.Document.FileName = "a.cs";
data.Document.Text =
@"class Test
{ {
MyType TestMethod () MyType TestMethod ()
{ {
" + input + @" " + input + @"
} }
}"; }");
int start = result.GetLineOffset (5);
int end = result.GetLineOffset (result.LineCount - 1);
string text = result.GetTextAt (start, end - start).Trim ();
expectedOutput = expectedOutput.Replace ("\n", "\n\t\t");
Assert.AreEqual (expectedOutput, text);
}
/// <summary>
/// Bug 659675 - on-the-fly code formatting breaks @-prefixed identifiers
/// </summary>
[Test()]
public void TestBug659675 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
TestStatementFormatting (policy, "@string=@int;", "@string = @int;");
}
Console.WriteLine (data.Document.Text); /// <summary>
/// Bug 670213 - Document formatter deletes valid text!
/// </summary>
[Test()]
public void TestBug670213 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.MethodBraceStyle = BraceStyle.EndOfLine;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); Test (policy, @"class Test
DomSpacingVisitor domSpacingVisitor = new DomSpacingVisitor (policy, data); {
domSpacingVisitor.AutoAcceptChanges = false; Test MyMethod() // Comment
compilationUnit.AcceptVisitor (domSpacingVisitor, null); {
}
}",
@"class Test
{
Test MyMethod () { // Comment
}
}");
}
DomIndentationVisitor domIndentationVisitor = new DomIndentationVisitor (policy, data);
domIndentationVisitor.AutoAcceptChanges = false;
compilationUnit.AcceptVisitor (domIndentationVisitor, null);
List<Change> changes = new List<Change> (); /// <summary>
changes.AddRange (domSpacingVisitor.Changes); /// Bug 677261 - Format Document with constructor with over-indented opening curly brace
changes.AddRange (domIndentationVisitor.Changes); /// </summary>
RefactoringService.AcceptChanges (null, null, changes); [Test()]
public void TestBug677261 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.ConstructorBraceStyle = BraceStyle.EndOfLine;
for (int i = 0; i < data.Document.LineCount; i++) { Test (policy, @"class Test
LineSegment line = data.Document.GetLine (i); {
if (line.EditableLength < 2) Test ()
continue; {
data.Remove (line.Offset, 2);
} }
string text = data.Document.GetTextBetween (data.Document.GetLine (4).Offset, }",
data.Document.GetLine (data.Document.LineCount - 2).Offset).Trim (); @"class Test
Console.WriteLine (text); {
Assert.AreEqual (expectedOutput, text); Test () {
}
}");
} }
} }
} }
*/

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

File diff suppressed because it is too large Load Diff

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

File diff suppressed because it is too large Load Diff

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

@ -23,164 +23,196 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
/*
using System; using System;
using System.IO;
using NUnit.Framework; using NUnit.Framework;
using MonoDevelop.Ide.Gui; using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Projects;
using MonoDevelop.Core; namespace ICSharpCode.NRefactory.FormattingTests
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Projects.Dom.Parser;
using MonoDevelop.CSharp.Parser;
using MonoDevelop.CSharp.Resolver;
using MonoDevelop.CSharp.Completion;
using Mono.TextEditor;
using MonoDevelop.CSharp.Formatting;
namespace MonoDevelop.CSharpBinding.FormattingTests
{ {
[TestFixture()] [TestFixture()]
public class TestTypeLevelIndentation : UnitTests.TestBase public class TestTypeLevelIndentation : TestBase
{ {
[Test()] [Test()]
public void TestClassIndentation () public void TestClassIndentation ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs"; policy.ClassBraceStyle = BraceStyle.DoNotChange;
data.Document.Text =
@" class Test {}"; Test (policy,
@" class Test {}",
@"class Test {}");
}
[Test()]
public void TestClassIndentationInNamespaces ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.NamespaceBraceStyle = BraceStyle.EndOfLine;
policy.ClassBraceStyle = BraceStyle.DoNotChange; policy.ClassBraceStyle = BraceStyle.DoNotChange;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); Test (policy,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"namespace A { class Test {} }",
Assert.AreEqual (@"class Test {}", data.Document.Text); @"namespace A {
class Test {}
}");
} }
[Test()] [Test()]
public void TestIndentClassBody () public void TestNoIndentationInNamespaces ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs"; policy.NamespaceBraceStyle = BraceStyle.EndOfLine;
data.Document.Text = policy.ClassBraceStyle = BraceStyle.DoNotChange;
@"class Test policy.IndentNamespaceBody = false;
Test (policy,
@"namespace A { class Test {} }",
@"namespace A {
class Test {}
}");
}
[Test()]
public void TestClassIndentationInNamespacesCase2 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.NamespaceBraceStyle = BraceStyle.NextLine;
policy.ClassBraceStyle = BraceStyle.NextLine;
policy.ConstructorBraceStyle = BraceStyle.NextLine;
Test (policy,
@"using System;
namespace MonoDevelop.CSharp.Formatting {
public class FormattingProfileService {
public FormattingProfileService () {
}
}
}",
@"using System;
namespace MonoDevelop.CSharp.Formatting
{ {
Test a; public class FormattingProfileService
}"; {
public FormattingProfileService ()
{
}
}
}");
}
[Test()]
public void TestIndentClassBody ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.IndentClassBody = true; policy.IndentClassBody = true;
Test (policy,
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); @"class Test
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Assert.AreEqual (@"class Test
{ {
Test a; Test a;
}", data.Document.Text); }", @"class Test
{
Test a;
}");
policy.IndentClassBody = false; policy.IndentClassBody = false;
compilationUnit = new CSharpParser ().Parse (data); Test (policy,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"class Test
Assert.AreEqual (@"class Test {
Test a;
}",
@"class Test
{ {
Test a; Test a;
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestIndentInterfaceBody () public void TestIndentInterfaceBody ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text =
@"interface Test
{
Test Foo ();
}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.IndentInterfaceBody = true; policy.IndentInterfaceBody = true;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); Test (policy,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"interface Test
Assert.AreEqual (@"interface Test
{ {
Test Foo (); Test Foo ();
}", data.Document.Text); }", @"interface Test
{
Test Foo ();
}");
policy.IndentInterfaceBody = false; policy.IndentInterfaceBody = false;
compilationUnit = new CSharpParser ().Parse (data); Test (policy,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"interface Test
Assert.AreEqual (@"interface Test {
Test Foo ();
}", @"interface Test
{ {
Test Foo (); Test Foo ();
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestIndentStructBody () public void TestIndentStructBody ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text =
@"struct Test
{
Test a;
}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.IndentStructBody = true; policy.IndentStructBody = true;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); Test (policy,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"struct Test
Assert.AreEqual (@"struct Test
{ {
Test a; Test Foo ();
}", data.Document.Text); }", @"struct Test
{
Test Foo ();
}");
policy.IndentStructBody = false; policy.IndentStructBody = false;
compilationUnit = new CSharpParser ().Parse (data); Test (policy,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"struct Test
Assert.AreEqual (@"struct Test
{ {
Test a; Test Foo ();
}", data.Document.Text); }", @"struct Test
{
Test Foo ();
}");
} }
[Test()] [Test()]
public void TestIndentEnumBody () public void TestIndentEnumBody ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text =
@"enum Test
{
A
}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.IndentEnumBody = true; policy.IndentEnumBody = true;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); Test (policy,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"enum Test
Assert.AreEqual (@"enum Test {
A
}", @"enum Test
{ {
A A
}", data.Document.Text); }");
policy.IndentEnumBody = false; policy.IndentEnumBody = false;
compilationUnit = new CSharpParser ().Parse (data); Test (policy,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"enum Test
Assert.AreEqual (@"enum Test {
A
}", @"enum Test
{ {
A A
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestIndentMethodBody () public void TestIndentMethodBody ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs"; policy.IndentMethodBody = true;
data.Document.Text =
Test (policy,
@"class Test @"class Test
{ {
Test Foo () Test Foo ()
@ -188,40 +220,42 @@ A
; ;
; ;
} }
}"; }",
@"class Test
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.IndentMethodBody = true;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data);
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Assert.AreEqual (@"class Test
{ {
Test Foo () Test Foo ()
{ {
; ;
; ;
} }
}", data.Document.Text); }");
policy.IndentMethodBody = false; policy.IndentMethodBody = false;
compilationUnit = new CSharpParser ().Parse (data); Test (policy,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"class Test
Assert.AreEqual (@"class Test
{ {
Test Foo () Test Foo ()
{ {
; ;
; ;
} }
}", data.Document.Text); }",
@"class Test
{
Test Foo ()
{
;
;
}
}");
} }
[Test()] [Test()]
public void TestIndentMethodBodyOperatorCase () public void TestIndentMethodBodyOperatorCase ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs"; policy.IndentMethodBody = true;
data.Document.Text =
var adapter = Test (policy,
@"class Test @"class Test
{ {
static Test operator+(Test left, Test right) static Test operator+(Test left, Test right)
@ -229,78 +263,104 @@ A
; ;
; ;
} }
}"; }",
@"class Test
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.IndentMethodBody = true;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data);
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Assert.AreEqual (@"class Test
{ {
static Test operator+(Test left, Test right) static Test operator+ (Test left, Test right)
{ {
; ;
; ;
} }
}", data.Document.Text); }");
policy.IndentMethodBody = false; policy.IndentMethodBody = false;
compilationUnit = new CSharpParser ().Parse (data); Continue (policy, adapter, @"class Test
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Assert.AreEqual (@"class Test
{ {
static Test operator+(Test left, Test right) static Test operator+ (Test left, Test right)
{ {
; ;
; ;
} }
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestIndentPropertyBody () public void TestIndentPropertyBody ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs"; policy.IndentPropertyBody = true;
data.Document.Text =
var adapter = Test (policy,
@"class Test @"class Test
{ {
Test TestMe { Test TestMe {
get; get;
set; set;
} }
}"; }",
@"class Test
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.IndentPropertyBody = true;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data);
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Assert.AreEqual (@"class Test
{ {
Test TestMe { Test TestMe {
get; get;
set; set;
} }
}", data.Document.Text); }");
policy.IndentPropertyBody = false; policy.IndentPropertyBody = false;
compilationUnit = new CSharpParser ().Parse (data);
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); Continue (policy, adapter,
Assert.AreEqual (@"class Test @"class Test
{ {
Test TestMe { Test TestMe {
get; get;
set; set;
} }
}", data.Document.Text); }");
}
[Test()]
public void TestIndentPropertyOneLine ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.PropertyFormatting = PropertyFormatting.AllowOneLine;
policy.AllowPropertyGetBlockInline = true;
policy.AllowPropertySetBlockInline = true;
Test (policy,
@"class Test
{
Test TestMe { get;set; }
}",
@"class Test
{
Test TestMe { get; set; }
}");
}
[Test()]
public void TestIndentPropertyOneLineCase2 ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.PropertyFormatting = PropertyFormatting.AllowOneLine;
policy.AllowPropertyGetBlockInline = true;
policy.AllowPropertySetBlockInline = true;
Test (policy,
@"class Test
{
Test TestMe { get { ; }set{;} }
}",
@"class Test
{
Test TestMe { get { ; } set { ; } }
}");
} }
[Test()] [Test()]
public void TestIndentPropertyBodyIndexerCase () public void TestIndentPropertyBodyIndexerCase ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs"; policy.IndentPropertyBody = true;
data.Document.Text =
var adapter = Test (policy,
@"class Test @"class Test
{ {
Test this[int a] { Test this[int a] {
@ -311,16 +371,10 @@ set {
; ;
} }
} }
}"; }",
@"class Test
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.IndentPropertyBody = true;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data);
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Assert.AreEqual (@"class Test
{ {
Test this[int a] { Test this [int a] {
get { get {
return null; return null;
} }
@ -328,13 +382,12 @@ set {
; ;
} }
} }
}", data.Document.Text); }");
policy.IndentPropertyBody = false; policy.IndentPropertyBody = false;
compilationUnit = new CSharpParser ().Parse (data); Continue (policy, adapter,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"class Test
Assert.AreEqual (@"class Test
{ {
Test this[int a] { Test this [int a] {
get { get {
return null; return null;
} }
@ -342,117 +395,129 @@ set {
; ;
} }
} }
}", data.Document.Text); }");
} }
[Test()] [Test()]
[Ignore("currently failing because namespaces are not inserted")] public void TestPropertyAlignment ()
public void TestIndentNamespaceBody ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs"; policy.PropertyFormatting = PropertyFormatting.AllowOneLine;
data.Document.Text = var adapter = Test (policy,
@" namespace Test { @"class Test
class FooBar {} {
}"; Test TestMe { get; set; }
}",
@"class Test
{
Test TestMe { get; set; }
}");
policy.PropertyFormatting = PropertyFormatting.ForceNewLine;
Continue (policy, adapter,
@"class Test
{
Test TestMe {
get;
set;
}
}");
policy.PropertyFormatting = PropertyFormatting.ForceOneLine;
Continue (policy, adapter,
@"class Test
{
Test TestMe { get; set; }
}");
}
[Test()]
public void TestIndentNamespaceBody ()
{
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.ClassBraceStyle = BraceStyle.DoNotChange; policy.ClassBraceStyle = BraceStyle.DoNotChange;
policy.NamespaceBraceStyle = BraceStyle.EndOfLine;
policy.IndentNamespaceBody = true; policy.IndentNamespaceBody = true;
var adapter = Test (policy,
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); @" namespace Test {
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); class FooBar {}
Assert.AreEqual (@"namespace Test { }",
@"namespace Test {
class FooBar {} class FooBar {}
}", data.Document.Text); }");
policy.IndentNamespaceBody = false; policy.IndentNamespaceBody = false;
compilationUnit = new CSharpParser ().Parse (data); Continue (policy, adapter,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"namespace Test {
Assert.AreEqual (@"namespace Test {
class FooBar {} class FooBar {}
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestMethodIndentation () public void TestMethodIndentation ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text =
@"class Test
{
MyType TestMethod () {}
}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.MethodBraceStyle = BraceStyle.DoNotChange; policy.MethodBraceStyle = BraceStyle.DoNotChange;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); Test (policy,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"class Test
Assert.AreEqual (@"class Test {
MyType TestMethod () {}
}",
@"class Test
{ {
MyType TestMethod () {} MyType TestMethod () {}
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestPropertyIndentation () public void TestPropertyIndentation ()
{ {
TextEditorData data = new TextEditorData ();
data.Document.FileName = "a.cs";
data.Document.Text =
@"class Test
{
public int Prop { get; set; }
}";
CSharpFormattingPolicy policy = new CSharpFormattingPolicy (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.PropertyBraceStyle = BraceStyle.DoNotChange; policy.PropertyBraceStyle = BraceStyle.DoNotChange;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data); Test (policy,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"class Test
Assert.AreEqual (@"class Test
{ {
public int Prop { get; set; } public int Prop { get; set; }
}", data.Document.Text); }",@"class Test
{
public int Prop { get; set; }
}");
} }
[Test()] [Test()]
public void TestPropertyIndentationCase2 () public void TestPropertyIndentationCase2 ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs";
data.Document.Text = Test (policy,
@"class Test @"class Test
{ {
public int Prop { public int Prop {
get; get;
set; set;
} }
}"; }",
@"class Test
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data);
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Assert.AreEqual (@"class Test
{ {
public int Prop { public int Prop {
get; get;
set; set;
} }
}", data.Document.Text); }");
} }
[Test()] [Test()]
public void TestIndentEventBody () public void TestIndentEventBody ()
{ {
TextEditorData data = new TextEditorData (); CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
data.Document.FileName = "a.cs"; policy.IndentEventBody = true;
data.Document.Text =
var adapter = Test (policy,
@"class Test @"class Test
{ {
public event EventHandler TestMe { public event EventHandler TestMe {
@ -463,14 +528,8 @@ remove {
; ;
} }
} }
}"; }",
@"class Test
CSharpFormattingPolicy policy = new CSharpFormattingPolicy ();
policy.IndentEventBody = true;
CSharp.Dom.CompilationUnit compilationUnit = new CSharpParser ().Parse (data);
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null);
Assert.AreEqual (@"class Test
{ {
public event EventHandler TestMe { public event EventHandler TestMe {
add { add {
@ -480,11 +539,10 @@ remove {
; ;
} }
} }
}", data.Document.Text); }");
policy.IndentEventBody = false; policy.IndentEventBody = false;
compilationUnit = new CSharpParser ().Parse (data); Continue (policy, adapter,
compilationUnit.AcceptVisitor (new DomIndentationVisitor (policy, data), null); @"class Test
Assert.AreEqual (@"class Test
{ {
public event EventHandler TestMe { public event EventHandler TestMe {
add { add {
@ -494,7 +552,7 @@ remove {
; ;
} }
} }
}", data.Document.Text); }");
} }
} }
}*/ }

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

@ -0,0 +1,261 @@
using System;
using System.Collections.Generic;
using ICSharpCode.NRefactory.CSharp;
using System.IO;
using NUnit.Framework;
namespace ICSharpCode.NRefactory.FormattingTests
{
/// <summary>
/// Text editor test adapter. Only implemented for testing purposes. Don't use in production code.
/// </summary>
class TextEditorTestAdapter : ITextEditorAdapter
{
string text;
public string Text {
get {
return this.text;
}
}
List<Delimiter> delimiters;
struct Delimiter
{
public readonly int Offset;
public readonly int Length;
public int EndOffset {
get { return Offset + Length; }
}
public Delimiter (int offset, int length)
{
Offset = offset;
Length = length;
}
public override string ToString ()
{
return string.Format ("[Delimiter: Offset={0}, Length={1}]", Offset, Length);
}
}
static IEnumerable<Delimiter> FindDelimiter (string text)
{
for (int i = 0; i < text.Length; i++) {
switch (text [i]) {
case '\r':
if (i + 1 < text.Length && text [i + 1] == '\n') {
yield return new Delimiter (i, 2);
i++;
} else {
yield return new Delimiter (i, 1);
}
break;
case '\n':
yield return new Delimiter (i, 1);
break;
}
}
}
public TextEditorTestAdapter (string text)
{
this.text = text;
delimiters = new List<Delimiter> (FindDelimiter (text));
}
class Segment
{
public readonly int Offset;
public readonly int Length;
public readonly int DelimiterLength;
public Segment (int offset, int length, int delimiterLength)
{
this.Offset = offset;
this.Length = length;
this.DelimiterLength = delimiterLength;
}
public override string ToString ()
{
return string.Format ("[Segment: Offset={0}, Length={1}, DelimiterLength={2}]", Offset, Length, DelimiterLength);
}
}
Segment Get (int number)
{
number--;
if (number < 0 || number - 1 >= delimiters.Count)
return null;
int startOffset = number > 0 ? delimiters [number - 1].EndOffset : 0;
int endOffset;
int delimiterLength;
if (number < delimiters.Count) {
endOffset = delimiters [number].EndOffset;
delimiterLength = delimiters [number].Length;
} else {
endOffset = text.Length;
delimiterLength = 0;
}
return new Segment (startOffset, endOffset - startOffset, delimiterLength);
}
public void ApplyChanges (List<Change> changes)
{
changes.Sort ((x, y) => x.Offset.CompareTo (y.Offset));
changes.Reverse ();
foreach (var change in changes) {
text = text.Substring (0, change.Offset) + change.InsertedText + text.Substring (change.Offset + change.RemovedChars);
}
delimiters = new List<Delimiter> (FindDelimiter (text));
}
#region ITextEditorAdapter implementation
public int LocationToOffset (int line, int col)
{
Segment seg = Get (line);
if (seg == null)
return 0;
return seg.Offset + col - 1;
}
public char GetCharAt (int offset)
{
if (offset < 0 || offset >= text.Length)
return '\0';
return text [offset];
}
public string GetTextAt (int offset, int length)
{
if (offset < 0 || offset + length >= text.Length)
return "";
if (length <= 0)
return "";
return text.Substring (offset, length);
}
public int GetEditableLength (int lineNumber)
{
var seg = Get (lineNumber);
if (seg == null)
return 0;
return seg.Length - seg.DelimiterLength;
}
public string GetIndentation (int lineNumber)
{
var seg = Get (lineNumber);
if (seg == null)
return "";
int start = seg.Offset;
int end = seg.Offset;
int endOffset = seg.Offset + seg.Length - seg.DelimiterLength;
while (end < endOffset && (text[end] == ' ' || text[end] == '\t'))
end++;
return start < end ? text.Substring (start, end - start) : "";
}
public int GetLineOffset (int lineNumber)
{
var seg = Get (lineNumber);
if (seg == null)
return 0;
return seg.Offset;
}
public int GetLineLength (int lineNumber)
{
var seg = Get (lineNumber);
if (seg == null)
return 0;
return seg.Length;
}
public int GetLineEndOffset (int lineNumber)
{
var seg = Get (lineNumber);
if (seg == null)
return 0;
return seg.Offset + seg.Length;
}
public bool TabsToSpaces {
get {
return false;
}
}
public int TabSize {
get {
return 4;
}
}
public string EolMarker {
get {
return Environment.NewLine;
}
}
public int Length {
get {
return text.Length;
}
}
public int LineCount {
get {
return delimiters.Count + 1;
}
}
#endregion
}
public abstract class TestBase
{
protected static ITextEditorAdapter GetResult (CSharpFormattingPolicy policy, string input)
{
var adapter = new TextEditorTestAdapter (input);
var visitior = new AstFormattingVisitor (policy, adapter);
var compilationUnit = new CSharpParser ().Parse (new StringReader (adapter.Text));
compilationUnit.AcceptVisitor (visitior, null);
adapter.ApplyChanges (visitior.Changes);
return adapter;
}
protected static ITextEditorAdapter Test (CSharpFormattingPolicy policy, string input, string expectedOutput)
{
var adapter = new TextEditorTestAdapter (input);
var visitior = new AstFormattingVisitor (policy, adapter);
var compilationUnit = new CSharpParser ().Parse (new StringReader (adapter.Text));
compilationUnit.AcceptVisitor (visitior, null);
adapter.ApplyChanges (visitior.Changes);
Assert.AreEqual (expectedOutput, adapter.Text);
return adapter;
}
protected static void Continue (CSharpFormattingPolicy policy, ITextEditorAdapter adapter, string expectedOutput)
{
var visitior = new AstFormattingVisitor (policy, adapter);
var compilationUnit = new CSharpParser ().Parse (new StringReader (adapter.Text));
compilationUnit.AcceptVisitor (visitior, null);
((TextEditorTestAdapter)adapter).ApplyChanges (visitior.Changes);
Assert.AreEqual (expectedOutput, adapter.Text);
}
}
}

21
NRefactory/ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj

@ -11,7 +11,6 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<ProductVersion>10.0.0</ProductVersion> <ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' "> <PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
@ -33,23 +32,17 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="nunit.framework"> <Reference Include="nunit.framework">
<HintPath>..\lib\nunit.framework.dll</HintPath> <HintPath>..\..\Mono.Cecil\Test\libs\nunit-2.4.8\nunit.framework.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core"> <Reference Include="System.Core">
@ -155,6 +148,8 @@
<Compile Include="Untested.cs" /> <Compile Include="Untested.cs" />
<Compile Include="Utils\CSharpPrimitiveCastTests.cs" /> <Compile Include="Utils\CSharpPrimitiveCastTests.cs" />
<Compile Include="Utils\TreeTraversalTests.cs" /> <Compile Include="Utils\TreeTraversalTests.cs" />
<Compile Include="FormattingTests\TextEditorTestAdapter.cs" />
<Compile Include="FormattingTests\TestBlankLineFormatting.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj"> <ProjectReference Include="..\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
@ -163,11 +158,11 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="CSharp\Analysis" /> <Folder Include="CSharp\" />
<Folder Include="CSharp\Parser\Expression" /> <Folder Include="CSharp\Parser\" />
<Folder Include="CSharp\Parser\GeneralScope" /> <Folder Include="CSharp\Parser\" />
<Folder Include="CSharp\Parser\TypeMembers" /> <Folder Include="CSharp\Parser\" />
<Folder Include="CSharp\Parser\Statements" /> <Folder Include="CSharp\Parser\" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project> </Project>

10
NRefactory/ICSharpCode.NRefactory.VB.Tests/General/UnitTest.cs

@ -4,7 +4,7 @@
using System; using System;
using System.Reflection; using System.Reflection;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Visitors; using ICSharpCode.NRefactory.VB.Visitors;
@ -58,10 +58,10 @@ namespace ICSharpCode.NRefactory.VB.Tests
// } // }
[Test] [Test]
public void TestIDomVisitor() public void TestIAstVisitor()
{ {
Type[] allTypes = typeof(AbstractNode).Assembly.GetTypes(); Type[] allTypes = typeof(AbstractNode).Assembly.GetTypes();
Type visitor = typeof(IDomVisitor); Type visitor = typeof(IAstVisitor);
foreach (Type type in allTypes) { foreach (Type type in allTypes) {
if (type.IsClass && !type.IsAbstract && !type.IsNested && type.GetInterface(typeof(INode).FullName) != null && !type.Name.StartsWith("Null")) { if (type.IsClass && !type.IsAbstract && !type.IsNested && type.GetInterface(typeof(INode).FullName) != null && !type.Name.StartsWith("Null")) {
@ -79,10 +79,10 @@ namespace ICSharpCode.NRefactory.VB.Tests
} }
[Test] [Test]
public void TestAbstractDomVisitorVisitor() public void TestAbstractAstVisitorVisitor()
{ {
Type[] allTypes = typeof(AbstractNode).Assembly.GetTypes(); Type[] allTypes = typeof(AbstractNode).Assembly.GetTypes();
Type visitor = typeof(AbstractDomVisitor); Type visitor = typeof(AbstractAstVisitor);
foreach (Type type in allTypes) { foreach (Type type in allTypes) {
if (type.IsClass && !type.IsAbstract && !type.IsNested && type.GetInterface(typeof(INode).FullName) != null && !type.Name.StartsWith("Null")) { if (type.IsClass && !type.IsAbstract && !type.IsNested && type.GetInterface(typeof(INode).FullName) != null && !type.Name.StartsWith("Null")) {

2
NRefactory/ICSharpCode.NRefactory.VB.Tests/Lexer/LexerContextTests.cs

@ -479,6 +479,7 @@ End Module",
enter Expression enter Expression
enter ObjectCreation enter ObjectCreation
enter Expression enter Expression
enter Expression
enter Expression enter Expression
enter Expression enter Expression
exit Expression exit Expression
@ -490,6 +491,7 @@ End Module",
exit Expression exit Expression
exit Expression exit Expression
exit Expression exit Expression
exit Expression
exit ObjectCreation exit ObjectCreation
exit Expression exit Expression
exit Expression exit Expression

2
NRefactory/ICSharpCode.NRefactory.VB.Tests/Output/CodeDOM/CodeDOMParenthesizedExpressionTest.cs

@ -3,7 +3,7 @@
using System; using System;
using System.CodeDom; using System.CodeDom;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using ICSharpCode.NRefactory.VB.Visitors; using ICSharpCode.NRefactory.VB.Visitors;
using NUnit.Framework; using NUnit.Framework;

2
NRefactory/ICSharpCode.NRefactory.VB.Tests/Output/CodeDOM/CodeDOMPrimitiveExpressionTest.cs

@ -3,7 +3,7 @@
using System; using System;
using System.CodeDom; using System.CodeDom;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using ICSharpCode.NRefactory.VB.Visitors; using ICSharpCode.NRefactory.VB.Visitors;
using NUnit.Framework; using NUnit.Framework;

2
NRefactory/ICSharpCode.NRefactory.VB.Tests/Output/CodeDOM/CodeDOMTypeReferenceTest.cs

@ -5,7 +5,7 @@ using System;
using System.CodeDom; using System.CodeDom;
using System.Collections.Generic; using System.Collections.Generic;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using ICSharpCode.NRefactory.VB.Visitors; using ICSharpCode.NRefactory.VB.Visitors;
using NUnit.Framework; using NUnit.Framework;

2
NRefactory/ICSharpCode.NRefactory.VB.Tests/Output/CodeDOM/InvocationExpressionTest.cs

@ -5,7 +5,7 @@ using System;
using System.CodeDom; using System.CodeDom;
using System.Collections.Generic; using System.Collections.Generic;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using ICSharpCode.NRefactory.VB.Visitors; using ICSharpCode.NRefactory.VB.Visitors;
using NUnit.Framework; using NUnit.Framework;

2
NRefactory/ICSharpCode.NRefactory.VB.Tests/Output/SpecialOutputVisitorTest.cs

@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.PrettyPrinter; using ICSharpCode.NRefactory.VB.PrettyPrinter;
using ICSharpCode.NRefactory.VB.Visitors; using ICSharpCode.NRefactory.VB.Visitors;

2
NRefactory/ICSharpCode.NRefactory.VB.Tests/Output/VBNet/VBNetOutputTest.cs

@ -3,7 +3,7 @@
using System; using System;
using System.IO; using System.IO;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.PrettyPrinter; using ICSharpCode.NRefactory.VB.PrettyPrinter;
using ICSharpCode.NRefactory.VB.Visitors; using ICSharpCode.NRefactory.VB.Visitors;

6
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/CheckParentVisitor.cs

@ -4,15 +4,15 @@
using NUnit.Framework; using NUnit.Framework;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using ICSharpCode.NRefactory.VB.Visitors; using ICSharpCode.NRefactory.VB.Visitors;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
/// <summary> /// <summary>
/// Ensures that all nodes have the Parent property correctly set. /// Ensures that all nodes have the Parent property correctly set.
/// </summary> /// </summary>
public class CheckParentVisitor : NodeTrackingDomVisitor public class CheckParentVisitor : NodeTrackingAstVisitor
{ {
Stack<INode> nodeStack = new Stack<INode>(); Stack<INode> nodeStack = new Stack<INode>();

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/AddressOfExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class AddressOfExpressionTests public class AddressOfExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/ArrayCreateExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ArrayCreateExpressionTests public class ArrayCreateExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/AssignmentExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class AssignmentExpressionTests public class AssignmentExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/BaseReferenceExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class BaseReferenceExpressionTests public class BaseReferenceExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/BinaryOperatorExpressionTests.cs

@ -5,10 +5,10 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using ICSharpCode.NRefactory.VB.PrettyPrinter; using ICSharpCode.NRefactory.VB.PrettyPrinter;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class BinaryOperatorExpressionTests public class BinaryOperatorExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/CastExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class CastExpressionTests public class CastExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/ClassReferenceExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ClassReferenceExpressionTests public class ClassReferenceExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/ConditionalExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ConditionalExpressionTests public class ConditionalExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/GlobalReferenceExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class GlobalReferenceExpressionTests public class GlobalReferenceExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/IdentifierExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class IdentifierExpressionTests public class IdentifierExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/InvocationExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class InvocationExpressionTests public class InvocationExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/LambdaExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class LambdaExpressionTests public class LambdaExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/MemberReferenceExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class MemberReferenceExpressionTests public class MemberReferenceExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/ObjectCreateExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ObjectCreateExpressionTests public class ObjectCreateExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/ParenthesizedExpressionTest.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ParenthesizedExpressionTests public class ParenthesizedExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/PrimitiveExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class PrimitiveExpressionTests public class PrimitiveExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/QueryExpressionTests.cs

@ -5,11 +5,11 @@ using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class QueryExpressionTests public class QueryExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/ThisReferenceExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ThisReferenceExpressionTests public class ThisReferenceExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/TypeOfExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class TypeOfExpressionTests public class TypeOfExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/TypeOfIsExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class TypeOfIsExpressionTests public class TypeOfIsExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/TypeReferenceExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class TypeReferenceExpressionTests public class TypeReferenceExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/UnaryOperatorExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class UnaryOperatorExpressionTests public class UnaryOperatorExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/XmlExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class XmlExpressionTests public class XmlExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Expressions/XmlMemberAccessExpressionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class XmlMemberAccessExpressionTests public class XmlMemberAccessExpressionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/GlobalScope/AttributeSectionTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class AttributeSectionTests public class AttributeSectionTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/GlobalScope/DelegateDeclarationTests.cs

@ -2,10 +2,10 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class DelegateDeclarationTests public class DelegateDeclarationTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/GlobalScope/NamespaceDeclarationTests.cs

@ -2,10 +2,10 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class NamespaceDeclarationTests public class NamespaceDeclarationTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/GlobalScope/OptionDeclarationTests.cs

@ -4,10 +4,10 @@
using System; using System;
using System.IO; using System.IO;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class OptionDeclarationTests public class OptionDeclarationTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/GlobalScope/TypeDeclarationTests.cs

@ -2,10 +2,10 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class TypeDeclarationTests public class TypeDeclarationTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/GlobalScope/UsingDeclarationTests.cs

@ -4,10 +4,10 @@
using System; using System;
using System.IO; using System.IO;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class UsingDeclarationTests public class UsingDeclarationTests

6
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/LocationAssignmentCheckVisitor.cs

@ -2,13 +2,13 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using ICSharpCode.NRefactory.VB.Visitors; using ICSharpCode.NRefactory.VB.Visitors;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
public class LocationAssignmentCheckVisitor : NodeTrackingDomVisitor public class LocationAssignmentCheckVisitor : NodeTrackingAstVisitor
{ {
protected override void BeginVisit(INode node) protected override void BeginVisit(INode node)
{ {

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

@ -4,10 +4,10 @@
using System; using System;
using System.IO; using System.IO;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
public class ParseUtil public class ParseUtil
{ {

2
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/SnippetParserTests.cs

@ -1,7 +1,7 @@
// 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 the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using System; using System;
using NUnit.Framework; using NUnit.Framework;

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/AddHandlerStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class AddHandlerStatementTests public class AddHandlerStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/BlockStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class BlockStatementTests public class BlockStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ContinueStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ContinueStatementTests public class ContinueStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/DoLoopStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class DoLoopStatementTests public class DoLoopStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/EndStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class EndStatementTests public class EndStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/EraseStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class EraseStatementTests public class EraseStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ErrorStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ErrorStatementTests public class ErrorStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ExpressionStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ExpressionStatementTests public class ExpressionStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ForNextStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ForNextStatementTests public class ForNextStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ForeachStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ForeachStatementTests public class ForeachStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/GotoStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class GotoStatementTests public class GotoStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/IfElseStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class IfElseStatementTests public class IfElseStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/LabelStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class LabelStatementTests public class LabelStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/LocalVariableDeclarationTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class LocalVariableDeclarationTests public class LocalVariableDeclarationTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/LockStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class LockStatementTests public class LockStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/OnErrorStatementTest.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class OnErrorStatementTest public class OnErrorStatementTest

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/RaiseEventStatementTest.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class RaiseEventStatementTest public class RaiseEventStatementTest

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ReDimStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ReDimStatementTests public class ReDimStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/RemoveHandlerStatement.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class RemoveHandlerStatementTests public class RemoveHandlerStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ResumeStatement.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ResumeStatementTests public class ResumeStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ReturnStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ReturnStatementTests public class ReturnStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/StopStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class StopStatementTests public class StopStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/SwitchStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class SwitchStatementTests public class SwitchStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/ThrowStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ThrowStatementTests public class ThrowStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/TryCatchStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class TryCatchStatementTests public class TryCatchStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/UsingStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class UsingStatementTests public class UsingStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/Statements/WithStatementTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class WithStatementTests public class WithStatementTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/ConstructorDeclarationTests.cs

@ -2,10 +2,10 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class ConstructorDeclarationTests public class ConstructorDeclarationTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/CustomEventTests.cs

@ -5,9 +5,9 @@ using System;
using System.IO; using System.IO;
using NUnit.Framework; using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class CustomEventTests public class CustomEventTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/DeclareDeclarationTests.cs

@ -2,10 +2,10 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class DeclareDeclarationTests public class DeclareDeclarationTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/EventDeclarationTests.cs

@ -2,10 +2,10 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class EventDeclarationTests public class EventDeclarationTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/FieldDeclarationTests.cs

@ -2,10 +2,10 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class FieldDeclarationTests public class FieldDeclarationTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/MethodDeclarationTests.cs

@ -2,10 +2,10 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class MethodDeclarationTests public class MethodDeclarationTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/OperatorDeclarationTests.cs

@ -2,10 +2,10 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class OperatorDeclarationTests public class OperatorDeclarationTests

4
NRefactory/ICSharpCode.NRefactory.VB.Tests/Parser/TypeLevel/PropertyDeclarationTests.cs

@ -3,10 +3,10 @@
using System; using System;
using System.IO; using System.IO;
using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Ast;
using NUnit.Framework; using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Dom namespace ICSharpCode.NRefactory.VB.Tests.Ast
{ {
[TestFixture] [TestFixture]
public class PropertyDeclarationTests public class PropertyDeclarationTests

6
NRefactory/ICSharpCode.NRefactory.VB/Dom/AbstractNode.cs → NRefactory/ICSharpCode.NRefactory.VB/Ast/AbstractNode.cs

@ -7,7 +7,7 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Text; using System.Text;
namespace ICSharpCode.NRefactory.VB.Dom namespace ICSharpCode.NRefactory.VB.Ast
{ {
public abstract class AbstractNode : INode public abstract class AbstractNode : INode
{ {
@ -35,9 +35,9 @@ namespace ICSharpCode.NRefactory.VB.Dom
children.Add(childNode); children.Add(childNode);
} }
public abstract object AcceptVisitor(IDomVisitor visitor, object data); public abstract object AcceptVisitor(IAstVisitor visitor, object data);
public virtual object AcceptChildren(IDomVisitor visitor, object data) public virtual object AcceptChildren(IAstVisitor visitor, object data)
{ {
foreach (INode child in children) { foreach (INode child in children) {
Debug.Assert(child != null); Debug.Assert(child != null);

2
NRefactory/ICSharpCode.NRefactory.VB/Dom/Enums.cs → NRefactory/ICSharpCode.NRefactory.VB/Ast/Enums.cs

@ -3,7 +3,7 @@
using System; using System;
namespace ICSharpCode.NRefactory.VB.Dom namespace ICSharpCode.NRefactory.VB.Ast
{ {
[Flags] [Flags]
public enum Modifiers public enum Modifiers

8
NRefactory/ICSharpCode.NRefactory.VB/Dom/General/BlockStatement.cs → NRefactory/ICSharpCode.NRefactory.VB/Ast/General/BlockStatement.cs

@ -3,7 +3,7 @@
using System; using System;
namespace ICSharpCode.NRefactory.VB.Dom namespace ICSharpCode.NRefactory.VB.Ast
{ {
public class BlockStatement : Statement public class BlockStatement : Statement
{ {
@ -15,7 +15,7 @@ namespace ICSharpCode.NRefactory.VB.Dom
} }
} }
public override object AcceptVisitor(IDomVisitor visitor, object data) public override object AcceptVisitor(IAstVisitor visitor, object data)
{ {
return visitor.VisitBlockStatement(this, data); return visitor.VisitBlockStatement(this, data);
} }
@ -37,11 +37,11 @@ namespace ICSharpCode.NRefactory.VB.Dom
} }
} }
public override object AcceptVisitor(IDomVisitor visitor, object data) public override object AcceptVisitor(IAstVisitor visitor, object data)
{ {
return data; return data;
} }
public override object AcceptChildren(IDomVisitor visitor, object data) public override object AcceptChildren(IAstVisitor visitor, object data)
{ {
return data; return data;
} }

4
NRefactory/ICSharpCode.NRefactory.VB/Dom/General/CompilationUnit.cs → NRefactory/ICSharpCode.NRefactory.VB/Ast/General/CompilationUnit.cs

@ -4,14 +4,14 @@
using System; using System;
using System.Collections; using System.Collections;
namespace ICSharpCode.NRefactory.VB.Dom namespace ICSharpCode.NRefactory.VB.Ast
{ {
public class CompilationUnit : AbstractNode public class CompilationUnit : AbstractNode
{ {
// Children in C#: UsingAliasDeclaration, UsingDeclaration, AttributeSection, NamespaceDeclaration // Children in C#: UsingAliasDeclaration, UsingDeclaration, AttributeSection, NamespaceDeclaration
// Children in VB: OptionStatements, ImportsStatement, AttributeSection, NamespaceDeclaration // Children in VB: OptionStatements, ImportsStatement, AttributeSection, NamespaceDeclaration
public override object AcceptVisitor(IDomVisitor visitor, object data) public override object AcceptVisitor(IAstVisitor visitor, object data)
{ {
return visitor.VisitCompilationUnit(this, data); return visitor.VisitCompilationUnit(this, data);
} }

4
NRefactory/ICSharpCode.NRefactory.VB/Dom/General/Expression.cs → NRefactory/ICSharpCode.NRefactory.VB/Ast/General/Expression.cs

@ -3,7 +3,7 @@
using System; using System;
namespace ICSharpCode.NRefactory.VB.Dom namespace ICSharpCode.NRefactory.VB.Ast
{ {
public abstract class Expression : AbstractNode, INullable public abstract class Expression : AbstractNode, INullable
{ {
@ -90,7 +90,7 @@ namespace ICSharpCode.NRefactory.VB.Dom
} }
} }
public override object AcceptVisitor(IDomVisitor visitor, object data) public override object AcceptVisitor(IAstVisitor visitor, object data)
{ {
return null; return null;
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save