diff --git a/CHANGELOG.md b/CHANGELOG.md index 6df858c0d..1e2472e67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### C# -> VB +## [7.8.0] - 2020-02-15 + +### Vsix + +* Stop Roslyn from silently crashing Visual Studio during conversion [#521](https://github.com/icsharpcode/CodeConverter/issues/521) + +### VB -> C# + + +### C# -> VB + + ## [7.7.0] - 2020-02-11 diff --git a/CodeConverter.Web/CodeConverter.Web.csproj b/CodeConverter.Web/CodeConverter.Web.csproj index ce89b82c1..47a4f5782 100644 --- a/CodeConverter.Web/CodeConverter.Web.csproj +++ b/CodeConverter.Web/CodeConverter.Web.csproj @@ -3,9 +3,9 @@ netcoreapp3.1 InProcess - 7.7.0.0 - 7.7.0.0 - 7.7.0 + 7.8.0.0 + 7.8.0.0 + 7.8.0 7.3 $(NoWarn);1998 diff --git a/ICSharpCode.CodeConverter/ICSharpCode.CodeConverter.csproj b/ICSharpCode.CodeConverter/ICSharpCode.CodeConverter.csproj index 24999a7b5..74061670c 100644 --- a/ICSharpCode.CodeConverter/ICSharpCode.CodeConverter.csproj +++ b/ICSharpCode.CodeConverter/ICSharpCode.CodeConverter.csproj @@ -12,9 +12,9 @@ * Completely free and open source: Check out [GitHub](https://github.com/icsharpcode/CodeConverter#code-converter-). Code Converter for C# to/from VB.NET Copyright (c) 2017-2020 AlphaSierraPapa for the CodeConverter team - 7.7.0.0 - 7.7.0.0 - 7.7.0 + 7.8.0.0 + 7.8.0.0 + 7.8.0 ICSharpCode.CodeConverter true MIT diff --git a/ICSharpCode.CodeConverter/Shared/DocumentExtensions.cs b/ICSharpCode.CodeConverter/Shared/DocumentExtensions.cs index a08feb725..1bb498f37 100644 --- a/ICSharpCode.CodeConverter/Shared/DocumentExtensions.cs +++ b/ICSharpCode.CodeConverter/Shared/DocumentExtensions.cs @@ -51,10 +51,11 @@ private static bool VbWouldBeSimplifiedIncorrectly(SyntaxNode n) { //Roslyn bug: empty argument list gets removed and changes behaviour: https://github.com/dotnet/roslyn/issues/40442 // (Also null Expression blows up even though that's how conditional invocation on an IdentifierName happens) - return n is VBSyntax.InvocationExpressionSyntax ies && (!ies.ArgumentList.Arguments.Any() || ies.Expression == null) - || n is VBSyntax.TryCastExpressionSyntax - // Roslyn bug: Tries to simplify to "InferredFieldInitializerSyntax" which cannot be placed within an ObjectCreationExpression https://github.com/icsharpcode/CodeConverter/issues/484 - || n is VBSyntax.ObjectCreationExpressionSyntax; + if (n is VBSyntax.InvocationExpressionSyntax ies && (!ies.ArgumentList.Arguments.Any() || ies.Expression == null) + || n is VBSyntax.TryCastExpressionSyntax) return true; + // Roslyn bug: Tries to simplify to "InferredFieldInitializerSyntax" which cannot be placed within an ObjectCreationExpression https://github.com/icsharpcode/CodeConverter/issues/484 + if (n is VBSyntax.ObjectCreationExpressionSyntax) return false; + return false; } private static bool CsWouldBeSimplifiedIncorrectly(SyntaxNode n) diff --git a/Vsix/source.extension.vsixmanifest b/Vsix/source.extension.vsixmanifest index 55f54f27d..1cc08fdc1 100644 --- a/Vsix/source.extension.vsixmanifest +++ b/Vsix/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + Code Converter C# to/from VB.NET Based on Roslyn, this converter allows you to convert C# code to VB.NET and vice versa license.txt diff --git a/appveyor.yml b/appveyor.yml index 07458378a..e6ea23ba7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ platform: Any CPU -version: 7.7.{build} +version: 7.8.{build} configuration: Debug image: Visual Studio 2019 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4846e9bfd..0e5e0fd94 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ pr: variables: solution: '**/CodeConverter.sln' buildPlatform: 'Any CPU' - buildVersion: '7.7.$(Build.BuildId)' + buildVersion: '7.8.$(Build.BuildId)' pool: vmImage: 'windows-2019'