How to use the File name templates in Intellij 2021.2

Answered

Hi,

 

I'm new in the creation of file templates in IntelliJ and I'm looking to generate the name of the file, based on the ${NAME} variable (which will be the name of the class)

I tried to use the file name input (attached below) but don't understand how to use it.

 

Thank you,

Best regards,

Matthieu

1 comment
Comment actions Permalink

Hi Matthieu,

You can use the template like this:

When you start creating a new file from this template, the IDE will prompt you to input the file name, which will automatically become the class name if the ${NAME} variable is present in the template code.

0

Please sign in to leave a comment.