File Templates ${FILE_NAME} ignored

Hey guys, I've just started to add some file templates and I've come across a possible issue.

I'm making a file template with the .js extension, and I would like to have something like:

function ${FILE_NAME}(){

in there, ideally without the .js.  However when I right-click on a folder in the project pane and select new -> mytemplate it brings up a box asking for "File name" as usual but also asks for "FILE NAME:"

So it appears as though the parser is not picking that one one as a default/built in token.

Any ideas on what I'm doing wrong?

Along those same lines, in the "new file" right click menu, where do I set which templates show up in that list?  I have a few that are missing from there that are defined in the File Template settings.

I'm using:

JetBrains PhpStorm 6.0.1
Build #PS-129.291, built on April 16, 2013
JDK: 1.7.0_10
VM: Java HotSpot(TM) Client VM by Oracle Corporation


Thanks for the help!
6 comments

Hi Jake,

Use ${NAME} instead.

For example:

<?php
function ${NAME}()
{



}

0

Thanks very much for the tip, ${NAME} does seem to work.  Is the fact that ${FILE_NAME} doesn't work a bug, or am I misunderstanding how it should work?

Additionally, how do I tell PHPStorm which templates to include in the "New" menu list?

Thanks again!

0
Is the fact that ${FILE_NAME} doesn't work a bug, or am I misunderstanding how it should work?

I believe it's a known issue: http://youtrack.jetbrains.com/issue/WI-7749

Additionally, how do I tell PHPStorm which templates to include in the "New" menu list?

No way -- it will display all available templates. It's an IDE-wide setting.

http://youtrack.jetbrains.com/issue/IDEABKL-6427

0

Man that was quick :)  Sounds good, thanks for the help!

0

Regarding ${FILE_NAME} -- it's available in bundled templates ONLY. Custom ones do not have it: http://youtrack.jetbrains.com/issue/WI-7749

0

Ah I see... thanks again for the help!

0

Please sign in to leave a comment.