You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version Used:
3.4.0-beta1-19426-03+b18d90790da95b6862def56802fa4249e4868bb4
Steps to Reproduce:
using System;classProgram{staticvoidMain(){}privatestaticboolM1(stringname){boolresult;
Bar(name,out result);returnresult;}privatestaticboolM2(stringname){boolresult;
Bar(name,out result);returnresult;}privatestaticboolBar(stringname,outboolresult)=>thrownew NotImplementedException();}
Expected Behavior:
Invoking IDE0018 for the Document presents two cases to be fixed, one in M1 and one in M2.
Actual Behavior:
Invoking IDE0018 for the Document presents three cases to be fixed, two in M1, one of which if executed on its own would result in code that doesn't compile:
The text was updated successfully, but these errors were encountered:
This is happening because the check boxes in the preview dialog are based on hunks of the final diff, and not based on fixes for individual issues. For cases where each fix produces exactly one distinct change hunk, the boxes correspond to fixes. However, for cases where fixes are either split across multiple locations/files and cases where fixes apply changes that are not physically separate in the file, the distinction becomes apparent.
FWIW, it was a poor experience for me. I hit it because I first applied and accepted all of the changes IDE0018 made across the solution, but then as I was reviewing all the changes, I found myself manually editing / reverting a bunch of them. So I instead undid everything and tried again, the second time planning to go through and view the edits in the preview changes dialog, thinking I could just click through each change and see what the transformation was by clicking/unclicking the checkbox... but that fell apart quickly with a single refactoring split across multiple check boxes.
Yes, that is correct. Note that FixAll in scope computation can happen in couple of ways:
Code fixer uses a batch fixer (ones exposed in Roslyn or a custom batch fixer), which computes individual fix for each diagnostic separately and then the batch fixer merges them.
Code fixer uses it's own implementation of the FixAllProvider API which produces a single code action/fix with all changes. In this case, we do not even have concept of multiple code actions/fixes being accumulated, but just a single code fix that fixes multiple diagnostics.
The FixAll preview engine and application is only presented with a single merged code action with one or more text changes across one or more documents. So supporting the feature request here might not even be feasible.
Version Used:
3.4.0-beta1-19426-03+b18d90790da95b6862def56802fa4249e4868bb4
Steps to Reproduce:
Expected Behavior:
Invoking IDE0018 for the Document presents two cases to be fixed, one in M1 and one in M2.
Actual Behavior:
Invoking IDE0018 for the Document presents three cases to be fixed, two in M1, one of which if executed on its own would result in code that doesn't compile:
The text was updated successfully, but these errors were encountered: