General Issues When Dealing With File Templates

In 2024.2 not sure which other versions, it seems you cannot properly name File Templates.

  • Add a new (C#) file template
  • Give it a description (eg: asdf)
  • Click on any another file template
  • Click back on your new file template
  • The description you entered is mangled (eg: a)
0
5 comments

Another issue, if you use the “group” feature, if you create a file from a group, then it does not get its default file name.

  • Add a new (C#) file template
  • Make sure it has a default file name (eg: asdf.txt)
  • Give it a group value (eg: asdf)
  • Save your template
  • Use your template
  • The selection dialog starts with empty filename text box instead of a default

I suppose this one could be intentional since you could choose from the list of files, each having a different default filename.

0

Another issue, if you create a file template with, I think, an unusual file extension, the resulting file will be empty.

  • Add a new (C#) file template
  • Give it a name that includes a non-standard file extension (eg: NewFile.asdf)
  • Give it a body of some kind
  • Save your template
  • Use your template
  • Open the resulting file in a text editor
  • The file is empty instead of having the body you entered (and I suspect that its macros would not have been processed either)

I suppose this is because Rider does not know about the kind of file so cannot open it and so cannot process its contents. But at the very least you could still copy the raw body to the file even if you think you can't process the macros.

0

Another issue, if you export your file templates to a different settings file, the “add to new… menu” value is not preserved and becomes unchecked after the export.

  • Have two separate settings layers
  • Edit the first layer
  • Create a new file template, ensuring that 'Add To New… menu' is checked (true)
  • Save your file template
  • Export your layer to the second layer, making sure to export file templates (probably export everything)
  • Edit your second layer
  • The ‘Add to New… menu’ option is not checked
0

For the problem of “missing descriptions”, please save the new-created template before editing other templates. 

The default File Name in the template will be ignored if you are using Template Group.

If you want to add a new type of template, please use the File | Settings | Editor | File Templates | Other Languages, add the new extension name and save the language type. Only the C# files should be archived in C# File Templates.

The “Add to New menu” setting will not be exported to prevent the potential conflicts. But you can save the “Add to New menu” in team-shared dotsettings, and share the settings in VCS directly. It's not required to be imported, as personal settings could overwrite some settings.

 

0

For the problem of “missing descriptions”, please save the new-created template before editing other templates. 

Well, yes, that is a work around for the bug that I am reporting, sure.

File | Settings | Editor | File Templates | Other Languages”

That option does not seem to exist.

0

Please sign in to leave a comment.