Quantcast
Channel: JetBrains Developer Community : All Content - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5481

Modify non-Live template "Surround With" snippet

$
0
0

I often use "Surround with try/catch" from the "Intention Actions" menu to surround a method call with try and the appropriate checked exception catch blocks. There are two things I have been unable to change in this generated code.

 

1) The generated exception variable does not have the final modifier. None of the normal code generation "enable final" options seem to affect this.

2) The name of the generated exception variable. It is always "e" I would like to change it.

 

Am I missing some options, or is this currently not possible? One option I was contemplating was to create a new "Surround with" live template. Would this work?

 

Thanks.


Viewing all articles
Browse latest Browse all 5481

Latest Images

Trending Articles



Latest Images