Visual Studio Code is a streamlined code editor with support for development operations like debugging, task running, and version control. It is completely free and aims to provide the tools a developer needs for a quick code-build-debug cycle.
Visual Studio Code is probably now the go-to developer program used in the Salesforce ecosystem. Its open-sourced nature makes it perfect for coders, while its ease of use makes it ideal for admins and non-coders alike to do more rudimental tasks. In this article, we’ll cover what VS Code Extensions are, and the top extensions the team at Salesforce Ben and the wider community think any Salesforce professional will find useful.
What are VS Code Extensions?
VS Code Extensions let you add languages, debuggers, and tools to your installation to support your development workflow. They are the equivalent of Salesforce apps installed through the AppExchange, adding additional functionality you may otherwise be lacking.
Salesforce Extensions Pack (Expanded)
If there’s one set of extensions anyone working with VS Code and Salesforce needs, it is most definitely the Salesforce Extensions Pack. This pack isn’t a single extension, but rather 13 extensions grouped together. The pack is an upgrade from the standard Salesforce Extensions Pack which only includes 9 of the following.
This combines many capabilities from several Salesforce APIs, including Metadata API, Tooling API, and SOAP API. This also supports the functionality of the Ant Migration Tool. This can be used to create and manage orgs, synchronize source to and from orgs, create and install packages, and more.
This view outlines Apex classes and triggers, see code-completion suggestions, and finds syntactic errors in your code. The extension is powered by the Apex Language Server.
Apex Interactive Debugger
This extension enables VS Code to use the real-time Apex Debugger with your scratch orgs or to use ISV Customer Debugger for your subscriber’s org.
Apex Replay Debugger
This extension enables VS Code to replay Apex execution from Apex debug logs.
This extension enables Aura component bundles. It uses the HTML language server from VS Code.
Lightning Web Components
This extension supports Lightning web component bundles. It uses the HTML language server from VS Code.
Salesforce Lightning Design System (SLDS) Validator
This component simplifies working with the SLDS. It provides code completion, syntax highlighting, and validation with recommended tokens and utility classes.
This VS Code extension provides support for creating and editing XML documents, based on the LemMinX XML Language Server.
This extension enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary. It supports many programming languages andformats your code automatically when you press save, saving you time and energy.
The Apex PMD (programming mistake detector) extension allows you to run Apex Static Analysis directly in VS Code.
Apex Log Analyzer
Apex Log Analyzer makes performance analysis of Salesforce debug logs much quicker and easier. It provides visualization of code execution via a Flamegraph and Calltree and helps identify performance and SOQL/DML problems via Method and Database Analysis.
Outside of the Salesforce Expansions Pack there are many other extensions that can be invaluable for using VS Code.
This extension enables you to interactively build a SOQL query via a form-based visual editor, view the query as you build, and save the output to a .csv or .json file.
Salesforce Package.xml Generator for VS Code
Those familiar with moving change sets between Sandboxes and Production environments will find this extension particularly useful. It allows you to select metadata files from within the UI of VS Code, much in the same way you would select them when creating a change set.
Auto Rename Tag
This extension gives you the ability to automatically rename a paired HTML or XML tag within your code.
This extension helps you understand your code better by giving you quick glimpses into who, why, and when code has been altered. You can effortlessly go back through the history and evolution of your codebase, allowing you to understand how the code has evolved over time.
As the name suggests, this extension is like a Polaroid camera for your code. Perfect for getting a screenshot of your code exactly how you want it.
With VS Code being such an important tool for developing with Salesforce, getting the right extensions will make all the difference. The Salesforce Extensions Pack will be an absolute must for using VS Code with Salesforce, but outside of these, there are many other extensions that have the ability to make your life much easier.