Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup for code fixes #1452

Closed

Conversation

vweijsters
Copy link
Contributor

Refactored all code fixes for consistency, based on discussions in #1441

@sharwell
Copy link
Member

I find myself wishing this was multiple commits:

  1. The first commit could simply wrap the calls to RegisterCodeFix
  2. The second commit could remove the .Where and if (...) conditions that check to see if a diagnostic ID is fixable
  3. The third commit could remove FixableDiagnostics as a separate field (favoring the { get; } = ... syntax instead)

}
while (false);
";

await this.VerifyCSharpFixAsync(testCode, fixedTestCode).ConfigureAwait(false);
await this.VerifyCSharpFixAsync(testCode, fixedTestCode, allowUnsupportedDiagnostics: true).ConfigureAwait(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Why did this one need to be a special case? It seems like a bunch of special behavior was added to the testing framework just to support this single test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test contains invalid C# syntax. The closing brace for the method is not present, resulting in a compiler being produced for it in the verify case.
As I wanted to keep the Assert in the CodeFixVerifier signalling that a test case is producing unexpected errors, I had to go to quite a bit of effort to make this test case work.

@vweijsters
Copy link
Contributor Author

I'll address this in separate pull requests. Keeping this one open until I'm done with those

@vweijsters
Copy link
Contributor Author

Closing this as all content has been addressed in other pull requests.

@vweijsters vweijsters closed this Oct 14, 2015
@vweijsters vweijsters deleted the codefix-cleanup branch October 14, 2015 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants