Skip to content

Commit 07cce6d

Browse files
7.8 - Don't let Roslyn crash VS
1 parent 26d0623 commit 07cce6d

File tree

7 files changed

+26
-13
lines changed

7 files changed

+26
-13
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1414
### C# -> VB
1515

1616

17+
## [7.8.0] - 2020-02-15
18+
19+
### Vsix
20+
21+
* Stop Roslyn from silently crashing Visual Studio during conversion [#521](https://github.com/icsharpcode/CodeConverter/issues/521)
22+
23+
### VB -> C#
24+
25+
26+
### C# -> VB
27+
28+
1729
## [7.7.0] - 2020-02-11
1830

1931

CodeConverter.Web/CodeConverter.Web.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
6-
<AssemblyVersion>7.7.0.0</AssemblyVersion>
7-
<FileVersion>7.7.0.0</FileVersion>
8-
<Version>7.7.0</Version>
6+
<AssemblyVersion>7.8.0.0</AssemblyVersion>
7+
<FileVersion>7.8.0.0</FileVersion>
8+
<Version>7.8.0</Version>
99
<LangVersion>7.3</LangVersion>
1010
<NoWarn>$(NoWarn);1998</NoWarn>
1111
</PropertyGroup>

ICSharpCode.CodeConverter/ICSharpCode.CodeConverter.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* Completely free and open source: Check out [GitHub](https://github.com/icsharpcode/CodeConverter#code-converter-).</Description>
1313
<Product>Code Converter for C# to/from VB.NET</Product>
1414
<Copyright>Copyright (c) 2017-2020 AlphaSierraPapa for the CodeConverter team</Copyright>
15-
<AssemblyVersion>7.7.0.0</AssemblyVersion>
16-
<FileVersion>7.7.0.0</FileVersion>
17-
<Version>7.7.0</Version>
15+
<AssemblyVersion>7.8.0.0</AssemblyVersion>
16+
<FileVersion>7.8.0.0</FileVersion>
17+
<Version>7.8.0</Version>
1818
<PackageId>ICSharpCode.CodeConverter</PackageId>
1919
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2020
<PackageLicenseExpression>MIT</PackageLicenseExpression>

ICSharpCode.CodeConverter/Shared/DocumentExtensions.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ private static bool VbWouldBeSimplifiedIncorrectly(SyntaxNode n)
5151
{
5252
//Roslyn bug: empty argument list gets removed and changes behaviour: https://github.com/dotnet/roslyn/issues/40442
5353
// (Also null Expression blows up even though that's how conditional invocation on an IdentifierName happens)
54-
return n is VBSyntax.InvocationExpressionSyntax ies && (!ies.ArgumentList.Arguments.Any() || ies.Expression == null)
55-
|| n is VBSyntax.TryCastExpressionSyntax
56-
// Roslyn bug: Tries to simplify to "InferredFieldInitializerSyntax" which cannot be placed within an ObjectCreationExpression https://github.com/icsharpcode/CodeConverter/issues/484
57-
|| n is VBSyntax.ObjectCreationExpressionSyntax;
54+
if (n is VBSyntax.InvocationExpressionSyntax ies && (!ies.ArgumentList.Arguments.Any() || ies.Expression == null)
55+
|| n is VBSyntax.TryCastExpressionSyntax) return true;
56+
// Roslyn bug: Tries to simplify to "InferredFieldInitializerSyntax" which cannot be placed within an ObjectCreationExpression https://github.com/icsharpcode/CodeConverter/issues/484
57+
if (n is VBSyntax.ObjectCreationExpressionSyntax) return false;
58+
return false;
5859
}
5960

6061
private static bool CsWouldBeSimplifiedIncorrectly(SyntaxNode n)

Vsix/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<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">
33
<Metadata>
4-
<Identity Id="7e2a69d6-193b-4cdf-878d-3370d5931942" Version="7.7.0.0" Language="en-US" Publisher="IC#Code"/>
4+
<Identity Id="7e2a69d6-193b-4cdf-878d-3370d5931942" Version="7.8.0.0" Language="en-US" Publisher="IC#Code"/>
55
<DisplayName>Code Converter C# to/from VB.NET</DisplayName>
66
<Description xml:space="preserve">Based on Roslyn, this converter allows you to convert C# code to VB.NET and vice versa</Description>
77
<License>license.txt</License>

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
platform: Any CPU
2-
version: 7.7.{build}
2+
version: 7.8.{build}
33
configuration: Debug
44
image: Visual Studio 2019
55

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pr:
77
variables:
88
solution: '**/CodeConverter.sln'
99
buildPlatform: 'Any CPU'
10-
buildVersion: '7.7.$(Build.BuildId)'
10+
buildVersion: '7.8.$(Build.BuildId)'
1111

1212
pool:
1313
vmImage: 'windows-2019'

0 commit comments

Comments
 (0)