Telerik® JustCode™ by Progress

Code Templates are reusable code snippets that allow you to quickly insert commonly used code fragments or surround given code fragment with a meaningful code block (example: try-catch statement). For more information how to import or export templates visit Code Templates

Different Code Templates are available for C#, VB .NET, JavaScript, HTML, CSS and LESS.

In general there are four groups of templates - iteration, surrounding, file and other.

To list all available templates you press Alt+End. To apply a template just select it from the pop-up menu.

When inserting a template Telerik® JustCode™ helps you in number of ways:

  1. Create a new file and expand template inside it (in case of file templates).
  2. Declare the type of variables for you, depending on the template, what type of variable can the selected template work with and what available variables for this type you have access to. For example, if you choose a foreach template it only works with array or an object collection. In this case Telerik® JustCode™ will let you choose between all array/object collection values within your class.
  3. Depending on the template, Telerik® JustCode™ suggests items for the current context.

    Code Template Context Items
  4. Acronyms help you expand your template only by entering a specified abbreviation for it.

    To use a template with acronym enter the abbreviation and press Shift+Space (by default). The template will be generated for you.

    You can change the shortcut combination from JustCode Options window.

  5. Provide a help pop-up that lets you Change Variable choice, Commit Variable choice, Finish or Abort the operation.

    Code Templates Help Popup

    Change Variable Choice iterates through all available variables within your class that are valid for the current variable.

  6. By pressing Enter JustCode automatically moves to the next undeclared variable in the template.

Iteration Templates

Iteration templates are those which insert iteration statements like for, foreach, while, etc.

Predefined Iteration Templates

  • foreach
  • for1
  • for2
  • for3

Surround Templates

Surround templates are those which insert a surrounding statements like if, try-catch, etc.

Predefined Surround Templates

  • if
  • try-catch

File Templates

File templates are those which insert a code snippets into a newly created file.

Predefined File Templates

  • class
  • interface
  • enum
  • etc.

Other Templates

Other templates are those which doesn't fall in the other three categories like insert if, insert Console.WriteLine, etc.

Predefined Other Templates

  • Insert if
  • Insert Console.WriteLine

See Also