Is it possible in Intellij (surround with method?!/refactoring)?

Hi Intellij Community.
I am pretty bad at searching internet for this functionallity I will describe. I would like to ask if this is possible in intellij?
Let's say I have line


and I would like to transform it to


Also is it possible to do something like


and if I put my carret after "my" in "myMethod" and would let codeCompletion suggest me "myAnotherMethod" and by some magic shortcut it would end in



Thank you

PS: I hope I made it clear what I am looking for :)

Comment actions Permalink

What is the use case? Why do you need to do it so often?

Did you try the surround live template?

Comment actions Permalink

Well to be honest I dont know right now some specific use case, but it was mostly required during some refactorings and it happend to me so often that I had to ask here :).
Fortunately I find out method how to satisfy my first use case. Simple ctrl+shift+enter (Complete Current Statement).

Thanks anyway


Please sign in to leave a comment.