Can I get a ReSharper live template to copy all parameters from the enclosing method?

104 views Asked by At

I have a massively repeating code pattern like this:

public SomeReturnType InitiateAndSecureTransaction(string token, IPaymentDetailsUpdateable paymentDetails)
{
    return WithService<MyServiceClient, SomeReturnType>(proxy => proxy.InitiateAndSecureTransaction(token, paymentDetails));
}

To help me implement this pattern in some fifty odd methods, I have a live template like this:

return WithService<$CLASS_NAME$ServiceClient, $RETURN_TYPE$>(proxy => proxy.$CONTAINING_METHOD$($PARAMS$));

The $PARAMS$ parameter is assigned the macro Execute smart completion, and this works wonderfully, but I'm spoilt. I insert the whole WithService call with about three tabs, but ReSharper only gets the first parameter of the enclosing method, and I have to intellisense through the rest. Is there any way I can simply copy all of the enclosing method's paramaters?

0

There are 0 answers