Skip to content

Auto-fixes stopped working on 0.28.0 release (when having conditional expressions) #276

Closed
@bkaid

Description

@bkaid

I upgraded from 0.27.0 to 0.28.0 and ran dotnet format to apply the auto-fixes like I generally do for each of the last few releases on a code base that has a mix of xunit syntax and fluent assertions syntax. With this release I am getting an unexpected error and no files get changed even though the logs say they do. I have attached the full diagnostic log from running dotnet format -v diag >> log.txt which doesn't seem to contain much information. The console output when running the same command contains:

dotnet format -v diag >> log.txt
Unable to fix FAA0002. Code fix XunitCodeFixProvider didn't return a Fix All action.
Unable to fix FAA0002. Code fix XunitCodeFixProvider didn't return a Fix All action.
Failed to get new expression in FluentAssertions.Analyzers.FluentAssertionsCodeFix.
System.InvalidOperationException: should not get here
   at FluentAssertions.Analyzers.FluentAssertionsCodeFixProvider.GetNewExpression(ExpressionSyntax expression, NodeReplacement replacement)
   at FluentAssertions.Analyzers.FluentAssertionsCodeFixProvider.GetNewExpression(ExpressionSyntax expression, NodeReplacement[] replacements)
   at FluentAssertions.Analyzers.FluentAssertionsCodeFix.GetNewExpression(ExpressionSyntax expression, FluentAssertionsDiagnosticProperties properties)
   at FluentAssertions.Analyzers.FluentAssertionsCodeFixProvider.GetNewExpressionAsync(ExpressionSyntax expression, Document document, FluentAssertionsDiagnosticProperties properties, CancellationToken cancellationToken)
   at FluentAssertions.Analyzers.FluentAssertionsCodeFixProvider.GetNewExpressionSafelyAsync(ExpressionSyntax expression, Document document, FluentAssertionsDiagnosticProperties properties, CancellationToken cancellationToken)
Unable to fix FAA0001. Code fix FluentAssertionsCodeFix didn't return a Fix All action.
Failed to get new expression in FluentAssertions.Analyzers.FluentAssertionsCodeFix.
System.InvalidOperationException: should not get here
   at FluentAssertions.Analyzers.FluentAssertionsCodeFixProvider.GetNewExpression(ExpressionSyntax expression, NodeReplacement replacement)
   at FluentAssertions.Analyzers.FluentAssertionsCodeFixProvider.GetNewExpression(ExpressionSyntax expression, NodeReplacement[] replacements)
   at FluentAssertions.Analyzers.FluentAssertionsCodeFix.GetNewExpression(ExpressionSyntax expression, FluentAssertionsDiagnosticProperties properties)
   at FluentAssertions.Analyzers.FluentAssertionsCodeFixProvider.GetNewExpressionAsync(ExpressionSyntax expression, Document document, FluentAssertionsDiagnosticProperties properties, CancellationToken cancellationToken)
   at FluentAssertions.Analyzers.FluentAssertionsCodeFixProvider.GetNewExpressionSafelyAsync(ExpressionSyntax expression, Document document, FluentAssertionsDiagnosticProperties properties, CancellationToken cancellationToken)
Unable to fix FAA0001. Code fix FluentAssertionsCodeFix didn't return a Fix All action.

log.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions