You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEVELOPMENT.md
+34-7Lines changed: 34 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,41 @@
1
1
# Development
2
2
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.
4
4
5
-
Elixir itself supports 5 versions with security updates:
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.
Copy file name to clipboardExpand all lines: README.md
+51-6Lines changed: 51 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
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).
4
4
5
-
## This is now the main elixir-ls repo
5
+
## This is the main elixir-ls repo
6
6
7
7
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.
8
8
@@ -92,7 +92,17 @@ For eglot use:
92
92
93
93
</details>
94
94
95
-
## Supported versions
95
+
## Supported elixir and OTP versions
96
+
97
+
Elixir itself supports 5 versions with security updates:
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.
| 26 | any | No |[#886](https://github.com/elixir-lsp/elixir-ls/issues/886)|
105
115
116
+
### Version management
117
+
106
118
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.
107
119
108
120
## Debugger support
@@ -318,6 +330,9 @@ Below is a list of configuration options supported by ElixirLS Debugger. Configu
318
330
319
331
Basic troubleshooting steps:
320
332
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)
321
336
- Restart ElixirLS with a custom command `restart`
322
337
- Run `mix clean` or `mix clean --deps` in ElixirLS with custom command `mixClean`
323
338
- Restart your editor (which will restart ElixirLS)
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.
This builds the language server and debugger as a set of `.ez` archives and creates `.sh` and `.bat` scripts to launch them.
364
391
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.
366
393
367
394
### Local setup
368
395
@@ -372,15 +399,33 @@ When launching ElixirLS from an IDE that is itself launched from a graphical she
372
399
373
400
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).
374
401
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.
376
403
377
404
Note: The setup script must not read from `stdin` and write to `stdout`. On unix/linux/macOS
378
405
this might be accomplished by adding `>/dev/null` at the end of any line that produces
379
406
output, and for a windows batch script you will want `@echo off` at the top and `>nul`.
380
407
408
+
### Development
409
+
410
+
Please refer to [DEVELOPMENT.MD](DEVELOPMENT.MD).
411
+
381
412
## Environment variables
382
413
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>
0 commit comments