Contributing
To the Language Server
To contribute to the ELP language server, please refer to these instructions.
To the VS Code extension
The extension lives under editors/code.
Try a build from CI
Every CI run packages the extension, with ELP and its tools bundled, for each platform and OTP release. To try the extension of a pull request:
- Open the run from the Checks tab of the pull request and download the artifact for your platform and OTP release from its Artifacts section, e.g.
elp-macos-aarch64-apple-darwin-otp-28.5.vsix. The artifact is a zip file that containserlang-language-platform.vsix. - Install it in a VS Code profile of its own, so that it doesn't replace the extension you use day to day:
unzip elp-macos-aarch64-apple-darwin-otp-28.5.vsix.zip
code --profile elp-test --install-extension erlang-language-platform.vsix --force
The code command is available after running Shell Command: Install 'code' command in PATH from the VS Code command palette.
- Open a project in that profile, with Erlang/OTP,
rebar3and, for Buck2 projects, Buck2 on thePATH. Quit VS Code first, so that it picks up thePATHof your shell:
code --profile elp-test path/to/your/project
The test projects of the repository are a good place to start: end_to_end is a Buck2 project with examples for most features, and codegen_test a Buck2 project with generated files.
A CI build has the version in editors/code/package.json, which a release from the marketplace can share, so the Extensions view can't tell the two apart: install it in a profile of its own, as above.
Run the end-to-end tests
The end-to-end tests start VS Code with the extension and check its features on the test projects. They need the same tools as the extension, on the PATH: Erlang/OTP, rebar3 and Buck2. Debugging tests also need OTP 28 or later, and are skipped on earlier releases.
Build ELP from source and put the binaries the extension bundles in editors/code/bin, as the Package ... into VS Code Extension steps of ci.yml do: at least elp, and edb from an EDB release for the debugging tests. Then:
cd editors/code
npm install
npm test
npm test compiles the extension, downloads VS Code and runs the tests in three workspaces: end_to_end as a Buck2 project (--label buck2), codegen_test (--label buck2-codegen) and a copy of end_to_end as a rebar3 project (--label rebar3). To run only one of them, or only some tests:
npx vscode-test --label buck2 --grep 'Run in REPL'
On Linux without a display, run the tests under xvfb-run -a, as CI does.
To the website
The website is powered by Docusaurus. Most of the content is powered by Markdown.
You can find the source code under the website folder in the ELP repository. More detailed instructions on how to run the website locally are available here, but the short story is:
git clone https://github.com/WhatsApp/erlang-language-platform.git
cd erlang-language-platform/website
yarn install
yarn build
yarn start
The above will start a local server. You can start contributing content while watching live changes at:
http://localhost:3000
To the Erlang Error Index
The Erlang Error Index is currently part of the ELP website, so you can refer to the instructions above on how to contribute content.
The entrypoint for the index is here.
Error codes are organized using namespaces, which are listed here.
Generally speaking, a namespace corresponds to a tool which emits error codes (e.g. C for the Erlang Compiler).
A folder is associated to each namespace. If the namespace is C, the corresponding folder is named c (lowered version of the namespace).
Under each folder you will see the following files:
_category_.json: Metadata for the namespace, such as a label and the relative position in the list of namespacesabout.md: High level introduction to the namespace (e.g. which tool is emitting codes for the given namespace)- A number of
X1234.mdfiles: A file for each error code emitted
You can find the list of emitted error codes here.
High-quality content contributions to the Error Index are extremely welcome!