- changed version to Unassigned
Apex code templates
Issue #26
resolved
Add live templates for:
- sd - System.debug();
- pro - Read-only property getter/setter
- prw - Read/write property getter/setter
- nl - create and assign new List
- ns - create and assign new Set
- nm - create and assign new Map
- psf - public static final
- psfi - public static final Integer
- psfs - public static final String
- St - String
- thr - throw new
- iter - iterate a collection
- itar - iterate an array
- ritar - reverse iterate an array
- itli - iterate a list
- itme - iterate a map's keys and values
- fori - for loop
- ifn - if null
- inn - if not null
- inst - if instanceof
- lazy - lazy initialization
- lst - last element of array or list
- sq - SOQL query
- sqv - SOQL query assigned to List variable
- sqv1 - SOQL query assigned to single item safely
- sqit - iterate SOQL query results
- sqbit - bulk iterate SOQL query results
And surround with templates for:
- if
- if / else
- while
- do / while
- for
- try / catch
- try / catch / finally
- try finally
- sra - System.runAs()
Comments (9)
-
reporter -
Can I create my own code template? I have a lot of code snippet for Sublime Text and would like convert it for IDEA.
-
reporter Yes, but with limitations. In order for you to implement full-featured versions of iter, itar, etc., I'd need to add support to the plugin. However, for simpler code snippets you should be able to use IDEA's live template feature:
https://www.jetbrains.com/idea/help/live-templates-2.html
Hopefully that helps!
-
Thanks, I already created live templates, but I did not have enough support Apex syntax.
-
reporter -
assigned issue to
- changed version to 1.7.2.9
I've made considerable progress on this and will be including it in the next release.
-
assigned issue to
-
reporter - edited description
-
reporter - edited description
-
reporter - edited description
-
reporter - changed status to resolved
Delivered in 1.7.2.9.
- Log in to comment