ReSharper | Templates Explorer | Live Templates | VB.NET
This topic lists all predefined live templates for VB.NET in ReSharper 2016.1.1. For more information about live templates, see Creating Source Code Using Live Templates
Template
Details
ctx
Current file context
Scope everywhere
Body
$CTX$
Parameters
CTX - Provides list of items describing current context. This includes file name, containing type name, namespace name, etc. (context)
foreach
For Each block
Scope VB.NET 8+ statements
Body
ForEach$VAR$As$TYPE$In$COL$$END$Next
Parameters
COL - Show basic code completion list at the point where the variable is evaluated (complete)
TYPE - Analyzes code and guesses type of element of a collection. (guessElementType)
VAR - When exectuted in variable declaration (where variable name should stand), suggests name for the variable. (suggestVariableName)
END - The caret position after the template is applied.
Before expansion After expansion
After you specify the parameters, the caret is positioned so that you can continue coding the loop body.
ARR - Suggests variable which type is array type (arrayVariable)
VAR - Suggests non-used name which can be used for an index variable at the evaluation point. (suggestIndexVariable)
TYPE - Analyzes code and guesses type of element of a collection. (guessElementType)
ELEM - When exectuted in variable declaration (where variable name should stand), suggests name for the variable. (suggestVariableName)
END - The caret position after the template is applied.
Before expansion After expansion
After you specify the parameters, the caret is positioned so that you can continue coding the loop body.
Dim
Declare a variable
Scope VB.NET 8+ statements, VB.NET 8+ type members
Body
Dim$VAR$As$TYPE$
Parameters
TYPE - no macro
VAR - When exectuted in variable declaration (where variable name should stand), suggests name for the variable. (suggestVariableName)
Before expansion After expansion
asrt
Make an assertion
Scope VB.NET 8+ statements
Body
System.Diagnostics.Debug.Assert($END$)
Parameters
END - The caret position after the template is applied.
Before expansion After expansion
The template calls the
System.Diagnostics.Debug.Assert() method.
After the template expands, the caret moves between the parentheses so that you can specify a condition.
out
Print a string
Scope VB.NET 8+ statements
Body
System.Console.WriteLine("$END$")
Parameters
END - The caret position after the template is applied.
Before expansion After expansion
outv
Print value of an expression
Scope VB.NET 8+ statements
Body
System.Console.WriteLine("$EXPR$ = {0}",$EXPR$)
Parameters
EXPR - Suggests variables of the specified type. (variableOfType)
Before expansion After expansion
pssm
Public Shared Sub Main
Scope VB.NET 8+ type members
Body
PublicSharedSubMain$END$EndSub
Parameters
END - The caret position after the template is applied.