Expand live template inside file template

Hello,

 

Is there an easy way to include a live template and make it expand on new file creation?

 

I created a live template named "copyright" which contains a year variable and I want to include it in my "file template"

 

I wish there is a feature for this

 

Cheers

0
4 comments

You can't use Live templates (snippets/functions) in File Templates. Only Live Templates variables are available (see https://www.jetbrains.com/help/phpstorm/2016.3/file-and-code-templates-2.html#live_template).

Related feature request: https://youtrack.jetbrains.com/issue/IDEA-161937

See https://intellij-support.jetbrains.com/hc/en-us/community/posts/206816669 for more info

0

Thank you for your reply, 

 

I will try replicating the same effect using the live template variables

 

Cheers

0

Note that you can use ${YEAR} file template variable to get a current year in file template

0

Yes that worked very well for me, 

Thanks a lot

0

Please sign in to leave a comment.