Skip to content

Conversation

@bjornhellander
Copy link
Contributor

@bjornhellander bjornhellander commented Jun 19, 2024

Fixes #1693
Fixes #3866
Fixes #2277

Unsure how to unit test this properly, but I have also used the code fix "live" in this repository with good success:
https://github.com/bjornhellander/SA1649CodeFixProblem
Shared Projects still doesn't work, with exceptions being thrown and the fix messing up the projects, but it does not seem to behave worse than before. (The built-in rename refactoring MoveTypeCodeRefactoringProvider also throws exception on this, but handles files and projects better.) But normal linked files between projects seem to be handled correctly with these changes.

I have started looking at the new APIs to rename files, but since these issues seems to be solvable without them I didn't add those part in this PR.

@bjornhellander bjornhellander force-pushed the feature/sa1649-codefix-problems branch from 4f91b3e to 1d22cdb Compare June 19, 2024 18:01
@codecov
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

❌ Patch coverage is 79.25926% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.39%. Comparing base (b72b3f7) to head (b858737).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3862      +/-   ##
==========================================
+ Coverage   97.14%   97.39%   +0.24%     
==========================================
  Files         957      958       +1     
  Lines      112852   112981     +129     
  Branches     3389     3401      +12     
==========================================
+ Hits       109629   110034     +405     
+ Misses       2224     1948     -276     
  Partials      999      999              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bjornhellander bjornhellander force-pushed the feature/sa1649-codefix-problems branch from 1d22cdb to 282c5e1 Compare July 2, 2024 17:32
@bjornhellander bjornhellander marked this pull request as ready for review July 2, 2024 18:31
…ts which reference the same file before adding them there (to not end up with two identical files in those projects) and also to re-add files with correct path (to not get a copy where there was a link before)

DotNetAnalyzers#1693 DotNetAnalyzers#3866
@bjornhellander bjornhellander force-pushed the feature/sa1649-codefix-problems branch from 282c5e1 to 834380f Compare November 27, 2025 19:25
@bjornhellander bjornhellander marked this pull request as draft November 27, 2025 19:26
@bjornhellander bjornhellander force-pushed the feature/sa1649-codefix-problems branch from 2d9ad41 to b858737 Compare November 27, 2025 21:03
@bjornhellander
Copy link
Contributor Author

Hi @sharwell, nice to see that you are back! Hope all is well!

This PR fixes most cases where the code fix messes up project files. It also uses a better method of renaming files than removing and re-adding them again, to avoid e.g. closing offending files when the fix is applied.

@bjornhellander bjornhellander marked this pull request as ready for review November 27, 2025 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment