diff --git a/ICSharpCode.Decompiler/Ast/TextTokenWriter.cs b/ICSharpCode.Decompiler/Ast/TextTokenWriter.cs index a8e9535cf..bd5c71698 100644 --- a/ICSharpCode.Decompiler/Ast/TextTokenWriter.cs +++ b/ICSharpCode.Decompiler/Ast/TextTokenWriter.cs @@ -291,7 +291,7 @@ namespace ICSharpCode.Decompiler.Ast public override void WritePrimitiveValue(object value, string literalValue = null) { - + new TextWriterTokenWriter(new TextOutputWriter(output)).WritePrimitiveValue(value, literalValue); } public override void WritePrimitiveType(string type) diff --git a/ICSharpCode.Decompiler/DecompilerSettings.cs b/ICSharpCode.Decompiler/DecompilerSettings.cs index 6412db5f5..74bdc9433 100644 --- a/ICSharpCode.Decompiler/DecompilerSettings.cs +++ b/ICSharpCode.Decompiler/DecompilerSettings.cs @@ -321,6 +321,7 @@ namespace ICSharpCode.Decompiler if (csharpFormattingOptions == null) { csharpFormattingOptions = FormattingOptionsFactory.CreateAllman(); csharpFormattingOptions.IndentSwitchBody = false; + csharpFormattingOptions.ArrayInitializerWrapping = Wrapping.WrapAlways; } return csharpFormattingOptions; } diff --git a/ICSharpCode.Decompiler/Tests/QueryExpressions.cs b/ICSharpCode.Decompiler/Tests/QueryExpressions.cs index 28d80b4d6..d8b6e0623 100644 --- a/ICSharpCode.Decompiler/Tests/QueryExpressions.cs +++ b/ICSharpCode.Decompiler/Tests/QueryExpressions.cs @@ -52,8 +52,7 @@ public class QueryExpressions public object MultipleWhere() { - return - from c in this.customers + return from c in this.customers where c.Orders.Count() > 10 where c.Country == "DE" select c; @@ -61,8 +60,7 @@ public class QueryExpressions public object SelectManyFollowedBySelect() { - return - from c in this.customers + return from c in this.customers from o in c.Orders select new { @@ -74,8 +72,7 @@ public class QueryExpressions public object SelectManyFollowedByOrderBy() { - return - from c in this.customers + return from c in this.customers from o in c.Orders orderby o.Total descending select new @@ -88,8 +85,7 @@ public class QueryExpressions public object MultipleSelectManyFollowedBySelect() { - return - from c in this.customers + return from c in this.customers from o in c.Orders from d in o.Details select new @@ -102,8 +98,7 @@ public class QueryExpressions public object MultipleSelectManyFollowedByLet() { - return - from c in this.customers + return from c in this.customers from o in c.Orders from d in o.Details let x = d.Quantity * d.UnitPrice @@ -117,8 +112,7 @@ public class QueryExpressions public object FromLetWhereSelect() { - return - from o in this.orders + return from o in this.orders let t = o.Details.Sum((QueryExpressions.OrderDetail d) => d.UnitPrice * d.Quantity) where t >= 1000m select new @@ -130,8 +124,7 @@ public class QueryExpressions public object MultipleLet() { - return - from a in this.customers + return from a in this.customers let b = a.Country let c = a.Name select b + c; @@ -139,8 +132,7 @@ public class QueryExpressions public object Join() { - return - from c in this.customers + return from c in this.customers join o in this.orders on c.CustomerID equals o.CustomerID select new { @@ -152,8 +144,7 @@ public class QueryExpressions public object JoinInto() { - return - from c in this.customers + return from c in this.customers join o in this.orders on c.CustomerID equals o.CustomerID into co let n = co.Count() where n >= 10 @@ -166,31 +157,27 @@ public class QueryExpressions public object OrderBy() { - return - from o in this.orders + return from o in this.orders orderby o.Customer.Name, o.Total descending select o; } public object GroupBy() { - return - from c in this.customers + return from c in this.customers group c.Name by c.Country; } public object ExplicitType() { - return - from QueryExpressions.Customer c in this.customers + return from QueryExpressions.Customer c in this.customers where c.City == "London" select c; } public object QueryContinuation() { - return - from c in this.customers + return from c in this.customers group c by c.Country into g select new { diff --git a/ILSpy/DecompileEventArgs.cs b/ILSpy/DecompileEventArgs.cs index 64d783f78..d0060c97c 100644 --- a/ILSpy/DecompileEventArgs.cs +++ b/ILSpy/DecompileEventArgs.cs @@ -32,11 +32,6 @@ namespace ICSharpCode.ILSpy [Obsolete] public sealed class DecompileEventArgs : EventArgs { - /// - /// Gets or sets the code mappings - /// - public Dictionary> CodeMappings { get; internal set; } - /// /// Gets or sets the local variables. /// diff --git a/ILSpy/ILSpy.csproj b/ILSpy/ILSpy.csproj index 1cd45b680..44c274807 100644 --- a/ILSpy/ILSpy.csproj +++ b/ILSpy/ILSpy.csproj @@ -58,6 +58,9 @@ ..\packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.dll + + ..\packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.Cecil.dll + ..\packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.CSharp.dll diff --git a/ILSpy/TextView/AvalonEditTextOutput.cs b/ILSpy/TextView/AvalonEditTextOutput.cs index 41d260027..d9ca52a77 100644 --- a/ILSpy/TextView/AvalonEditTextOutput.cs +++ b/ILSpy/TextView/AvalonEditTextOutput.cs @@ -92,7 +92,7 @@ namespace ICSharpCode.ILSpy.TextView /// Embedded UIElements, see . internal readonly List>> UIElements = new List>>(); - internal readonly List DebuggerMemberMappings = new List(); + internal readonly List DebuggerMemberMappings = new List(); public AvalonEditTextOutput() { @@ -250,9 +250,9 @@ namespace ICSharpCode.ILSpy.TextView } } - public void AddDebuggerMemberMapping(MemberMapping memberMapping) + public void AddDebugSymbols(MethodDebugSymbols methodDebugSymbols) { - DebuggerMemberMappings.Add(memberMapping); + DebuggerMemberMappings.Add(methodDebugSymbols); } } } diff --git a/NRefactory/ICSharpCode.NRefactory.VB/Visitors/CSharpToVBConverterVisitor.cs b/NRefactory/ICSharpCode.NRefactory.VB/Visitors/CSharpToVBConverterVisitor.cs index 4f6022bf0..be4a1a673 100644 --- a/NRefactory/ICSharpCode.NRefactory.VB/Visitors/CSharpToVBConverterVisitor.cs +++ b/NRefactory/ICSharpCode.NRefactory.VB/Visitors/CSharpToVBConverterVisitor.cs @@ -714,11 +714,6 @@ namespace ICSharpCode.NRefactory.VB.Visitors return EndNode(uncheckedExpression, uncheckedExpression.Expression.AcceptVisitor(this, data)); } - public AstNode VisitEmptyExpression(CSharp.EmptyExpression emptyExpression, object data) - { - return EndNode(emptyExpression, new EmptyExpression()); - } - public AstNode VisitQueryExpression(CSharp.QueryExpression queryExpression, object data) { var expr = new QueryExpression(); @@ -842,7 +837,9 @@ namespace ICSharpCode.NRefactory.VB.Visitors { var newNamespace = new NamespaceDeclaration(); - ConvertNodes(namespaceDeclaration.Identifiers, newNamespace.Identifiers); + foreach (string id in namespaceDeclaration.Identifiers) { + newNamespace.Identifiers.Add(new Identifier(id, TextLocation.Empty)); + } ConvertNodes(namespaceDeclaration.Members, newNamespace.Members); return EndNode(namespaceDeclaration, newNamespace); @@ -1656,7 +1653,7 @@ namespace ICSharpCode.NRefactory.VB.Visitors foreach (var type in current.ImplementsTypes) { var resolved = provider.ResolveType(type, current); - var found = resolved.GetMembers(m => m.EntityType == EntityType.Method && m.Name == result.Name.Name); + var found = resolved.GetMembers(m => m.SymbolKind == SymbolKind.Method && m.Name == result.Name.Name); if (found.FirstOrDefault() != null) { result.ImplementsClause.Add(new InterfaceMemberSpecifier((AstType)type.Clone(), found.FirstOrDefault().Name)); } @@ -1672,7 +1669,7 @@ namespace ICSharpCode.NRefactory.VB.Visitors foreach (var type in current.ImplementsTypes) { var resolved = provider.ResolveType(type, current); - var found = resolved.GetMembers(m => m.EntityType == EntityType.Event && m.Name == result.Name.Name); + var found = resolved.GetMembers(m => m.SymbolKind == SymbolKind.Event && m.Name == result.Name.Name); if (found.FirstOrDefault() != null) { result.ImplementsClause.Add(new InterfaceMemberSpecifier((AstType)type.Clone(), found.FirstOrDefault().Name)); } @@ -2271,5 +2268,15 @@ namespace ICSharpCode.NRefactory.VB.Visitors { return null; } + + public AstNode VisitNullNode(ICSharpCode.NRefactory.CSharp.AstNode nullNode, object data) + { + return null; + } + + public AstNode VisitErrorNode(ICSharpCode.NRefactory.CSharp.AstNode errorNode, object data) + { + return null; + } } } diff --git a/TestPlugin/TestPlugin.csproj b/TestPlugin/TestPlugin.csproj index 7c9e19429..2042d480c 100644 --- a/TestPlugin/TestPlugin.csproj +++ b/TestPlugin/TestPlugin.csproj @@ -43,6 +43,13 @@ bin\Release\ILSpy.exe + + ..\packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.dll + True + + + ..\packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.CSharp.dll + 3.0 @@ -79,6 +86,7 @@ + diff --git a/TestPlugin/packages.config b/TestPlugin/packages.config new file mode 100644 index 000000000..3cccab02b --- /dev/null +++ b/TestPlugin/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/packages/repositories.config b/packages/repositories.config index 3cb039ea5..8bee47440 100644 --- a/packages/repositories.config +++ b/packages/repositories.config @@ -5,4 +5,5 @@ + \ No newline at end of file