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

Update SA1649CodeFixProvider to fix problems related to linked files #3862

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bjornhellander
Copy link
Contributor

@bjornhellander bjornhellander commented Jun 19, 2024

Fixes #1693 and #3866.

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
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 98.36066% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.46%. Comparing base (ff5c432) to head (282c5e1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3862   +/-   ##
=======================================
  Coverage   97.45%   97.46%           
=======================================
  Files         926      926           
  Lines      110237   110292   +55     
  Branches     3315     3316    +1     
=======================================
+ Hits       107433   107491   +58     
+ Misses       1837     1834    -3     
  Partials      967      967           

…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 1d22cdb to 282c5e1 Compare July 2, 2024 17:32
@bjornhellander bjornhellander marked this pull request as ready for review July 2, 2024 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SA1649 code fix does not remove files from linked projects
1 participant