1 Replies Last post: Sep 18, 2009 2:37 PM by Dmitry Jemerov  
Tim McNerney Novice 196 posts since
Aug 21, 2002
Currently Being Moderated

Sep 17, 2009 10:26 PM

Printing Method Args Using Live Template

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?

 

--Tim

Dmitry Jemerov Master 12,560 posts since
Aug 19, 2002
Currently Being Moderated
Sep 18, 2009 2:37 PM in response to: Tim McNerney
Re: Printing Method Args Using Live Template

Hello Tim,

 

There is no predefined live template function to do this for you automatically.

You can write a plugin that would provide such a function.

 

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?

 

--Tim

 

---

Original message URL:

http://www.jetbrains.net/devnet/message/5245394#5245394

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

 

 

 

More Like This

  • Retrieving data ...