Image
visual-studio-code

How to set up Visual Studio Code?

Gopal Agrawal
April 17, 2020

Introduction:

Visual Studio Code (an IDE), includes the following features:

  • Code Editor
  • Build automation tools
  • A debugger
  • Intelligent code completion

Install Visual Studio Code:

Users can install Visual Studio Code on any computer running macOS, Windows, or Linux. The system requirements are less so we can run on just about any machine.

  1. Download and install the latest version of Visual Studio Code for operating system. If Visual Studio Code already installed, there is no need to reinstall it.
    syntax_image
  2. Launch Visual Studio Code.
    syntax_image

Make Visual Studio Code Salesforce Ready:

This tool has a lot of features that make it a great development environment. Below are steps to install Salesforce CLI and Salesforce Extensions for VS Code. Learn more about Salesforce services

  • Install the Command Line Interface (CLI)
    Salesforce CLI can be used to control the full application life cycle of Salesforce apps. Through the CLI, we can easily create or connect to environments for development and testing and synchronize metadata and code between orgs and a version control system.
  • Install the Salesforce Extension Pack
    • Extension pack consists of all the essential Salesforce extensions and can install all at once, saving users from selecting each one individually. The extensions provide integrations with Salesforce tooling throughout VS Code. Users can invoke Salesforce CLI from a variety of places (VS Code menus, shortcut keys, and right-click context menus).
      • Language Services for Apex
      • Language Services for Visualforce
      • Language Services for Lightning Components (Aura and Lightning Web Components)
      • Integrations in the activity bar for Apex tests and Replay Debugger.
    • Launch Visual Studio Code.
    • On the left toolbar, click the Extensions icon Visual Studio Code's Extension icon.
      syntax_image
    • Enter Salesforce Extension Pack in the search field. VS Code search result for Salesforce extension pack.
    • Click into the card that says Salesforce Extension Pack.
      syntax_image
    • Then in the newly launched window, click the green Install button.
    • Close and relaunch Visual Studio Code to complete the installation.

Authenticate to Salesforce Org:

  • Press Command + Shift + P on Mac or Ctrl + Shift + P on Windows to make the command palette appear.
    syntax_image
  • Type SFDX: Authorize an Org.
  • To accept the default login URL, press Enter.
    syntax_image
  • Enter the alias VSCodePlayground.
  • Notice that your default browser opens a new Salesforce login window. Log in to your playground using your playground username and password retrieved from the last step.
  • When you are asked to grant access to the connected app, click to allow.
    syntax_image

About the Author

Gopal Agrawal, Senior Technical Analyst, CRM

Gopal Agrawal is working with Jade Global as a Senior Technical Analyst in CRM. He has 5+ years of extensive experience in rolling out, multiple successfully delivered & implementing projects on Sales cloud, Lightning, Service Cloud, Communities. He is fervent to acquaint himself with the new things. He is a dedicated team member with proven leadership and communication skills.

Add New Comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.