Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt committed Dec 20, 2024
1 parent 706cfbf commit ea68d4d
Show file tree
Hide file tree
Showing 478 changed files with 3,832 additions and 5,143 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public override ImmutableArray<string> FixableDiagnosticIds
get
{
return ImmutableArray.Create(
DiagnosticIdentifiers.AddBracesWhenExpressionSpansOverMultipleLines,
DiagnosticIdentifiers.AddBraces,
DiagnosticIdentifiers.AddBracesToIfElse);
DiagnosticIds.AddBracesWhenExpressionSpansOverMultipleLines,
DiagnosticIds.AddBraces,
DiagnosticIds.AddBracesToIfElse);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class AddBracesToIfElseCodeFixProvider : BaseCodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds
{
get { return ImmutableArray.Create(DiagnosticIdentifiers.AddBracesToIfElseWhenExpressionSpansOverMultipleLines); }
get { return ImmutableArray.Create(DiagnosticIds.AddBracesToIfElseWhenExpressionSpansOverMultipleLines); }
}

public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Expand All @@ -33,7 +33,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
CodeAction codeAction = CodeAction.Create(
"Add braces to if-else",
ct => AddBracesToIfElseRefactoring.RefactorAsync(context.Document, ifStatement, ct),
GetEquivalenceKey(DiagnosticIdentifiers.AddBracesToIfElseWhenExpressionSpansOverMultipleLines));
GetEquivalenceKey(DiagnosticIds.AddBracesToIfElseWhenExpressionSpansOverMultipleLines));

