arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

VS Code Configuration

hashtag
Why Visual Studio Code?

Visual Studio Code (VSCode) is a free, cross-platform code editor with a strong plug-in community which extends its capabilities. Salesforce has created plug-ins to work with VSCode and has become the preferred editor for editing code with SFDX.

Visual Studio Code can be used by both developers and QA staff alike.

hashtag
VS Code SFDX Setup

hashtag
Prerequisites

  1. GIT

    1. The from GitHub is a great resource for setting up and configuring GIT

      1. Mac Users - You may want to consider

hashtag
Download VS Code

Getting a workstation setup with VSCode and configured for Salesforce development is a straightforward approach, the steps below outline what is needed to perform regardless if the developer or quality assurance engineer is running on a PC or a Mac.

  1. Download and Install Visual Studio Code

  2. Java 11 Platform, Standard Edition Development Kit Some features in Salesforce Extensions for VS Code depend upon (Standard Edition Development Kit (JDK))

Connect VS Code to Azure DevOps GIT Repos

Learn DX

You may want to follow this trail to get familiar with Salesforce DX

hashtag
Salesforce SFDX Setup

Salesforce needs to be configured to enable SFDX. This is a one-time setup for the Developer org.

  1. Setup and G2P in your Salesforce edition

    1. Navigate to Setup > Settings > Development > Dev Hub

    2. Move the slider to enable Dev Hub and G2P Packaging

hashtag
Additional VS Code Plugins for SFDX Projects

  • - Provides realtime feedback on writing better code.

    • Connects with (free for public projects ~$10/mo for most Salesforce projects)

hashtag
VS Code Configurations

Automatically push code to org when saving:

salesforcedx-vscode-core.push-or-deploy-on-save.enabled to true.

hashtag
Resources

Trailhead Module:

-- Valerie Belova

  • The AdoptOpenJDKarrow-up-right is a recommended alternative to Oracle's Java which carries licensing fees.

  • Install the Salesforce CLIarrow-up-right

  • Install the official Salesforce Extension Packarrow-up-right into Visual Studio Code.

  • Configure Settings in Visual Studio Code to point to the JVM

    1. Open Settings, Navigate to User

    2. Select Salesforce Apex Configuration

    3. Select Java: Home and set path correctly (See example below)

  • From a command prompt in Visual Studio Code issue sfdx force:auth:web:login to log into the Dev Hub using the CLI, which will authorize you to create scratch orgs.

    Prettierarrow-up-right - Keeps code formatting consistent

  • C#arrow-up-right - For building Automated UI Tests with Selenium

  • XMLarrow-up-right - Helps with working with XML Files

  • GIT Guidearrow-up-right
    connecting with SSH and adding SSH key to the SSH Agentarrow-up-right
    https://code.visualstudio.com/downloadarrow-up-right
    Javaarrow-up-right
    Dev Hubarrow-up-right
    SonarLintarrow-up-right
    SonarCloudarrow-up-right
    Details on how to configure SonarLint
    Salesforce Visual Studio Code Extensions Home Pagearrow-up-right
    Salesforce CLI Installation Instructionsarrow-up-right
    Quick Start: Visual Studio Code for Salesforce Developmentarrow-up-right
    SFDX Developer Starter Kit Trailmix | Salesforce TrailheadTrailheadchevron-right
    Version Controlling with Git in Visual Studio Code and Azure DevOpsazuredevopslabs.comchevron-right
    Logo
    Logo