Skip to content

[WIP] Improve elixir-ls compilation #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Elixir language server extension based on [elixir-ls](https://github.com/elixir-lsp/elixir-ls) for [`coc.nvim`](https://github.com/neoclide/coc.nvim).

## Requirements

Install [asdf](https://github.com/asdf-vm/asdf) together with [asdf-erlang](https://github.com/asdf-vm/asdf-erlang) and [asdf-elixir](https://github.com/asdf-vm/asdf-elixir) plugins.

These are needed to compile elixir-ls properly.

## Install

### CocInstall
Expand All @@ -25,6 +31,7 @@ Plug 'elixir-lsp/coc-elixir', {'do': 'yarn install && yarn prepack'}
```

## Features

- Go to definition support
- Code completion
- Inline diagnostic (Build errors and warning)
Expand All @@ -33,24 +40,28 @@ Plug 'elixir-lsp/coc-elixir', {'do': 'yarn install && yarn prepack'}
- Code formatter

## Dialyzer integration

Coc-elixir will automatically analyze your project with [Dialyzer](http://erlang.org/doc/apps/dialyzer/dialyzer_chapter.html) after each successful build. It maintains a "manifest" file in `.elixir_ls/dialyzer_manifest` that stores the results of the analysis.

You can control which warnings are shown using the `elixirLS.dialyzerWarnOpts` setting in `coc-setting.json`, found at `~/.config/nvim/coc-settings.json`, or use command `:CocConfig` to open configuration file.
You can find available options in Erlang [docs](http://erlang.org/doc/man/dialyzer.html) at section "Warning options".

To disable Dialyzer completely add setting:

```json
{
"elixirLS.dialyzerEnabled": false
}
```

You can also set the module attribute @dialyzer to show or hide warnings at a module or function level.

## Mix environment and target settings

You can control the settings that ElixirLS uses for Mix environment and target using either the user `coc-settings.json` or a [workspace configuration](https://github.com/neoclide/coc.nvim/wiki/Using-the-configuration-file#configuration-file-resolve).

To change the Mix environment and target, add the settings:

```json
{
"elixirLS.mixEnv": "dev",
Expand Down Expand Up @@ -96,4 +107,3 @@ Doing these steps should make this plugin work with [CoC](https://github.com/neo
## License

MIT

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"clean": "rm -rf lib/",
"lint": "eslint .",
"build": "webpack",
"els-build": "cd elixir-ls && mix deps.get && mix elixir_ls.release -o ../els-release",
"els-build": "cd elixir-ls && asdf install && mix deps.get && mix elixir_ls.release -o ../els-release",
"prepack": "npm run clean && npm run build && npm run els-build"
},
"repository": "github:amiralies/coc-elixir",
Expand Down