Live Templates - How to get the filename?

How do you plug the current filename into a live template?  It doesn't appear to be possible.  I'm trying to build a live template for  JSP pages and I can't find a way to have the name of the JSP inserted into the template (it would also be nice to have the path info available as well).  It seems the only way to get this functionality is with Java classes as you can insert a classname but the functions library for live templates is mostly Java centric and lacks some more generic features.

3 comments

Hi Marc,

Right, there is no way to specify arbitrary non-java file name/path info within live template.

However, I don't have any objection to expand predefined live template macros set in order to include them.

Can you submit corresponding ticket to IDEA tracker for that? It would be nice to specify other live template macros suggestions if any. I see the following two for now:

  • file name;
  • path info from current file to IDEA module source root;


Regards, Denis

0

Please sign in to leave a comment.