Configurable email in a file header template

Answered

I want to use a solution or team header template but specify something like $EMAIL$ to be specific for developer who created a file. Is it possible to define a part of a header to insert a user configurable variable?

0
7 comments
Official comment

Hello Denis Kruchkov,

Thank you for contacting us.
Unfortunately, it's not possible to define a part of a header to insert a user configurable variable.
Here's a corresponding feature request - https://youtrack.jetbrains.com/issue/RSRP-274379.

Mentioned feature request says that it is possible for file templates. Is it the case?

0

Denis Kruchkov,

Yes, it's possible for a File template, but keep in mind, in this case, you can't add this File Header to existed files.
When you create a new File template, you can specify whatever you want as code for the template including custom variables. Here you can read more about it.

0

I've read proposed article and couldn't understand how can I make what I need. I can define my own variable but then I need to specify a macro for it. How can I make a file template where $EMAIL$ would be replaced with an email of a person who used this template?

0

Hello Denis Kruchkov,

You may provide a list of emails as a "Comma-delimited list of values" macro in a file template.

  1. Go to ReSharper | Tools | Templates Explorer | File Template.
  2. For example, choose C# | Class or create a new File template where you want to add an Email variable. 
  3. Add $EMAIL$ to a file header.
  4. You will see an EMAIL parameter in the Parameters list.
  5. Select the "Comma-delimited list of values" macro in the list for the parameter.
  6. Specify all the emails separated by a comma.
  7. Save the template.
  8. Then in your Project click Add | New from Template | Class (or your Template). The new file will be created with code completion for the EMAIL placeholder where you can type to filter items.

0

As you may expect the list isn' known in advance. But even if it is known it is very inconvenient to select it each time. For some particular person it is fixed. What could help is to refer to a variable or template defined at the different configulation layer, e.g. specific for computer. Or define an own macro. Is it possible?

0

Yes, we understand your point. For now, we are waiting for other people to vote for this request - https://youtrack.jetbrains.com/issue/RSRP-274379. If there are enough votes, we will consider implementing it.

 

0

Please sign in to leave a comment.