Shortcut to convert an expression into a method/function parameter?
Answered
I now think that this is a frequent operation:
- You have an expression S, say it is a subexpression of a bigger expression, initializer (E) etc.
- Instead of using S as is, you want to pass it to a method/function M and use the return value in E.
- Thus, E = A + B + S + D; would look like E = A + B + M(S) + D;
I use Cmd+w to choose the expression S, but now I don't have a quick way to add the method name and a pair of parentheses to convert it into M(S). Is there a way to do it quickly?
Am I making it clear? (I believe this feature is useful across IDE's)
Regards,
Kedar
Please sign in to leave a comment.
Refactor | Extract | Method.