Use file's path in file template

I'm trying to update the Typescript file template and add a reference that would look something like:

/// <reference path="../../../include/reference.ts" />

where the path would vary depending on where the new file is getting created.  The standard variables only include the file's name, not path.  Is there a way to define a new variable that would have the path so the file template can automatically add the needed reference?

2 comments
Comment actions Permalink

Hello!

no, there are no such macros. http://youtrack.jetbrains.com/issue/WI-15521 asks for a variable that would expand to a file patn relative to the project root; I've been unable to find existing requests for variables expanding to the relative path from current file to certain file, and I can hardly imagine where this path can be taken from when creating a new file. Would you expect a possibility to select the <referenced_file>.ts when creating a file?
Please feel free to file a request for this feature to http://youtrack.jetbrains.com/issues/IDEA

0
Comment actions Permalink

I should have been more specific, but that other ticket is close to what I need.  I'd ideally like to have a macro that gives relative path to the src root, and I'd do something like ${srcRoot}/include/reference.ts or similar.

Thanks.  I'll make a feature request.

0

Please sign in to leave a comment.