Salesforce Extensions for VS Code

repository·develop·Indexed 21 days ago

https://github.com/forcedotcom/salesforcedx-vscode

Development documentation and tools for integrating Salesforce DX into Visual Studio Code. This repository provides guidance on extension development, architecture, and contribution for Apex, LWC, SOQL, and metadata management. It includes specialized utility packages such as @salesforce/effect-ext-utils for the Effect library, @salesforce/eslint-plugin-vscode-extensions for custom linting rules, and @salesforce/playwright-vscode-ext for end-to-end testing.

Tokens
190.3K
Snippets
526
Records
891
Agent score
74%

What's inside salesforcedx-vscode

  1. Overview of the Salesforce Apex Library

    develop

    The Salesforce Apex Library is a TypeScript library designed to provide core support for two main tools:

    1. Salesforce Extensions for VS Code: The official extension suite for developing Salesforce applications within Visual Studio Code.
    2. Apex Plugin for the Salesforce CLI: The plugin that enables Apex-related commands within the Salesforce Command Line Interface.

    Developers looking to build tools that interact with Apex or integrate with the Salesforce development ecosystem should use this library.

  2. Overview of Salesforce Extensions for VS Code development

    develop

    This repository contains development documentation for VS Code extensions, specifically focused on the Salesforce ecosystem. It serves as an onboarding resource for developers learning VS Code extension development and provides guidance on contributing to the Salesforce extension suite.

    Key areas of focus include:

    • Testing: Unit tests, end-to-end (e2e) testing (using Playwright or legacy RedHat), and code coverage.
    • Build: Processes for bundling, packaging, and publishing extensions.
    • Telemetry: Implementation of usage metrics and logging.
    • Architecture: Best practices for extension activation, naming, logging, environment considerations, and TypeScript patterns.
    • Code Reuse: Utilizing shared libraries, vscode-services, and managing cross-extension communication.
    • Extension Packs: Understanding how extension packs are structured and the criteria for inclusion.
  3. Overview of Salesforce Metadata features

    develop

    The Salesforce Metadata extension enables core development workflows for managing Salesforce source code within VS Code. Key capabilities include:

    • Project Management: Create new Salesforce projects and projects containing manifests.
    • Source Control: Deploy source to an org, retrieve source from an org, and perform diffs between local and remote source.
    • Change Tracking: Perform operations related to tracking changes.
    • Manifests: Generate and manage manifest files.
    • Reporting: Generate a project-info.md report containing metadata type statistics and environment details.
    • Templates: Generate Sample Analytics templates.
  4. Overview of included Salesforce extensions

    develop

    The Salesforce Extension Pack installs a comprehensive suite of tools for Salesforce development. Key functional areas include:

    • Core & Org Management: salesforcedx-vscode-core (CLI interaction), salesforcedx-vscode-org (org switching), salesforcedx-vscode-org-browser (metadata retrieval), and salesforcedx-vscode-metadata (metadata operations).
    • Apex Development: salesforcedx-vscode-apex (syntax/completion), salesforcedx-vscode-apex-testing (test execution), salesforcedx-vscode-apex-replay-debugger (log replaying), salesforcedx-vscode-apex-log (log analysis), and apex-language-server-extension (syntax analysis).
    • Frontend & UI: salesforcedx-vscode-lwc (Lightning Web Components), salesforcedx-vscode-lightning (Aura Components), salesforcedx-vscode-visualforce (Visualforce), and salesforce-vscode-slds (SLDS validation).
    • Data & Querying: salesforcedx-vscode-soql (visual SOQL builder and result export).
    • AI & Agentforce: salesforcedx-vscode-agents (Agentforce agent development), salesforcedx-einstein-gpt (Generative AI Dev Assistant), and agentforce-vibes-autocomplete (inline AI autocompletion).
    • Code Quality: sfdx-code-analyzer-vscode (Static analysis for Apex and JavaScript using multiple rule engines).
  5. Overview of Salesforce Extensions for VS Code

    develop

    Salesforce Extensions for VS Code is a suite of Visual Studio Code extensions designed to enhance the Salesforce DX development experience. The suite includes tools for Apex development, Lightning Web Components (LWC), SOQL querying, metadata visualization, and AI-assisted development.

    Key components include:

    • Core Functionality: salesforcedx-vscode-core provides basic Salesforce DX functionality by interacting with the Salesforce CLI.
    • Apex Development: salesforcedx-vscode-apex provides syntax highlighting and code completion via the Apex Language Server. salesforcedx-vscode-apex-replay-debugger allows replaying Apex execution from debug logs.
    • Web Components & UI: salesforcedx-vscode-lightning supports Aura components. salesforcedx-vscode-ui-preview allows for real-time LWC previews within VS Code. salesforcedx-vscode-slds provides SLDS code completion and validation.
    • Data & Metadata: salesforcedx-vscode-soql provides a visual editor for building SOQL queries and exporting results to .csv or .json. salesforcedx-metadata-visualizer-vscode creates real-time visual diagrams of Salesforce metadata.
    • AI & Analysis: salesforcedx-einstein-gpt provides generative AI features like a Dev Assistant and inline autocompletion. sfdx-code-analyzer-vscode performs static analysis on Apex and JavaScript code to find violations.
  6. Overview of lightning-lsp-common

    develop
    The lightning-lsp-common package provides shared components and logic used by both the Lightning Web Components (LWC) language server and the Aura language server within the Salesforce Extensions for VS Code ecosystem. It serves as a foundational layer to ensure consistent language server behavior across different Salesforce web component frameworks.
  7. Use the SOQL Builder for Visual Studio Code

    develop

    The SOQL Builder extension provides an interactive, form-based visual editor for constructing SOQL queries. It allows you to:

    • Build queries interactively: Use a visual form to select fields, filters, and objects.
    • Preview queries: View the generated SOQL string in real-time as you build it.
    • Export results: Save the results of your query to a .csv or .json file.

    Export Behavior:

    • If the query is a file already saved on your local disk, the export process uses the system save dialog and defaults the location to the directory of that file.
    • If the query is an untitled editor, in VS Code for the Web, or in a virtual workspace, you will be prompted to provide a filename and a project output directory (consistent with the SFDX: Create Query in SOQL Builder command).
  8. Generate and validate OpenAPI Specifications for Apex

    develop

    The Apex OpenAPI Specification (OAS) extension allows you to create OpenAPI v3 specifications from Apex classes annotated with @RestResource or @AuraEnabled. It also provides validation for existing OpenAPI documents using Spectral to ensure compliance with OpenAPI standards and Salesforce best practices.

    Available Commands

    • SFDX: Create OpenAPI Document from This Class: Generates an OpenAPI document from the currently active Apex class.
    • SFDX: Validate OpenAPI Document: Validates an existing OpenAPI document against Salesforce-specific rules.