3 ms·
You picked the simplest refactoring, for converting local to instance variable I agree with you, this is easy in Vim. But still there are some potential proble
by beberlei 14y ago
You picked the simplest refactoring, for converting local to instance variable I agree with you, this is easy in Vim.
But still there are some potential problems:
1. The variable already exists in the class.
2. You accidently mark to much or to few lines with ":<,>%"
For refactorings such as extract method the number of preconditions and information to gather is much bigger, such as input and output variables, existance of return statement etc.
We plan to integrate the tool into vim as well, so that you can call the refactorings through vim directly.
- itry 14y agoI did not pick anything. It is your example. Right from your page. And the only one you provide. If you have a better one: show us.
- beberlei 14y agoThe blog post shows extract method as well as a second refactoring Edit: Also see the screenshot here for a more complex extract method refactoring: http://qafoolabs.github.io/php-refactoring-browser/ http://qafoolabs.github.io/php-refactoring-browser/
- itry 14y agoAh, I missed the extract-method example. Similarely to the convert-local-to-instance-variable example, to me it looks like overkill. I never had a problem, doing these things manually. But if you like doing it this way - I dont complain. To each his own.
- jasonlotito 14y agoI never had a problem doing things manually either. However, as soon as I can automate them, I do. If I can automate extract method to, in effect, a single keystroke, why not? It's the difference between using hjkl for movement, and ignoring all the other commands vim as to offer. Why wouldn't want you to automate patterns in your work?