- changed status to resolved
Add braces quick-fix when applied to multiple parts of composite statement, e.g., if/else, only fixes one clause
Issue #1055
resolved
If you have a statement like:
if (someCondition)
return something;
else
return somethingElse;
and you run the Control flow statement without braces code inspection en masse, then apply the Add braces to statements fix en masse, only one clause will be fixed.
This is because these are technically parts of the same overarching syntax construct, and when the fix modifies one clause, it causes the code intention engine to see the other clause as out-of-date in the underlying document.
I'll need to investigate how to make this work properly. In the interim, the workaround is to run the inspection/intention twice.
Comments (1)
-
reporter - Log in to comment
Fixed at some time in the past.