Apex code templates

Issue #26 resolved
Scott Wells repo owner created an issue

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)

  1. Sergey Trusov

    Can I create my own code template? I have a lot of code snippet for Sublime Text and would like convert it for IDEA.

  2. Log in to comment