Git Product home page Git Product logo

pacak / erlang-language-platform Goto Github PK

View Code? Open in Web Editor NEW

This project forked from whatsapp/erlang-language-platform

0.0 1.0 0.0 3.7 MB

Erlang Language Platform. LSP server and CLI.

Home Page: https://whatsapp.github.io/erlang-language-platform/

License: Apache License 2.0

Shell 0.01% JavaScript 0.29% Erlang 19.05% Common Lisp 0.12% Rust 79.98% TypeScript 0.46% CSS 0.07% Roff 0.02%

erlang-language-platform's Introduction

Erlang Language Platform (ELP)

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

  1. Download the appropriate elp executable from https://github.com/WhatsApp/erlang-language-platform/releases, and make sure it is on your $PATH.
  2. 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

  1. Use OTP 25

  2. Download the elp binary for your system from https://github.com/WhatsApp/erlang-language-platform/releases

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

  3. Add eqwalizer_support dependency and eqwalizer_rebar3 plugin to your rebar3 project definition (see below)

  4. From the project directory run:

  • elp eqwalize <module> to type-check a single module
  • elp eqwalize-all to type-check all src 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

erlang-language-platform's People

Contributors

alanz avatar facebook-github-bot avatar onno-vos-dev avatar pacak avatar robertoaloi avatar vlanvin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.