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

Propagate encodings in SA1412 #1279

Merged
merged 2 commits into from
Aug 25, 2015

Conversation

sharwell
Copy link
Member

In SA1412 (StoreFilesAsUtf8), file encodings are detected as part of the diagnostic. This change updates the reported diagnostics to propagate the name of the detected encoding so it doesn't have to be reevaluated as part of the code fix.

This change is not a perfect fix for #1169, but it improves upon the situation slightly. In order to fix all closed files, you can open a closed file which reported SA1412 and use the Fix All action before the IDE has the chance to recalculate diagnostics for the file. The encoding used for the code fix will be the one used by the analyzer while the file was closed, which will result in fixing all other closed files.

In SA1412 (StoreFilesAsUtf8), file encodings are detected as part of the
diagnostic. This change updates the reported diagnostics to propagate the
name of the detected encoding so it doesn't have to be reevaluated as part
of the code fix.
@Noryoko
Copy link
Contributor

Noryoko commented Aug 25, 2015

Disregard the code comments. I misread the closing parentheses.
👍 Looks good.

@sharwell sharwell added this to the 1.0.0 Beta 9 milestone Aug 25, 2015
sharwell added a commit that referenced this pull request Aug 25, 2015
@sharwell sharwell merged commit 84c5811 into DotNetAnalyzers:master Aug 25, 2015
@sharwell sharwell deleted the propagate-encoding branch August 25, 2015 19:47
@sharwell sharwell added the fixed label Aug 25, 2015
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