Surround with method/function call in IDEA?

You could create a live template looking something like this:

$END$($SELECTION$)

and then just select the text you want to wrap, hit Ctrl+Alt+T to show the suround with popup and select your template as illustrated in the image below:

enter image description here

That way you have generic template and you don’t have to hardcode method name into it.

Leave a Comment