SFDX Unlocked Packages Guide
  • Project Overview
  • Lifecycle Guidance
    • Development Models
    • Team Sprint Collaboration
    • Git Strategy
    • Development Guidance
    • Testing Guidance
    • Agile/DevOps shift-left testing
    • Code Promotion
  • Salesforce DX & CI/CD
    • Quality Hooks
  • Supporting Infrastructure & Environments
    • Environment Types
      • Scratch Org Guidance
      • Sandbox Guidance
      • Handling Secure Data
  • Opinionated Guide
    • Introduction
  • Developer Resources
    • SFDX Package Development
      • Introduction
      • Creating Unlocked Packages
        • Package Errors
      • Project Structure
    • Pipeline Introduction
    • Developer Machine Setup
      • VS Code Configuration
      • Creating the SFDX Project
    • Extras
      • SonarCloud / SonarLint
      • Code Review Checklist
      • Additional External Resources
    • Untitled
  • Running the Org
    • Team Responsibilites
    • Onboarding Resources
  • Journey to Unlocked Packages
    • Introduction
    • Getting Ready for Source Driven Development
    • Moving from Unmanaged to Unlocked
    • Unlocked Guidance
  • Test Automation
    • Manage Test Data
    • UI Test Automation - POM Framework
    • Agile/DevOps Shift-left Testing
    • Selenium Extent Reports - Dotnet Core
    • Dotnet Core Selenium Tests on Azure-devops-pipeline
Powered by GitBook
On this page
  • Why Visual Studio Code?
  • VS Code SFDX Setup
  • Salesforce SFDX Setup
  • Additional VS Code Plugins for SFDX Projects
  • VS Code Configurations
  • Resources

Was this helpful?

Export as PDF
  1. Developer Resources
  2. Developer Machine Setup

VS Code Configuration

PreviousDeveloper Machine SetupNextCreating the SFDX Project

Last updated 5 years ago

Was this helpful?

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.

VS Code SFDX Setup

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

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))

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

  3. Install the Salesforce

  4. Install the official into Visual Studio Code.

  5. 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)

Connect VS Code to Azure DevOps GIT Repos

Learn DX

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

Salesforce SFDX Setup

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

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

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

  1. 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.

Additional VS Code Plugins for SFDX Projects

VS Code Configurations

Automatically push code to org when saving:

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

Resources

Trailhead Module:

-- Valerie Belova

Setup and G2P in your Salesforce edition

- Provides realtime feedback on writing better code.

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

- Keeps code formatting consistent

- For building Automated UI Tests with Selenium

- Helps with working with XML Files

GIT Guide
connecting with SSH and adding SSH key to the SSH Agent
https://code.visualstudio.com/download
Java
AdoptOpenJDK
CLI
Salesforce Extension Pack
Dev Hub
SonarLint
SonarCloud
Prettier
C#
XML
Salesforce Visual Studio Code Extensions Home Page
Salesforce CLI Installation Instructions
Quick Start: Visual Studio Code for Salesforce Development
Version Controlling with Git in Visual Studio Code and Azure DevOps
Logo
SFDX Developer Starter Kit Trailmix | Salesforce Trailheadtrailhead
Logo
Details on how to configure SonarLint