ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Create source code using live templates

Last modified: 23 September 2024

Live templates are ReSharper's far more intelligent version of Visual Studio's code snippets. Unlike code snippets, ReSharper's templates can predict from the context, which variables, fields, and types can be used. In most cases you do not need to type anything yourself — just choose from a list of suggested values.

ReSharper provides plenty of predefined live templates for all supported languages. The list of predefined templates includes templates for iterating through collections, writing assertion methods, creating new arrays, outputting values, coding LINQ queries, generating auto-properties, and more.

Below are several examples that show how live templates are commonly applied.