---
schema_version: "1"
id: 27da7750d763b6d702cda453c0f2398e4ab7236ad53a21f3af084b10a4e35bc3
title: Apex Language Server
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfvscode/guides/programming-languages/apex/apex-language-server.md
canonical_url: https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/apex-language-server.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: caed44b95c3caf244d2ef1cc407ae7fd5527ebfa5e63e9b64ac6118ac7b021c4
products:
  - Salesforce Extensions for Visual Studio Code
  - salesforcedx
---
# Apex Language Server

The Apex Language Server is a part of the Salesforce Extension Pack. It provides a powerful way for Salesforce Extensions for VS Code and Agentforce Vibes IDE to implement an Apex analyzer that’s also accessible to other IDEs.

The Apex Language Server is an implementation of the Language Server Protocol 3.0 [specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/). The Language Server Protocol allows a tool (in this case, VS Code) to communicate with a language smartness provider (the server). We built the Apex Language Server using this common specification to enable our tooling partners to improve the smartness of their tools.

## Integrate with the Apex Language Server

If you are a developer looking to integrate with the Apex Language Server, use the [apex-jorje-lsp.jar](https://github.com/forcedotcom/salesforcedx-vscode/blob/develop/packages/salesforcedx-vscode-apex/jars/apex-jorje-lsp.jar) file.

See the [languageServer.ts](https://github.com/forcedotcom/salesforcedx-vscode/blob/develop/packages/salesforcedx-vscode-apex/src/languageServer.ts) file for an example of initializing and communicating with the Apex Language Server.

## Apex Language Server Status

Hover over `{}` in the status bar to view the current status of the Apex Language Server. To always have visibility into the status, pin the status message. The Apex Language Server status is now persistantly visible in the status bar until it is unpinned.

![Apex Language Server Status](https://developer.salesforce.com/media/vscode/apexlspstatus.png)

## Restart Apex Language Server

To set the Apex Language Server restart behavior, from Settings:

1. Select **File** > **Preferences** > **Settings** (Windows or Linux) or **Code** > **Preferences** > **Settings** (macOS).
2. Under **Salesforce Apex Configuration**, select **Restart Behavior**, then select the restart behavior from the dropdown:

| Setting | Description                                                                          |
| ------- | ------------------------------------------------------------------------------------ |
| prompt  | Give the user an option to choose between a simple restart and a reset.              |
| restart | Perform a simple restart of the Apex Language Server without resetting the database. |
| reset   | Perform a clean restart of the Apex Language Server and reset the database.          |

To restart the Apex Language Server, hover over `{}` in the VS Code status bar. Make sure an Apex class or trigger is open in Editor View. You can also run the **SFDX: Restart Apex Language Server** command from the command palette. The restart option available from the status bar reflects your restart behavior setting. Simple and clean reset options are available from the command palette.

## Reset Apex Indexing

To clear the Apex Language Server's indexing, delete the `PROJECT_DIR/.sfdx/tools/<Salesforce Release>` directory and restart VS Code.

## See Also

- [Language Server Protocol Specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/)
- [VS Code’s Implementation of the Language Server Protocol](https://github.com/Microsoft/vscode-languageserver-node)
- [Langserver.org - Information about other language servers and clients, e.g., Atom, Sublime, Vim, etc](http://langserver.org/)
