sebastiw / edts

Erlang Development Tool Suite
GNU Lesser General Public License v3.0
355 stars 82 forks source link
                                 __    __
                                |  \  |  \
                  ______    ____| $$ _| $$_     _______
                 /      \  /      $$|   $$ \   /       \
                |  $$$$$$\|  $$$$$$$ \$$$$$$  |  $$$$$$$
                | $$    $$| $$  | $$  | $$ __  \$$    \
                | $$$$$$$$| $$__| $$  | $$|  \ _\$$$$$$\
                 \$$     \ \$$    $$   \$$  $$|       $$
                  \$$$$$$$  \$$$$$$$    \$$$$  \$$$$$$$

                -- The Erlang Development Tool Suite --

MELPA Build Status

License

Copyright (C) 2012 by Thomas Järvstrand, Håkan Nilsson 2013 by Thomas Järvstrand 2020 by Sebastian Weddmark Olsson

EDTS is licensed under the Lesser Gnu General Public License. See COPYING.LESSER for details.

Introduction

The Erlang Development Tool Suite (EDTS) is a package of useful development tools for working with the Erlang programming language in Emacs. It bundles a number of useful external packages, together with specialized Erlang plugins for them, and its own features to create a complete and efficient development environment that is easy to set up.

Currently EDTS provides:

For more information, hit M-x describe-minor-mode RET edts-mode RET.

Getting started

Support:

Please use the Github issue tracker to report bugs.

Requirements:

First of all, ensure your environment is setup correctly:

Get EDTS:

M-x package-install RET edts RET

Make sure EDTS gets loaded in your .emacs:

An easy way is to load edts-start:

(add-hook 'after-init-hook 'my-after-init-hook)
(defun my-after-init-hook ()
  (require 'edts-start))

Configure your projects.

EDTS projects are configured by creating a file called .edts in your project's root. The configuration file is a number of lines, where each line is in the format: :<property> <value>

Values that are lists must be prefixed with a single-quote, eg. '("lib"). See example below.

Valid properties are:

Example configuration:
  :name "awesome_stuff"
  :node-sname "awesome"
  :lib-dirs '("lib" "test")
  :app-include-dirs '("include")
  :project-include-dirs '("test/shared/include")

Local modifications to project configurations - useful when working on more than one checkout of the same project - can be done in two ways:

Get the Erlang documentation (optional).

That should be all it takes. If it's not, please report any issues on github.

Multiuser systems

For EDTS to work in multiuser systems, each user needs to configure the environment variable EDTS_PORT to something unique. It defaults to 4587, which is the port that the REST-interface of which the EDTS-node listens on.

Backward compatibility note

If you have previously configured EDTS 'the old way' in edts-projects, you can still keep this configuration and everything should work as before. However, EDTS will conveniently convert your old configuration and create a .edts file in your project root. You can turn off this behaviour by setting edts-project-inhibit-conversion to a non-nil value.

How it works

Once set up, EDTS will automatically fire up it's own Erlang node when you start your Emacs. Once you open the first file that is located inside one of your projects, then EDTS will automatically fire up the corresponding project node and initiate communication between the EDTS-node and the project-node. If a node with the same name as the project's node is already registered with the Erlang port mapper daemon (epmd), then EDTS will initiate communication with that node instead. The EDTS-node exposes a REST-interface (using mochiweb) through which emacs can then communicate with the project node.

EDTS and Distel

EDTS is meant to be a able to replace Distel but only provides part of the most commonly used of Distel's features, specifically the equivalents of erl-find-module, erl-find-source-under-point, erl-who-calls and erl-refactor-subfunction. As far as I know, those are the only Distel features that 98% of people use, but if there is anything from Distel that you are missing in EDTS, please let me know.

If you are using EDTS, please remove Distel from your configuration, since running both can create some confusion.

Known Issues

Some users are experiencing serious performance issues with the auto-completion during the first use after startup. This is usually solved by typing C-g a couple (two or three, it seems to vary) of times when Emacs "hangs" the first time. It is most likely caused by a bug in the emacs c-code that affects the auto-complete package. If you experience these issues, it's recommended to switch to emacs 24.2 where the problem is fixed, but if the problems persist, any help in debugging the issue would be appreciated since I have never myself been able to reproduce it.

When killing some buffers, Emacs 23 decides to move point to (point-max) in a seemingly completely unrelated buffer. This will sometimes happen as an effect of EDTS' after-save-hook. The issue does not exist in Emacs 24.

If you're using proxy server, you have to make sure that the proxy is not used for communicating with EDTS: (add-to-list 'url-proxy-services '("no_proxy" . "0:4587"))

Setup edts from source instructions

To setup from source you first need to clone and compile edts:

$ git clone https://github.com/sebastiw/edts
$ cd edts
$ make

Next you need to ensure the edts directory is added to the emacs load-path. Add to your .emacs.d or init.el file:

(add-to-list 'load-path "<path to the cloned edts repo>")

(add-hook 'after-init-hook 'my-after-init-hook)
(defun my-after-init-hook ()
  (require 'edts-start))