Custom File Type in File -> New
Answered
Is there a way to add my file type to the File -> New popup? :
Please sign in to leave a comment.
Hi Milo,
See https://plugins.jetbrains.com/docs/intellij/using-file-templates.html#creating-new-files-from-template
Also, get familiar with the whole file templates feature: https://plugins.jetbrains.com/docs/intellij/file-and-code-templates.html
Hi Karol,
great, worked fine, thx. I extended and implemented the CreateFileFromTemplateAction:
and placed my template file into the plugin's resources folder:
Is there a way to have this template file not directly in the src\main\resources, but in a sub-folder?
Milo
Looking at the documentation, it seems that they can be placed in `resources/fileTemplates` directory. Please review the documentation.
Sorry, you are right, the file must be in the sub-folder, e.g.:
It worked in my setup, because I also added the same template through the File -> New -> Edit File Templates...
I'd suggest to add one example of a template file path like mine above to the description here : https://plugins.jetbrains.com/docs/intellij/providing-file-templates.html#creating-file-templates
The theory description there is nice, but without a concrete example it's much harder to adopt it to a specific case.