Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/CommandLine/CommandLine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<PropertyGroup Condition="'$(RoslynatorDotNetCli)' == true">
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(RoslynatorCommandLine)' == true">
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

<PropertyGroup>
<Version Condition="'$(Version)' == ''">1.0.0</Version>
<RoslynatorCliRoslynVersion>4.9.2</RoslynatorCliRoslynVersion>
<RoslynatorTestingRoslynVersion>4.9.2</RoslynatorTestingRoslynVersion>
<RoslynatorCliRoslynVersion>4.11.0</RoslynatorCliRoslynVersion>
<RoslynatorTestingRoslynVersion>4.11.0</RoslynatorTestingRoslynVersion>
<RoslynatorAnalyzersPackageReferenceVersion>4.11.0</RoslynatorAnalyzersPackageReferenceVersion>
<RoslynatorCliPackageVersion>$(RoslynatorCliVersion)</RoslynatorCliPackageVersion>
<RoslynatorPackageVersion>$(Version)</RoslynatorPackageVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 5 additions & 0 deletions src/Tests/CSharp.Tests/SyntaxKindTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class C

void M()
{
var x = new C() { P = null };
var x = new C() { P = null, };
}
}
");
Expand Down Expand Up @@ -112,7 +112,7 @@ void M()
P =
new C()
},
new C { P = new C() },
new C { P = new C(), },
};
}
}
Expand Down Expand Up @@ -194,7 +194,7 @@ void M()
var x = new C()
{
P2 = null,
P1 = { P2 = null }
P1 = { P2 = null, }
};
}
}
Expand Down Expand Up @@ -346,7 +346,7 @@ class C
", @"
class C
{
string[] _f = { null };
string[] _f = { null, };
}
");
}
Expand Down Expand Up @@ -395,7 +395,7 @@ class C
{
void M()
{
string[] x = { null };
string[] x = { null, };
}
}
");
Expand Down
2 changes: 1 addition & 1 deletion src/Workspaces.Common/CSharp/SyntaxFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public static Task<Document> ToSingleLineAsync(

newParent = simpleAssignment
.WithRight(newInitializer)
.WithOperatorToken(simpleAssignment.OperatorToken.WithTrailingTrivia(Space));
.WithOperatorToken(simpleAssignment.OperatorToken.WithoutTrailingTrivia());

break;
}
Expand Down