File and Code template - creating new code templates

From the docs about creating templates:

You can edit the templates available on this tab to modify how WebStorm generates these constructs, but you cannot create new ones. To create custom code snippets, use live templates.

 

That's inconvenient - and seems like a strange limitation to put. Yes lives templates are nice, but what prevents Webstorm from being able to let us add file templates? Any work around (other than creating the file, then separately using code snippets within that new file)?

1 comment
Comment actions Permalink

>what prevents Webstorm from being able to let us add file templates?

Nothing.

WebStorm does support creating custom file templates, the process is described in https://www.jetbrains.com/help/webstorm/using-file-and-code-templates.html#create-new-template

The limitation mentioned in the quoted passage applies to templates in the Code tab - these are templates used by the built-in code generators/refactorings, like Implement members quick fix or Create React component. You can't create a file template that would use custom code templates neither you can create new code templates to be shown in this tab using UI, this can only be dome through plugins

0

Please sign in to leave a comment.