ReSharper Web Help

ReSharper | Templates Explorer [template type] | [template] | Edit Template | [template parameter] | Choose Macro (Change Macro)

This dialog box helps specify a template macro that ReSharper should use to suggest or guess values for each template parameter. You will use this dialog box when you declare or edit template parameters.

Reference__Choose_Macro__dialog_box

The dialog contains a set of template macros described below.

Macro Details
Date and time when the file was created in specified format Evaluates file creation date and time

Macro parameters:

  • format - text string
Comma-delimited list of values Displays the specified list of values.

Macro parameters:

  • Comma-delimited list of values - text string
Value of another variable, where spaces will be replaced with '_' Changes spaces to '_' (i.e. "do something useful" into "do_something_useful"

Macro parameters:

  • another variable - reference to another parameter in the template
Suggest an array variable Suggests variable which type is array type
    Insert reference to type Evaluates to selected type name.

    Macro parameters:

    • type - type
    Value of another variable with the first character in upper case Capitalizes string value (i.e. changes case of the first letter to upper)

    Macro parameters:

    • another variable - reference to another parameter in the template
    Clipboard content Evaluates to current textual clipboard content
      Execute basic completion Show basic code completion list at the point where the variable is evaluated
        Execute smart completion Show smart code completion list at the point where the variable is evaluated
          Execute type completion Show type completion list at the point where the variable is evaluated
            Constant value Evaluates to the specified constant value.

            Macro parameters:

            • Constant value - text string
            Containing type member name Evaluates to short name of the most inner containing type member (e.g. method or property).
              Containing type name Evaluates to short name of the most inner containing type.
                Provides list of items describing current context Provides list of items describing current context. This includes file name, containing type name, namespace name, etc.
                  Current date in specified format Evaluates current date

                  Macro parameters:

                  • format - text string

                  Tip

                  For more information, see Standard Date and Time Format Strings.

                  Current date and time in specified format Evaluates current date

                  Macro parameters:

                  • format - text string

                  Tip

                  For more information, see Standard Date and Time Format Strings.

                  Containing namespace Evaluates name of the containing namespace
                    Value of another variable with the first character in lower case Decapitalizes string value (i.e. changes case of the first letter to lower)

                    Macro parameters:

                    • another variable - reference to another parameter in the template
                    Default namespace Gets default namespace for the current project
                      Default namespace for current file Gets default namespace for the current file
                        Current file name Evaluates current file name
                          Current file name without extension Evaluates current file name without extension
                            Full user name of the current user Evaluates full name of the current user
                              Guess element type of collection represented by variable Analyzes code and guesses type of element of a collection.

                              Macro parameters:

                              • variable - reference to another parameter in the template
                              Guess element type for expected collection type Guess element type if a collection type is expected at this point
                                Guess type expected at this point Guess type expected at this point
                                  Guess key type of dictionary represented by variable Analyzes code and guesses type of key of a dictionary collection.

                                  Macro parameters:

                                  • variable - reference to another parameter in the template
                                  Guess value type of dictionary represented by variable Analyzes code and guesses type of value of a dictionary collection.

                                  Macro parameters:

                                  • variable - reference to another parameter in the template
                                  New GUID Generates new Globally Unique Identifier (GUID)
                                    Current line number Evaluates to number of the line macro is evaluated at.
                                      Current project output assembly name Evaluates output assembly name for the current project
                                        Suggest parameter of type Suggests parameters of the specified type.

                                        Macro parameters:

                                        • type - type
                                        Name of the current project Evaluates current project name
                                          Current solution name Evaluates current solution name
                                            Suggest enumerable variable Suggests visible variable that can be enumerated (that is, used in foreach loop as collection)
                                              Suggest name for an index variable Suggests non-used name which can be used for an index variable at the evaluation point.
                                                Suggest name for a variable When exectuted in variable declaration (where variable name should stand), suggests name for the variable.
                                                  Suggest variable of type Suggests variables of the specified type.

                                                  Macro parameters:

                                                  • type - type
                                                  Suggest type for a new variable Suggest type for a new variable declared in the template
                                                    Short name of the current user Evaluates current user name
                                                      DependencyProperty type Evaluates to dependency property type specific to current framework
                                                        Suggests attribute name by tag Suggests attribute name used in the same tags in current document
                                                          Suggest attribute value Suggest attribute value for current html tag attribute
                                                            Suggest tag name Suggest tag name used in current document
                                                              ASP.NET Masterpage content generator Generate content for masterpage content placeholders at the point where the variable is evaluated
                                                                ASP.NET MVC Controller Show completion list with available ASP.NET MVC Controllers at the point where the variable is evaluated
                                                                  ASP.NET MVC Action Show completion list with available ASP.NET MVC Actions at the point where the variable is evaluated
                                                                    Insert runat="server" if server-side tag selected Insert runat="server" if server-side tag selected
                                                                      File header Inserts the file header specified in the ReSharper options.
                                                                        Cast to the required type (if the cast is necessary) Inserts (if required) cast to the type which is expected at the left side of assignment expression.
                                                                          Full tag name Inserts full name of containing tag
                                                                            Suggests XML attribute name by tag Suggests XML attribute name used in the same tags in current document
                                                                              Suggests XML attribute name Suggests XML attribute name used in current document
                                                                                Suggests XML tag name Suggests XML tag name used in current document
                                                                                  Tag name Inserts name of containing tag without namespace
                                                                                    Tag namespace Inserts namespace of containing tag

                                                                                      See Also

                                                                                      Procedures:

                                                                                      Reference: