Skip to content

Commit 194afeb

Browse files
committed
update docs
1 parent 5723562 commit 194afeb

File tree

2 files changed

+85
-13
lines changed

2 files changed

+85
-13
lines changed

DEVELOPMENT.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,41 @@
11
# Development
22

3-
## Version Support Guidelines
3+
It's best to disable ElixirLS when working on ElixirLS and elixir_sense. Without that modules from edited code conflict with modules from the running language server.
44

5-
Elixir itself supports 5 versions with security updates:
6-
https://hexdocs.pm/elixir/compatibility-and-deprecations.html#content
5+
## Building and testing
76

8-
OTP Supports the last 3 versions:
9-
http://erlang.2086793.n4.nabble.com/OTP-Versions-and-Maint-Branches-td4722416.html
7+
### Installing
108

11-
ElixirLS generally aims to support the last 3 versions of Elixir and the last 3 versions of OTP. However this is not a hard and fast rule and may change in the future.
9+
Clone the repo and run
10+
11+
```shell
12+
mix deps.get
13+
```
14+
15+
### Running tests
16+
17+
Use normal mix commands for running tests.
18+
19+
```shell
20+
mix test
21+
```
22+
23+
### Testing in VSCode
24+
25+
It's easiest to test ElixirLS with [VSCode extension](https://github.com/elixir-lsp/vscode-elixir-ls) with ElixirLS as a git submodule. Refer to that repo for detailed instructions.
26+
27+
### Local release
28+
29+
You can run a local release of language server and debugger with launch scripts from `scripts` directory with `ELS_LOCAL=1` environment variable. This will make the install script use source, lockfile and config from the local ElixirLS directory.
30+
31+
```shell
32+
cd path/to/my_project
33+
ELS_LOCAL=1 /path/to/elixir-ls/scripts/language_server.sh
34+
```
35+
36+
### Formatting
37+
38+
You may need to separately run `mix format` in the ElixirLS root and in `apps/language_server` directory.
1239

1340
## Packaging
1441

@@ -19,7 +46,7 @@ Follow those instructions when publishing a new release.
1946
3. Make PR
2047
4. Merge PR
2148
5. Pull down the latest master
22-
6. Make the tag from the new master
49+
6. Make the tag from the new master matching version number with `v` prefix (e.g. `v0.1.2`)
2350
7. Push the tag (`git push upstream --tags`)
2451
8. Wait for github actions to push up a draft release https://github.com/elixir-lsp/elixir-ls/releases
2552
9. Edit the draft release with a link to the changelog

README.md

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The Elixir Language Server provides a server that runs in the background, providing IDEs, editors, and other tools with information about Elixir Mix projects. It adheres to the [Language Server Protocol](https://github.com/Microsoft/language-server-protocol), a standard for frontend-independent IDE support. Debugger integration is accomplished through the similar [VS Code Debug Protocol](https://code.visualstudio.com/docs/extensionAPI/api-debugging).
44

5-
## This is now the main elixir-ls repo
5+
## This is the main elixir-ls repo
66

77
The [elixir-lsp](https://github.com/elixir-lsp)/[elixir-ls](https://github.com/elixir-lsp/elixir-ls) repo began as a fork when the original repo at [JakeBecker](https://github.com/JakeBecker)/[elixir-ls](https://github.com/JakeBecker/elixir-ls) became inactive for an extended period of time. So we decided to start an active fork to merge dormant PR's and fix issues where possible. We also believe in an open and shared governance model to share the work instead of relying on one person to shoulder the whole burden.
88

@@ -92,7 +92,17 @@ For eglot use:
9292

9393
</details>
9494

95-
## Supported versions
95+
## Supported elixir and OTP versions
96+
97+
Elixir itself supports 5 versions with security updates:
98+
https://hexdocs.pm/elixir/compatibility-and-deprecations.html#content
99+
100+
OTP Supports the last 3 versions:
101+
http://erlang.2086793.n4.nabble.com/OTP-Versions-and-Maint-Branches-td4722416.html
102+
103+
ElixirLS generally aims to support the last 3 released versions of Elixir and the last 3 versions of OTP. However this is not a hard and fast rule and may change in the future.
104+
105+
### Support matrix
96106

97107
| OTP Versions | Elixir Versions | Supports ElixirLS | Issue(s) |
98108
| :----------: | :-------------: | :---------------: | :--------------------------------------------------------: |
@@ -103,6 +113,8 @@ For eglot use:
103113
| 25 | 1.13.4 - 1.15 | Yes | None |
104114
| 26 | any | No | [#886](https://github.com/elixir-lsp/elixir-ls/issues/886) |
105115

116+
### Version management
117+
106118
It is generally recommended to install Elixir and Erlang via [ASDF](https://github.com/asdf-vm/asdf) so that you can have different projects using different versions of Elixir without having to change your system-installed version. ElixirLS can detect and use the version of Elixir and Erlang that you have configured in ASDF.
107119

108120
## Debugger support
@@ -318,6 +330,9 @@ Below is a list of configuration options supported by ElixirLS Debugger. Configu
318330

319331
Basic troubleshooting steps:
320332

333+
- Make sure you have hex and git installed
334+
- Make sure github.com and hex.pm are accessible. You may need to configure proxy
335+
- If the extension fails to start ElixirLS you can try cleaning the `Mix.install` directory (location on your system can be obtained by calling `Mix.Utils.mix_cache()` from `iex` session)
321336
- Restart ElixirLS with a custom command `restart`
322337
- Run `mix clean` or `mix clean --deps` in ElixirLS with custom command `mixClean`
323338
- Restart your editor (which will restart ElixirLS)
@@ -352,7 +367,19 @@ https://github.com/elixir-lsp/elixir-ls/issues/364#issuecomment-829589139
352367

353368
## Building and running
354369

355-
In order to build a release use the following commands.
370+
There are two ways of building the release: `Mix.install` based (recommended) and `.ez` archives (deprecated).
371+
372+
### `Mix.install` based release
373+
374+
```bash
375+
mix deps.get
376+
MIX_ENV=prod mix compile
377+
MIX_ENV=prod mix elixir_ls.release2 -o <release_dir>
378+
```
379+
380+
This copies language server and debugger adapter launch scripts to the `<release_dir>` and includes `VERSION` manifest file. The launch scripts install a release specified by version manifest via `Mix.install` and launch it. This ensures that ElixirLS is built by the correct combination of elixir and OTP.
381+
382+
### Deprecated `.ez` archives release
356383

357384
```bash
358385
mix deps.get
@@ -362,7 +389,7 @@ MIX_ENV=prod mix elixir_ls.release -o <release_dir>
362389

363390
This builds the language server and debugger as a set of `.ez` archives and creates `.sh` and `.bat` scripts to launch them.
364391

365-
If you're packaging these archives in an IDE plugin, make sure to build using the minimum supported OTP version for the best backwards-compatibility. Alternatively, you can use a [precompiled release](https://github.com/elixir-lsp/elixir-ls/releases).
392+
If you're packaging these archives in an IDE plugin, make sure to build using the minimum supported OTP version for the best backwards-compatibility.
366393

367394
### Local setup
368395

@@ -372,15 +399,33 @@ When launching ElixirLS from an IDE that is itself launched from a graphical she
372399

373400
To ensure that the correct environment is set up, you can create a setup script at `$XDG_CONFIG_HOME/elixir_ls/setup.sh` (for Unix-based systems) or `%APPDATA%\elixir_ls\setup.bat` (for Windows).
374401

375-
In the setup script the environment variable `ELS_MODE` available and set to either `debugger` or `language_server` to help you decide what to do.
402+
In the setup script the environment variable `ELS_MODE` is available and set to either `debugger` or `language_server` to help you decide what to do.
376403

377404
Note: The setup script must not read from `stdin` and write to `stdout`. On unix/linux/macOS
378405
this might be accomplished by adding `>/dev/null` at the end of any line that produces
379406
output, and for a windows batch script you will want `@echo off` at the top and `>nul`.
380407

408+
### Development
409+
410+
Please refer to [DEVELOPMENT.MD](DEVELOPMENT.MD).
411+
381412
## Environment variables
382413

383-
- `ELS_INSTALL_PREFIX`: The folder where the language server got installed to. If set, it makes maintaining multiple versions/instances on the same host much easier. If not set or empty, a heuristic will be used to discover the install location.
414+
ElixirLS supports the following environment variables.
415+
416+
<dl>
417+
418+
<dt>ELS_INSTALL_PREFIX</dt><dd>(not supported on Windows) The folder where the language server got installed to. If set, it makes maintaining multiple versions/instances on the same host much easier. If not set or empty, a heuristic will be used to discover the install location.</dd>
419+
420+
<dt>ELS_LOCAL</dt><dd>If set to `1` will make ElixirLS run local release. If it is not set a published release matching `VERSION` will be used (default).</dd>
421+
422+
<dt>ELS_ELIXIR_OPTS</dt><dd>Optional parameters to pass to elixir CLI. May be used to set a node name and cookie.</dd>
423+
424+
<dt>ELS_ERL_OPTS</dt><dd>Optional parameters to pass to erl CLI.</dd>
425+
426+
<dt>ASDF_DIR</dt><dd>(not supported on Windows) If set, ElixirLS will look for [ASDF](https://github.com/asdf-vm/asdf) script in a directory given by that variable</dd>
427+
428+
</dl>
384429

385430
## Acknowledgements and related projects
386431

0 commit comments

Comments
 (0)