Skip to content

Commit 3228b9a

Browse files
authored
Consolidation before release (#1144)
1 parent 5ebe544 commit 3228b9a

File tree

120 files changed

+233
-284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+233
-284
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,7 @@ dotnet_diagnostic.IDE1006.severity = suggestion
195195
dotnet_diagnostic.RS1024.severity = none # Compare symbols correctly
196196
dotnet_diagnostic.RS1025.severity = none
197197
dotnet_diagnostic.RS1026.severity = none
198+
199+
dotnet_diagnostic.CA1806.severity = none
200+
dotnet_diagnostic.CA1826.severity = none
201+
dotnet_diagnostic.CA2231.severity = none

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- [CLI] Bump Roslyn to 4.6.0 ([#1106](https://github.com/josefpihrt/roslynator/pull/1106)).
1717
- Bump Roslyn to 4.4.0 ([#1116](https://github.com/josefpihrt/roslynator/pull/1116)).
1818
- Migrate documentation to [Docusaurus](https://josefpihrt.github.io/docs/roslynator) ([#922](https://github.com/josefpihrt/roslynator/pull/922)).
19+
- [Testing Framework] Bump Roslyn to 4.6.0 ([#1144](https://github.com/josefpihrt/roslynator/pull/1144)).
1920

2021
### Fixed
2122

src/Analyzers.CodeFixes/Analyzers.CodeFixes.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
</ItemGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="$(RoslynAnalyzersVersion)">
23+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="$(RoslynatorRoslynAnalyzersVersion)">
2424
<PrivateAssets>all</PrivateAssets>
2525
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
2626
</PackageReference>
27-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(RoslynVersion)" />
27+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(RoslynatorRoslynVersion)" />
2828
</ItemGroup>
2929

3030
<ItemGroup>

src/Analyzers.CodeFixes/CSharp/CodeFixes/BinaryExpressionCodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ private static async Task<Document> RemoveUnnecessaryNullCheckAsync(
323323

324324
SemanticModel semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
325325

326-
NullCheckExpressionInfo nullCheck = SyntaxInfo.NullCheckExpressionInfo(binaryExpressionInfo.Left, semanticModel, NullCheckStyles.HasValue | NullCheckStyles.NotEqualsToNull);
326+
NullCheckExpressionInfo nullCheck = SyntaxInfo.NullCheckExpressionInfo(binaryExpressionInfo.Left, semanticModel, NullCheckStyles.HasValue | NullCheckStyles.NotEqualsToNull, cancellationToken: cancellationToken);
327327

328328
var binaryExpression = right as BinaryExpressionSyntax;
329329

src/Analyzers.CodeFixes/CSharp/CodeFixes/DirectiveTriviaCodeFixProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ private static Task<Document> RefactorAsync(
7979
&& disableOrRestoreKind == directive2.DisableOrRestoreKeyword.Kind())
8080
{
8181
if (addComma)
82-
sb.Append(",");
82+
sb.Append(',');
8383

84-
sb.Append(" ");
84+
sb.Append(' ');
8585

8686
SeparatedSyntaxList<ExpressionSyntax> errorCodes = directive2.ErrorCodes;
8787
sb.Append(errorCodes.ToString());

src/Analyzers.CodeFixes/CSharp/CodeFixes/EnumDeclarationCodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private static async Task<Document> SortEnumMembersAsync(
119119
CancellationToken cancellationToken)
120120
{
121121
SemanticModel semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
122-
SpecialType enumSpecialType = semanticModel.GetDeclaredSymbol(enumDeclaration).EnumUnderlyingType.SpecialType;
122+
SpecialType enumSpecialType = semanticModel.GetDeclaredSymbol(enumDeclaration, cancellationToken).EnumUnderlyingType.SpecialType;
123123
SeparatedSyntaxList<EnumMemberDeclarationSyntax> members = enumDeclaration.Members;
124124

125125
List<EnumMemberDeclarationSyntax> sortedList = members

src/Analyzers.CodeFixes/CSharp/CodeFixes/IfStatementCodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ private static IfStatementSyntax GetNewIfStatement(IfStatementSyntax ifStatement
237237
}
238238
}
239239

240-
private Task<Document> CallArgumentNullExceptionThrowIfNullAsync(
240+
private static Task<Document> CallArgumentNullExceptionThrowIfNullAsync(
241241
Document document,
242242
IfStatementSyntax ifStatement,
243243
CancellationToken cancellationToken)

src/Analyzers.CodeFixes/CSharp/CodeFixes/ImplementNonGenericCounterpartCodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private static async Task<Document> RefactorAsync(
190190
bool explicitImplementation,
191191
CancellationToken cancellationToken)
192192
{
193-
SemanticModel semanticModel = await document.GetSemanticModelAsync().ConfigureAwait(false);
193+
SemanticModel semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
194194

195195
INamedTypeSymbol symbol = semanticModel.GetDeclaredSymbol(typeDeclaration, cancellationToken);
196196

src/Analyzers.CodeFixes/CSharp/CodeFixes/RemoveRedundantBooleanLiteralCodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
8686
}
8787
}
8888

89-
private void RegisterCodeFix(CodeFixContext context, string textToRemove, Func<CancellationToken, Task<Document>> createChangedDocument)
89+
private static void RegisterCodeFix(CodeFixContext context, string textToRemove, Func<CancellationToken, Task<Document>> createChangedDocument)
9090
{
9191
CodeAction codeAction = CodeAction.Create(
9292
$"Remove redundant '{textToRemove}'",

src/Analyzers.CodeFixes/CSharp/CodeFixes/ReturnCompletedTaskInsteadOfNullCodeFixProvider2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private static async Task<Document> RefactorAsync(
5656

5757
int position = conditionalAccess.SpanStart;
5858

59-
string localName = NameGenerator.Default.EnsureUniqueLocalName(DefaultNames.Variable, semanticModel, position);
59+
string localName = NameGenerator.Default.EnsureUniqueLocalName(DefaultNames.Variable, semanticModel, position, cancellationToken: cancellationToken);
6060

6161
ITypeSymbol typeSymbol = semanticModel.GetTypeSymbol(expression, cancellationToken);
6262

0 commit comments

Comments
 (0)