This extension will give developers a lot of Salesforce code snippets which can be easily used while writing code in Apex and Aura Components to write code faster.
Tip: Click on above badges to open the list of respective language snippets and their prefixes.
Few commonly used Salesforce snippets
Advanced for loop
System debug without variable
Call Apex Action
But those are not all the snippets! To explore all the other snippets available in the extension, go to the docs folder.
The Available Snippets section has direct links to language wise snippet reference.
How to use?
After installing the extension in VS Code, the snippets will start appearing automatically when a file with appropriate language is opened.
Each snippet has a really short trigger text/snippet prefix which you can type in and VS Code IntelliSense will show the available snippets.
For example: if you are writing an Apex Test class and want to write a new test method:
press Tab or press Enter when VS Code shows the list of snippets
... and a test method with placeholders will be inserted in your class!
Note: tabCompletion option in VS Code must be enabled for this to work with Tab press.
The snippets will be added continuously as and when we find more use cases. Any feedback and pull requests are welcome.
Extension installation is as easy as clicking a button from Extensions window in VS Code. To install,
Go to File > Preferences > Extensions or press Ctrl + Shift + X
Search for Salesforce Snippets
If you see any issue(s) or have any enhancement request(s), feel free to create an issue on GitHub.