Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I modify the entire default "try-catch" template in Settings of IDEA?

I can not find where to the "try-catch" template in Settings of IDEA?

I want to modify the entire template not just what is in the Catch Statement Body template.

For example, renaming the reference to the exception from e to ex.

like image 387
expert Avatar asked Aug 31 '12 16:08

expert


2 Answers

In my IntelliJ 11.1.3 I find it under File Templates. Go to the Code tab and then you have the Catch Statement Body.

If it isn't there then you have a problem with the EAP (I haven't tested it).

enter image description here


Edit

I guess that IntelliJ does not come with a Live Template for try/catch. It is described here how you can do it.

like image 179
maba Avatar answered Nov 04 '22 09:11

maba


For the later versions the try/catch template can be customized from

File -> Other Settings -> Default Settings -> Editor -> File and Code Template -> Code -> Catch Statement Body

Once you do this, This is will be enabled on the File -> Settings which indeed is your project settings

like image 4
Samuel Robert Avatar answered Nov 04 '22 11:11

Samuel Robert