A collection of Apex commands for optimizing modern Salesforce/force.com development productivity.
For this package to function properly, please don't forget to install mavensmate-atom which will add the language grammars for these snippets.
apm install atom-apex-snippets
Feel free to let me know (link) what else can be improved/added or you can also submit a PR.
Snippets are optimized to be short and easy to remember. Some snippets are "chainable" and render differently when preceded by a ".".
commentMethod⇥
java doc method comment/*** @description your_method_description* @param param_name your_param_description* @return return_type your_return_description**/$1
commentModule⇥
java doc module comment/*** The ____ program implements/is used for.....** @author*/
if⇥
if statementif(${1:condition}) {${2}}$3
else⇥
else statementelse {${1}}$2
ifelse⇥
else statementif(${1:condition}) {${2}} else {${3}}$4
elseif⇥
else if statementelse if (${1:condition}) {${2}}${3}
for⇥
for loopfor (Integer ${1:i} = 0; ${1:i} < ${2:iterable}${3:.length}; ${1:i}++) {${4}}${5}
fore⇥
iterator based for each loopfor(${1:object_type} ${2:var_name}: ${3:collection_name}) {${4:var_name}}$5
while⇥
while loopwhile (${1:condition}) {${2}}$3
trycatch⇥
try/catch statementtry {${1}} catch(Exception ${2:exception_name}) {${2:exception_name}}$4
tryfinally⇥
try/finally statementtry {${2}} finally {${2}}$3
trycatchfinally⇥
try/catch/finally statementtry {${1}} catch(Exception ${2:exception_name}) {${2:exception_name}} finally {${3}}${4}
class⇥
class${1:pub_or_priv} class ${2:ClassName} {${3}}$4
constructorPublic⇥
public class constructor${1:public} ${2:ClassName} (${3:Parameters}) {${4}}$5
constructorPrivate⇥
private class constructor${1:private} ${2:ClassName} (${3:Parameters}) {${4}}$5
methodPublic⇥
public method${1:public} ${2:ClassName} (${3:Parameters}) {${4}}$5
methodPrivate⇥
private method${1:private} ${2:ClassName} (${3:Parameters}) {${4}}$5
methodStatic⇥
static method${1:pub_or_private} static ${2:ClassName} (${3:Parameters}) {${4}}$5
debug⇥
System.debugSystem.debug('*** ${1:object}: ' + ${1:object});$2
assertEquals⇥
System.assertEqualsSystem.assertEquals(${1:expected}, ${2:actual});$3
assertNotEquals⇥
System.assertNotEqualsSystem.assertNotEquals(${1:expected}, ${2:actual});$3
soql⇥
soql query[SELECT ${2:field} FROM ${1:sObject}]$3
r⇥
returnreturn ${1};${2}
rt⇥
return truereturn true;
rf⇥
return falsereturn false;
rth⇥
return thisreturn this;
rn⇥
return nullreturn null;
r0⇥
return 0return 0;
r1⇥
return 1return -1;
r-1⇥
return -1return -1;
testMethod⇥
Test Method@isTest${1:pub_or_private} static void ${2:MethodName}Test() {${3}}$4
testSetup⇥
Test Setup@TestSetupstatic void setup() {${1}}
insert⇥
insertinsert ${1:sObject};${2}
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.