Apex Language Server

Apex Language Server

The Apex Language Server is an IDE-agnostic way for tools to access code-editing capabilities such as code completion, go to definition, find all usage, and refactoring. The Apex Language Server is a part of the Salesforce Extension Pack. It provides a powerful way for Salesforce Extensions for VS Code 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. 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.

For more information, watch the video of our Dreamforce ’17 presentation, Building Powerful Tooling For All IDEs Through Language Servers.

Dreamforce '17 Presentation

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

See the 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

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

Feedback or Bugs | Edit this Article