Open OliverJAsh opened 7 years ago
Hi, thanks. Glad that it's of use to you. Refactorix could invoke one of the two VS Code commands "Format Selection" / "Format Document" after a refactoring has been made. "Format Selection" is kind of hard to detect the new range and one has to alter the selection before invoking the command which could flicker. I suggest a new configurable Refactorix option "Format Document on Refactoring" (default is false to preserve backward compatibility). Would that suffice your needs?
@krizzdewizz When I read through the source code, it seemed like you were doing some work to retain indentation—I'm guessing this has limits though? I agree this is probably a job better handled by another tool.
I suggest a new configurable Refactorix option "Format Document on Refactoring" (default is false to preserve backward compatibility). Would that suffice your needs?
I think so. I use Prettier so that will just format the new function in addition to everything else, but there shouldn't be any changes elsewhere.
Maybe we should hang on to this and see what other people’s needs are.
Hey! First of all, thanks for this extension. I've longed for an arrow function refactoring like the one provided here. I've lost count of the number of times I've switched back and forth.
--
Given:
If I use the refactoring to convert this single expression function to a block, I get:
Is there something we could do to fix the formatting here?