context.RegisterCodeFix(codeAction, context.Diagnostics);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public sealed class AddExceptionToDocumentationCommentCodeFixProvider : BaseCode
{
public override ImmutableArray<string> FixableDiagnosticIds
{
get { return ImmutableArray.Create(DiagnosticIdentifiers.AddExceptionToDocumentationComment); }
get { return ImmutableArray.Create(DiagnosticIds.AddExceptionToDocumentationComment); }
}

public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Expand All @@ -33,7 +33,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
{
switch (diagnostic.Id)
{
case DiagnosticIdentifiers.AddExceptionToDocumentationComment:
case DiagnosticIds.AddExceptionToDocumentationComment:
{
switch (node.Kind())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public sealed class AddOrRemoveParenthesesWhenCreatingNewObjectCodeFixProvider :
{
public override ImmutableArray<string> FixableDiagnosticIds
{
get { return ImmutableArray.Create(DiagnosticIdentifiers.IncludeParenthesesWhenCreatingNewObject); }
get { return ImmutableArray.Create(DiagnosticIds.IncludeParenthesesWhenCreatingNewObject); }
}

public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public sealed class AddOrRemoveTrailingCommaCodeFixProvider : BaseCodeFixProvide
{
public override ImmutableArray<string> FixableDiagnosticIds
{
get { return ImmutableArray.Create(DiagnosticIdentifiers.AddOrRemoveTrailingComma); }
get { return ImmutableArray.Create(DiagnosticIds.AddOrRemoveTrailingComma); }
}

public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public sealed class AddParagraphToDocumentationCommentCodeFixProvider : BaseCode
{
public override ImmutableArray<string> FixableDiagnosticIds
{
get { return ImmutableArray.Create(DiagnosticIdentifiers.AddParagraphToDocumentationComment); }
get { return ImmutableArray.Create(DiagnosticIds.AddParagraphToDocumentationComment); }
}

public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public sealed class AddParenthesesWhenNecessaryCodeFixProvider : BaseCodeFixProv
{
public override ImmutableArray<string> FixableDiagnosticIds
{
get { return ImmutableArray.Create(DiagnosticIdentifiers.AddParenthesesWhenNecessary); }
get { return ImmutableArray.Create(DiagnosticIds.AddParenthesesWhenNecessary); }
}

public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Expand All @@ -46,7 +46,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
return AddParenthesesAccordingToOperatorPrecedenceAsync(document, expression, ct);
}
},
GetEquivalenceKey(DiagnosticIdentifiers.AddParenthesesWhenNecessary));
GetEquivalenceKey(DiagnosticIds.AddParenthesesWhenNecessary));

context.RegisterCodeFix(codeAction, context.Diagnostics);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class AnonymousMethodCodeFixProvider : BaseCodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds
{
get { return ImmutableArray.Create(DiagnosticIdentifiers.UseLambdaExpressionInsteadOfAnonymousMethod); }
get { return ImmutableArray.Create(DiagnosticIds.UseLambdaExpressionInsteadOfAnonymousMethod); }
}

public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Expand All @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
CodeAction codeAction = CodeAction.Create(
"Use lambda expression instead of anonymous method",
ct => UseLambdaInsteadOfAnonymousMethodRefactoring.RefactorAsync(context.Document, anonymousMethod, ct),
GetEquivalenceKey(DiagnosticIdentifiers.UseLambdaExpressionInsteadOfAnonymousMethod));
GetEquivalenceKey(DiagnosticIds.UseLambdaExpressionInsteadOfAnonymousMethod));

context.RegisterCodeFix(codeAction, context.Diagnostics);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public override ImmutableArray<string> FixableDiagnosticIds
get
{
return ImmutableArray.Create(
DiagnosticIdentifiers.UseUnaryOperatorInsteadOfAssignment,
DiagnosticIdentifiers.RemoveRedundantDelegateCreation);
DiagnosticIds.UseUnaryOperatorInsteadOfAssignment,
DiagnosticIds.RemoveRedundantDelegateCreation);
}
}

Expand All @@ -45,7 +45,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
{
switch (diagnostic.Id)
{
case DiagnosticIdentifiers.UseUnaryOperatorInsteadOfAssignment:
case DiagnosticIds.UseUnaryOperatorInsteadOfAssignment:
{
string operatorText = UseUnaryOperatorInsteadOfAssignmentAnalyzer.GetOperatorText(assignment);

Expand All @@ -57,7 +57,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(codeAction, diagnostic);
break;
}
case DiagnosticIdentifiers.RemoveRedundantDelegateCreation:
case DiagnosticIds.RemoveRedundantDelegateCreation:
{
CodeAction codeAction = CodeAction.Create(
"Remove redundant delegate creation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public sealed class AttributeArgumentListCodeFixProvider : BaseCodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds
{
get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveArgumentListFromAttribute); }
get { return ImmutableArray.Create(DiagnosticIds.RemoveArgumentListFromAttribute); }
}

public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Expand All @@ -30,7 +30,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
CodeAction codeAction = CodeAction.Create(
"Remove parentheses",
ct => context.Document.RemoveNodeAsync(attributeArgumentList, SyntaxRemoveOptions.KeepNoTrivia, ct),
GetEquivalenceKey(DiagnosticIdentifiers.RemoveArgumentListFromAttribute));
GetEquivalenceKey(DiagnosticIds.RemoveArgumentListFromAttribute));

context.RegisterCodeFix(codeAction, context.Diagnostics);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public sealed class AvoidBoxingOfValueTypeCodeFixProvider : BaseCodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds
{
get { return ImmutableArray.Create(DiagnosticIdentifiers.AvoidBoxingOfValueType); }
get { return ImmutableArray.Create(DiagnosticIds.AvoidBoxingOfValueType); }
}

public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Expand All @@ -35,7 +35,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
{
switch (diagnostic.Id)
{
case DiagnosticIdentifiers.AvoidBoxingOfValueType:
case DiagnosticIds.AvoidBoxingOfValueType:
{
CodeAction codeAction = CodeAction.Create(
(expression.IsKind(SyntaxKind.CharacterLiteralExpression))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public sealed class AvoidNullReferenceExceptionCodeFixProvider : BaseCodeFixProv
{
public override ImmutableArray<string> FixableDiagnosticIds
{
get { return ImmutableArray.Create(DiagnosticIdentifiers.AvoidNullReferenceException); }
get { return ImmutableArray.Create(DiagnosticIds.AvoidNullReferenceException); }
}

public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Expand Down Expand Up @@ -60,7 +60,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
CodeAction codeAction = CodeAction.Create(
"Use conditional access",
ct => RefactorAsync(context.Document, expression, ct),
GetEquivalenceKey(DiagnosticIdentifiers.AvoidNullReferenceException));
GetEquivalenceKey(DiagnosticIds.AvoidNullReferenceException));

context.RegisterCodeFix(codeAction, context.Diagnostics);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public sealed class AwaitExpressionCodeFixProvider : BaseCodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds
{
get { return ImmutableArray.Create(DiagnosticIdentifiers.ConfigureAwait); }
get { return ImmutableArray.Create(DiagnosticIds.ConfigureAwait); }
}

public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public sealed class BaseArgumentListCodeFixProvider : BaseCodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds
{
get { return ImmutableArray.Create(DiagnosticIdentifiers.OrderNamedArguments); }
get { return ImmutableArray.Create(DiagnosticIds.OrderNamedArguments); }
}

public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Expand All @@ -39,7 +39,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)

switch (diagnostic.Id)
{
case DiagnosticIdentifiers.OrderNamedArguments:
case DiagnosticIds.OrderNamedArguments:
{
CodeAction codeAction = CodeAction.Create(
"Order arguments",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class BaseTypeCodeFixProvider : BaseCodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds
{
get { return ImmutableArray.Create(DiagnosticIdentifiers.RemoveRedundantBaseInterface); }
get { return ImmutableArray.Create(DiagnosticIds.RemoveRedundantBaseInterface); }
}

public override async Task RegisterCodeFixesAsync(CodeFixContext context)
Expand All @@ -31,7 +31,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
CodeAction codeAction = CodeAction.Create(
"Remove redundant base interface",
ct => RemoveRedundantBaseInterfaceRefactoring.RefactorAsync(context.Document, baseType, ct),
GetEquivalenceKey(DiagnosticIdentifiers.RemoveRedundantBaseInterface));
GetEquivalenceKey(DiagnosticIds.RemoveRedundantBaseInterface));

context.RegisterCodeFix(codeAction, context.Diagnostics);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ public override ImmutableArray<string> FixableDiagnosticIds
get
{
return ImmutableArray.Create(
DiagnosticIdentifiers.ConstantValuesShouldBePlacedOnRightSideOfComparisons,
DiagnosticIdentifiers.UseStringIsNullOrEmptyMethod,
DiagnosticIdentifiers.SimplifyCoalesceExpression,
DiagnosticIdentifiers.RemoveRedundantAsOperator,
DiagnosticIdentifiers.UseStringLengthInsteadOfComparisonWithEmptyString,
DiagnosticIdentifiers.UnconstrainedTypeParameterCheckedForNull,
DiagnosticIdentifiers.ValueTypeObjectIsNeverEqualToNull,
DiagnosticIdentifiers.JoinStringExpressions,
DiagnosticIdentifiers.UseExclusiveOrOperator,
DiagnosticIdentifiers.UnnecessaryNullCheck,
DiagnosticIdentifiers.UseShortCircuitingOperator,
DiagnosticIdentifiers.UnnecessaryOperator,
DiagnosticIdentifiers.SimplifyNumericComparison);
DiagnosticIds.ConstantValuesShouldBePlacedOnRightSideOfComparisons,
DiagnosticIds.UseStringIsNullOrEmptyMethod,
DiagnosticIds.SimplifyCoalesceExpression,
DiagnosticIds.RemoveRedundantAsOperator,
DiagnosticIds.UseStringLengthInsteadOfComparisonWithEmptyString,
DiagnosticIds.UnconstrainedTypeParameterCheckedForNull,
DiagnosticIds.ValueTypeObjectIsNeverEqualToNull,
DiagnosticIds.JoinStringExpressions,
DiagnosticIds.UseExclusiveOrOperator,
DiagnosticIds.UnnecessaryNullCheck,
DiagnosticIds.UseShortCircuitingOperator,
DiagnosticIds.UnnecessaryOperator,
DiagnosticIds.SimplifyNumericComparison);
}
}

Expand All @@ -55,7 +55,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
{
switch (diagnostic.Id)
{
case DiagnosticIdentifiers.ConstantValuesShouldBePlacedOnRightSideOfComparisons:
case DiagnosticIds.ConstantValuesShouldBePlacedOnRightSideOfComparisons:
{
CodeAction codeAction = CodeAction.Create(
"Swap operands",
Expand All @@ -65,7 +65,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(codeAction, diagnostic);
break;
}
case DiagnosticIdentifiers.UseStringIsNullOrEmptyMethod:
case DiagnosticIds.UseStringIsNullOrEmptyMethod:
{
CodeAction codeAction = CodeAction.Create(
"Use 'string.IsNullOrEmpty' method",
Expand All @@ -75,7 +75,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(codeAction, diagnostic);
break;
}
case DiagnosticIdentifiers.SimplifyCoalesceExpression:
case DiagnosticIds.SimplifyCoalesceExpression:
{
ExpressionSyntax expression = binaryExpression.Left;

Expand All @@ -93,7 +93,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(codeAction, diagnostic);
break;
}
case DiagnosticIdentifiers.RemoveRedundantAsOperator:
case DiagnosticIds.RemoveRedundantAsOperator:
{
CodeAction codeAction = CodeAction.Create(
"Remove redundant 'as' operator",
Expand All @@ -103,7 +103,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(codeAction, diagnostic);
break;
}
case DiagnosticIdentifiers.UseStringLengthInsteadOfComparisonWithEmptyString:
case DiagnosticIds.UseStringLengthInsteadOfComparisonWithEmptyString:
{
CodeAction codeAction = CodeAction.Create(
"Use string.Length",
Expand All @@ -113,7 +113,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(codeAction, diagnostic);
break;
}
case DiagnosticIdentifiers.UnconstrainedTypeParameterCheckedForNull:
case DiagnosticIds.UnconstrainedTypeParameterCheckedForNull:
{
SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false);

Expand All @@ -127,7 +127,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(codeAction, diagnostic);
break;
}
case DiagnosticIdentifiers.ValueTypeObjectIsNeverEqualToNull:
case DiagnosticIds.ValueTypeObjectIsNeverEqualToNull:
{
SemanticModel semanticModel = await context.GetSemanticModelAsync().ConfigureAwait(false);

Expand Down Expand Up @@ -155,7 +155,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(codeAction, diagnostic);
break;
}
case DiagnosticIdentifiers.JoinStringExpressions:
case DiagnosticIds.JoinStringExpressions:
{
CodeAction codeAction = CodeAction.Create(
"Join string expressions",
Expand All @@ -165,7 +165,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(codeAction, diagnostic);
break;
}
case DiagnosticIdentifiers.UseExclusiveOrOperator:
case DiagnosticIds.UseExclusiveOrOperator:
{
CodeAction codeAction = CodeAction.Create(
"Use ^ operator",
Expand All @@ -175,7 +175,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(codeAction, diagnostic);
break;
}
case DiagnosticIdentifiers.UnnecessaryNullCheck:
case DiagnosticIds.UnnecessaryNullCheck:
{
CodeAction codeAction = CodeAction.Create(
"Remove unnecessary null check",
Expand All @@ -185,7 +185,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(codeAction, diagnostic);
break;
}
case DiagnosticIdentifiers.UseShortCircuitingOperator:
case DiagnosticIds.UseShortCircuitingOperator:
{
SyntaxToken operatorToken = binaryExpression.OperatorToken;

Expand Down Expand Up @@ -224,7 +224,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(codeAction, diagnostic);
break;
}
case DiagnosticIdentifiers.UnnecessaryOperator:
case DiagnosticIds.UnnecessaryOperator:
{
CodeAction codeAction = CodeAction.Create(
"Use '==' operator",
Expand All @@ -244,7 +244,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(codeAction, diagnostic);
break;
}
case DiagnosticIdentifiers.SimplifyNumericComparison:
case DiagnosticIds.SimplifyNumericComparison:
{
CodeAction codeAction = CodeAction.Create(
"Simplify numeric comparison",
Expand Down
Loading

0 comments on commit ea68d4d

Please sign in to comment.