Predefined Live Templates for JavaScript
This topic lists all predefined live templates for JavaScript in JetBrains Rider 2017.2. For more information about live templates, see Creating Source Code Using Live Templates
Template | Details |
---|---|
ctx | Current file context Scope everywhere Body $CTX$ Parameters
|
nguid | Insert new GUID Scope everywhere Body $GUID$ Parameters
|
do (Imported JScript Snippets) | Code snippet for do...while loop Scope JS statements Body do {
$END$
} while($COND$) Parameters
|
dw (Imported JScript Snippets) | Code snippet for a writeln function call Scope JS statements Body document.writeln($END$); Parameters
|
else (Imported JScript Snippets) | Code snippet for an else statement Scope JS statements Body else {
$END$
} Parameters
|
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
|
for (Imported JScript Snippets) | Code snippet for a for loop Scope JS statements (ES 6) Body for ($VARKIND$ $VAR$ = 0; $VAR$ < $LENGTH$; $VAR$++){
$END$
} Parameters
|
forin (Imported JScript Snippets) | Code snippet for a for...in loop Scope JS statements (up to ES 5, not in TS) Body for (var $VAR$ in $ARRAY$){
$END$
} Parameters
|
forin (Imported JScript Snippets) | Code snippet for a for...in loop Scope JS statements (ES 6) Body for ($VARKIND$ $VAR$ in $ARRAY$){
$END$
} Parameters
|
forr (Imported JScript Snippets) | Code snippet for a reverse for loop Scope JS statements (up to ES 5, not in TS) Body for (var $VAR$=$LENGTH$-1;$VAR$ >=0; $VAR$--){
$END$
} Parameters
|
forr (Imported JScript Snippets) | Code snippet for a reverse for loop Scope JS statements (ES 6) Body for ($VARKIND$ $VAR$=$LENGTH$-1;$VAR$ >=0; $VAR$--){
$END$
} Parameters
|
fun | Create JavaScript function Scope JS expressions Body function($parameters$){
$END$
} Parameters
Before expansion |
function (Imported JScript Snippets) | Code snippet for a function Scope JS statements Body function $name$($parameters$){
$END$
} Parameters
|
if (Imported JScript Snippets) | Code snippet for an if statement Scope JS statements Body if ($COND$){
$END$
} Parameters
|
while (Imported JScript Snippets) | Code snippet for a while loop Scope JS statements Body while ($COND$){
$END$
} Parameters
|
with (Imported JScript Snippets) | Code snippet for a with statement Scope JS statements Body with ($EXPR$){
$END$
} Parameters
|
switch (Imported JScript Snippets) | Code snippet for a switch statement Scope JS statements Body switch ($EXPR$){
case $CASE1$:
$END$
default:
} Parameters
|
try (Imported JScript Snippets) | Code snippet for a try catch statement Scope JS statements Body try {
$END$
} catch (e) {
} Parameters
|
itar | Iterate an array Scope JS statements Body for (var $INDEX$=0;$INDEX$<$ARRAY$.length;$INDEX$++){
var $VAR$ = $ARRAY$[$INDEX$];$END$
} Parameters
Before expansion |
generator (Imported JScript Snippets) | Code snippet for a generator Scope JS statements (ES 6, not in TS) Body function *$name$($parameters$){
$END$
} Parameters
|
forof (Imported JScript Snippets) | Code snippet for a for-of loop Scope JS statements (ES 6) Body for ($VARKIND$ $VAR$ of $ARRAY$){
$END$
} Parameters
|