ReSharper | Templates Explorer | Live Templates | JavaScript
This topic lists all predefined live templates for JavaScript in ReSharper 2017.1 EAP 8. 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)
nguid
Insert new GUID
Scope everywhere
Body
$GUID$
Parameters
GUID - Generates new Globally Unique Identifier (GUID) (guid)
do (Imported JScript Snippets)
Code snippet for do...while loop
Scope JS statements
Body
do{$END$}while($COND$)
Parameters
COND - no macro
END - The caret position after the template is applied.
dw (Imported JScript Snippets)
Code snippet for a writeln function call
Scope JS statements
Body
document.writeln($END$);
Parameters
END - The caret position after the template is applied.
else (Imported JScript Snippets)
Code snippet for an else statement
Scope JS statements
Body
else{$END$}
Parameters
END - The caret position after the template is applied.
for (Imported JScript Snippets)
Code snippet for a for loop
Scope JS statements (up to ES 5, not in TS)
Body
for(var$VAR$=0;$VAR$<$LENGTH$;$VAR$++){$END$}
Parameters
VAR - Suggests non-used name which can be used for an index variable at the evaluation point. (suggestIndexVariable)
LENGTH - no macro
END - The caret position after the template is applied.