Structural S&R : variableOfType suggestion ?

Dear IntelliJ users and developers,

I'm trying to use Structural Search & Replace to achieve the following : replace all occurrences of System.out.println("foo") by <logger>.debug("foo"), where <logger> should be a variable of class org.slf4j.Logger found in the context of the class where the replacement is done.

In Live Templates I can use the "variableOfType" method to get a smart suggestion, but I cannot find how to achieve the same in SSR. I studied all the SSR templates to find the trick, and I think it should be doable with a "Groovy constraint", but I cannot find how due to the total lack of documentation in this area.

Thank you for your help !
Olivier

2 comments
Comment actions Permalink

This is not easily possible at the moment, please file Youtrack ticket

On 02.05.2011 1:46, Olivier Croisier wrote:

Dear IntelliJ users and developers,

>

I'm trying to use Structural Search&  Replace to achieve the following : replace all occurrences of System.out.println("foo") by<logger>.debug("foo"), where<logger>  should be a variable of class org.slf4j.Logger found in the context of the class where the replacement is done.

>

In Live Templates I can use the "variableOfType" method to get a smart suggestion, but I cannot find how to achieve the same in SSR. I studied all the SSR templates to find the trick, and I think it should be doable with a "Groovy constraint", but I cannot find how due to the total lack of documentation in this area.

>

Thank you for your help !
Olivier

>

---
Original message URL: http://devnet.jetbrains.net/message/5301915#5301915



--
Best regards,
   Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Please sign in to leave a comment.