Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm: How to use Live Template in File Template

This question follows on from one I asked last week - How to apply more than one function to a passed in live template variable?

Now that I have a live template function called classNameFromFileName, I am unable to use it in a file template.

I have ticked the "Enable Live Templates" checkbox inside the File Template editor page and no combination of #set or #[[ ]]# etc will work.

If I use the template, it just ends up putting the name of the Live Template function inside my new file, rather than actually calling the function.

The PyCharm help offers nothing in the way of an example - does anyone know how to call a live template function from a file template?

Thanks.

like image 586
Mike Avatar asked Oct 18 '22 01:10

Mike


1 Answers

Right now it's not possible. You can vote for these issues:

  • Live template variables don't work properly in File templates
  • Code Templates. Add ability to use Live Templates or Live Template variables.
like image 114
grundic Avatar answered Oct 27 '22 10:10

grundic