Erlang Language Platform (ELP)
Description
ELP integrates Erlang into modern IDEs via the language server protocol.
ELP was inspired by rust-analyzer.
Terms of Use
You are free to copy, modify, and distribute ELP with attribution under the terms of the Apache-2.0 and MIT licences. See LICENCE-APACHE and LICENCE-MIT for details.
Prerequisites
VS Code
Coming soon.
Emacs
- Download the appropriate elp executable from https://github.com/WhatsApp/erlang-language-platform/releases, and make sure it is on your
$PATH
. - Add the following to your emacs init file
(use-package lsp-mode
:custom
(lsp-semantic-tokens-enable t)
:config
;; Enable LSP automatically for Erlang files
(add-hook 'erlang-mode-hook #'lsp)
;; ELP, added as priority 0 (> -1) so takes priority over the built-in one
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("elp" "server"))
:major-modes '(erlang-mode)
:priority 0
:server-id 'erlang-language-platform))
)
How to use ELP
Using it with rebar3 projects
-
Use OTP 25
-
Download the
elp
binary for your system from https://github.com/WhatsApp/erlang-language-platform/releasesOn Mac you will probably get the following message when trying to run the executable the first time: "elp cannot be opened because the developer cannot be verified.". To solve this, go to Preferences > Security and Privacy and add an exception. Alternatively, you can build elp from source.
-
Add
eqwalizer_support
dependency andeqwalizer_rebar3
plugin to your rebar3 project definition (see below) -
From the project directory run:
elp eqwalize <module>
to type-check a single moduleelp eqwalize-all
to type-check allsrc
modules in the project
Adding eqwalizer_support
and eqwalizer_rebar3
:
{deps, [
{eqwalizer_support,
{git_subdir,
"https://github.com/whatsapp/eqwalizer.git",
{branch, "main"},
"eqwalizer_support"}}
]}.
{project_plugins, [
{eqwalizer_rebar3,
{git_subdir,
"https://github.com/whatsapp/eqwalizer.git",
{branch, "main"},
"eqwalizer_rebar3"}}
]}.
References
Contributing
- CONTRIBUTING.md: Provides an overview of how to contribute changes to ELP (e.g., diffs, testing, etc)
FAQ
Please refer to the FAQ document for answers to some common questions, including:
- What's the difference between ELP and Erlang LS?
- Why not extend Erlang LS, rather than creating a new tool?
- Why is ELP implemented in Rust, rather than Erlang?
License
erlang-language-platform is dual-licensed