GenerApex for Visual Studio Code
The extension is intended to simplify the work with SFDX and the Apex language when developing on Salesforce. It allows to generate all types of Apex classes, provides new tools and capabilities for the code editor, adds new snippets for docs generation.
Prerequisites
Before you set up GenerApex for VS Code, make sure that you have these essentials.
- Salesforce CLI
- SFDX
- Java Platform, Standard Edition Development Kit
Synebo Create Commands (Ctrl+Shift+P)
SBC: Apex class
Parameters: Class name, Path.
SBC: Batch Apex class
Parameters: Class name, Path, sObject name, Batch type, Additional functionality
SBC: Queueable Apex class
Parameters: Class name, Path, Additional functionality
SBC: SBCheduler Apex class
Parameters: Class name, Path
SBC: Apex Unit Test
Parameters: Class name, Path
SBC: Interface Apex class
Parameters: Class name, Path
SBC: Lightning controller Apex class
Parameters: Class name, Path
SBC: REST Apex class
Parameters: Class name, Path
SBC: Generate constructor
Parameters: Select class attributes in the editor and call the command
SBC: Generate getters and setters
Parameters: Select class attributes in the editor and call the command
SBC: Rename refactoring
Parameters: Step 1. Select the word you want to change (class, method, variable). Step 2. Call the command. Step 3. In the window that appears, enter the change and confirm (Enter key).
SBC: Override and Implements Methods
Parameters: Call the command to implement the added interfaces.
Snippets
Default prefix: !!
Settings > Extensions > Snippets for Salesforce Developers and modify the Prefix value
Apex
callout
Generation of a call to the REST service
doc method
Add a new block comment for your method. The comment includes basic information about your method explained with different tags. By default, it will include the name, author, created, description, param and return tags. Other additional tags can be included inside this comment
doc class
Add a new block comment for your class. The comment includes basic information about your class explained with different tags. By default, it will include the name, author, created, description and a changelog with version tags. Other additional tags can be included inside this comment
doc @name
Add a new @name tag for your class and method comments. It represents the name of your class or method
doc @author
Add a new @author tag for your class and method comments. This includes the name and the email of the author. By default, these values will be filled automatically if there is an existing git cofiguration for the current project
doc @created
Add a new @created tag for your class and method comments. This indicate the date when the code was originally created. By default, the date will be filled automatically to today
doc @description
Add a new @description tag for your class and method comments. You can provide an explanation of what your code does
doc @version
Add a new @version tag for your class comments. This refers is used to generate a change log, in which every contribution specifies the version, the date, the author and a description of the changes done
doc @param
Add a new @param tag for your method comments. Multiple @param lines can be included, and each of them will include its object type and name
doc @return
Add a new @return tag for your method comments. This option describes what is returned in your method. Omit this tag for methods that returns void
doc @exception
Add a new @exception tag for your method comments. This contains the type and a description of the exception that can potentially be thrown from your method
doc @deprecated
Add a new @deprecated tag for your class and method coments. You can provide a description of why this code has been deprecated, in which API version and whether it has been replaced by another functionality
Aura
doc auradoc structure
Create the basic structure for the auradoc file
doc title
Insert a title in your auradoc description
doc paragraph
Insert a paragraph in your auradoc description
doc inline code
Insert an inline block of code in your auradoc description
doc link
Insert a link to a URL in your auradoc description
doc code block
Insert a full code of block inside your auradoc description
doc bulleted list
Insert a bulleted list in your auradoc description
doc numbered list
Insert a numbered list in your auradoc description
doc table
Insert a table in your auradoc description
doc aura:example
Create a new example reference in your auradoc