Add variables to file template geneator

Hi,

As in my school, we have a specific header for C files (.c/.h), generally generated with Emacs, I would like to add the necessarily template file in CLion to avoid using external tools.

However, the actual file template system miss from some variables (SECOND, DAY_NAME_SHORT and FILE_PATH), so posted an issue (https://youtrack.jetbrains.com/issue/IDEA-137640) some month ago.

As it doesn't look to be a JetBrains priority, I would like to implement them by myself in the community edition. I tried to find where velocity template' variables are defined, but I didn't found them.

So, could someone tell me where they are defined so I'll try to add this 3 new variables ? (Or maybe they are already defined, but with a different name ?).

Thank you for your help.

3 comments
Comment actions Permalink

See com.intellij.ide.fileTemplates.impl.FileTemplateManagerImpl#getDefaultProperties

1
Comment actions Permalink

Hi,

Thank you. I added the necessarily variables for the date and time, but how are managed variables specifics to a file, like the file name or (what I'm looking for), the file path ?

0
Comment actions Permalink

See com.intellij.ide.fileTemplates.FileTemplateUtil#createFromTemplate()

0

Please sign in to leave a comment.