views:

149

answers:

1

I would like to be able to create a live template in Jetbrain's Idea that will log the method's arguments. Let's call it "larg". It would work like:

public void get(String one, String two) {
    larg<tab>

to create

public void get(String one, String two) {
    log.info("get: one = " + one + " two = " + two);

I'm fine with getting the method name in, but have not figured out how to pull in the method arguments. Any ideas?

A: 

Looks like it is not currently possible with a live template.

From the Jetbrain's forum:

There is no predefined live template function to do this for you automatically.
You can write a plugin that would provide such a function.
Tim