[ ] RemoveUnusedLocalVariables does not clean up LDContext when the assignment might have side effects, such as when using the builder. Might need a separate recipe that ignores the potential builder side effect.
[ ] the doAfterVisit recipes now affect the entire SourceFile containing a feature flag, but not other SourceFiles. we might want to limit that further, although it'd be more effort
What problem are you trying to solve?
We identified a couple of possible improvements following the first recipe to removed a feature flag.
Describe the solution you'd like
RemoveUnusedLocalVariables
does not clean upLDContext
when the assignment might have side effects, such as when using the builder. Might need a separate recipe that ignores the potential builder side effect.doAfterVisit
recipes now affect the entireSourceFile
containing a feature flag, but not otherSourceFiles
. we might want to limit that further, although it'd be more effortHave you considered any alternatives or workarounds?
Some of these can be separate recipes in for instance rewrite-static-analysis, that we then reuse here.