Skip to content

Commit

Permalink
7.8 - Don't let Roslyn crash VS
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamTheCoder committed Feb 15, 2020
1 parent 26d0623 commit 07cce6d
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 13 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
6 changes: 3 additions & 3 deletions CodeConverter.Web/CodeConverter.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<AssemblyVersion>7.7.0.0</AssemblyVersion>
<FileVersion>7.7.0.0</FileVersion>
<Version>7.7.0</Version>
<AssemblyVersion>7.8.0.0</AssemblyVersion>
<FileVersion>7.8.0.0</FileVersion>
<Version>7.8.0</Version>
<LangVersion>7.3</LangVersion>
<NoWarn>$(NoWarn);1998</NoWarn>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions ICSharpCode.CodeConverter/ICSharpCode.CodeConverter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* Completely free and open source: Check out [GitHub](https://github.com/icsharpcode/CodeConverter#code-converter-).</Description>
<Product>Code Converter for C# to/from VB.NET</Product>
<Copyright>Copyright (c) 2017-2020 AlphaSierraPapa for the CodeConverter team</Copyright>
<AssemblyVersion>7.7.0.0</AssemblyVersion>
<FileVersion>7.7.0.0</FileVersion>
<Version>7.7.0</Version>
<AssemblyVersion>7.8.0.0</AssemblyVersion>
<FileVersion>7.8.0.0</FileVersion>
<Version>7.8.0</Version>
<PackageId>ICSharpCode.CodeConverter</PackageId>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
9 changes: 5 additions & 4 deletions ICSharpCode.CodeConverter/Shared/DocumentExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Vsix/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="7e2a69d6-193b-4cdf-878d-3370d5931942" Version="7.7.0.0" Language="en-US" Publisher="IC#Code"/>
<Identity Id="7e2a69d6-193b-4cdf-878d-3370d5931942" Version="7.8.0.0" Language="en-US" Publisher="IC#Code"/>
<DisplayName>Code Converter C# to/from VB.NET</DisplayName>
<Description xml:space="preserve">Based on Roslyn, this converter allows you to convert C# code to VB.NET and vice versa</Description>
<License>license.txt</License>
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
platform: Any CPU
version: 7.7.{build}
version: 7.8.{build}
configuration: Debug
image: Visual Studio 2019

Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 07cce6d

Please sign in to comment.