diff --git a/ChangeLog.md b/ChangeLog.md index 161e1d0b35..67b36e9f96 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -15,6 +15,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix analyzer [RCS1018](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1018) ([PR](https://github.com/dotnet/roslynator/pull/1510)) - Fix analyzer [RCS1264](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1264) ([PR](https://github.com/dotnet/roslynator/pull/1511)) +### Changed + +- Bump Roslyn to 4.11.0 ([PR](https://github.com/dotnet/roslynator/pull/1483)) + - Applies to CLI and testing library. + +### Removed + +- [CLI] Remove support for .NET SDK 6 ([PR](https://github.com/dotnet/roslynator/pull/1483)) + ## [4.12.4] - 2024-06-01 ### Fixed diff --git a/src/CommandLine/CommandLine.csproj b/src/CommandLine/CommandLine.csproj index 5394bca232..bdd567146d 100644 --- a/src/CommandLine/CommandLine.csproj +++ b/src/CommandLine/CommandLine.csproj @@ -5,7 +5,7 @@ - net6.0;net7.0;net8.0 + net7.0;net8.0 diff --git a/src/Directory.Build.props b/src/Directory.Build.props index dacd1f426d..efae532d43 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -31,8 +31,8 @@ 1.0.0 - 4.9.2 - 4.9.2 + 4.11.0 + 4.11.0 4.11.0 $(RoslynatorCliVersion) $(Version) diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/InitializerCodeFixProvider.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/InitializerCodeFixProvider.cs index d163ac9412..f06d897bb2 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/InitializerCodeFixProvider.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/InitializerCodeFixProvider.cs @@ -37,7 +37,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) { CodeAction codeAction = CodeAction.Create( "Put initializer on a single line", - ct => SyntaxFormatter.ToSingleLineAsync(document, initializer, removeTrailingComma: true, ct), + ct => SyntaxFormatter.ToSingleLineAsync(document, initializer, removeTrailingComma: false, ct), GetEquivalenceKey(diagnostic)); context.RegisterCodeFix(codeAction, diagnostic); diff --git a/src/Tests/Analyzers.Tests/RCS1104SimplifyConditionalExpressionTests.cs b/src/Tests/Analyzers.Tests/RCS1104SimplifyConditionalExpressionTests.cs index 4037eeafe6..fbe63774e1 100644 --- a/src/Tests/Analyzers.Tests/RCS1104SimplifyConditionalExpressionTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1104SimplifyConditionalExpressionTests.cs @@ -27,7 +27,7 @@ public class RCS1104SimplifyConditionalExpressionTests : AbstractCSharpDiagnosti [InlineData(@"[|f //a /*b*/ ? /*c*/ true //d /*e*/ : /*f*/ false|] /*g*/", @"f //a - /*b*/ /*c*/ //d + /*b*/ /*c*/ //d /*e*/ /*f*/ /*g*/")] public async Task Test_TrueFalse(string source, string expected) { diff --git a/src/Tests/CSharp.Tests/SyntaxKindTests.cs b/src/Tests/CSharp.Tests/SyntaxKindTests.cs index c3b7c340f5..574b84156a 100644 --- a/src/Tests/CSharp.Tests/SyntaxKindTests.cs +++ b/src/Tests/CSharp.Tests/SyntaxKindTests.cs @@ -588,6 +588,11 @@ public static void DetectNewSyntaxKinds() case SyntaxKind.CollectionExpression: case SyntaxKind.ExpressionElement: case SyntaxKind.SpreadElement: + // new in 4.11.0 + case SyntaxKind.AllowsConstraintClause: + case SyntaxKind.AllowsKeyword: + case SyntaxKind.RazorContentToken: + case SyntaxKind.RefStructConstraint: { break; } diff --git a/src/Tests/Formatting.Analyzers.Tests/RCS0048PutInitializerOnSingleLineTests.cs b/src/Tests/Formatting.Analyzers.Tests/RCS0048PutInitializerOnSingleLineTests.cs index 498bf79643..a93a56bcdf 100644 --- a/src/Tests/Formatting.Analyzers.Tests/RCS0048PutInitializerOnSingleLineTests.cs +++ b/src/Tests/Formatting.Analyzers.Tests/RCS0048PutInitializerOnSingleLineTests.cs @@ -64,7 +64,7 @@ class C void M() { - var x = new C() { P = null }; + var x = new C() { P = null, }; } } "); @@ -112,7 +112,7 @@ void M() P = new C() }, - new C { P = new C() }, + new C { P = new C(), }, }; } } @@ -194,7 +194,7 @@ void M() var x = new C() { P2 = null, - P1 = { P2 = null } + P1 = { P2 = null, } }; } } @@ -346,7 +346,7 @@ class C ", @" class C { - string[] _f = { null }; + string[] _f = { null, }; } "); } @@ -395,7 +395,7 @@ class C { void M() { - string[] x = { null }; + string[] x = { null, }; } } "); diff --git a/src/Workspaces.Common/CSharp/SyntaxFormatter.cs b/src/Workspaces.Common/CSharp/SyntaxFormatter.cs index dfb3431686..a91f9ca734 100644 --- a/src/Workspaces.Common/CSharp/SyntaxFormatter.cs +++ b/src/Workspaces.Common/CSharp/SyntaxFormatter.cs @@ -175,7 +175,7 @@ public static Task ToSingleLineAsync( newParent = simpleAssignment .WithRight(newInitializer) - .WithOperatorToken(simpleAssignment.OperatorToken.WithTrailingTrivia(Space)); + .WithOperatorToken(simpleAssignment.OperatorToken.WithoutTrailingTrivia()); break; }