All Projects → elixir-lsp → coc-elixir

elixir-lsp / coc-elixir

Licence: MIT license
Elixir language server extension based on elixir-ls for coc.nvim

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to coc-elixir

coc-tailwind-intellisense
Coc.nvim extension for Tailwind CSS IntelliSense
Stars: ✭ 117 (-22%)
Mutual labels:  coc, lsp
coc-ccls
CCLS (C/C++) extension for coc.nvim
Stars: ✭ 20 (-86.67%)
Mutual labels:  coc, lsp
groovy-language-server
A language server for Groovy
Stars: ✭ 132 (-12%)
Mutual labels:  lsp
coc-webview
Using an external browser to support the webview in coc.nvim.
Stars: ✭ 21 (-86%)
Mutual labels:  coc
typescript-language-server
TypeScript & JavaScript Language Server
Stars: ✭ 1,118 (+645.33%)
Mutual labels:  lsp
pycon-code-of-conduct
PyCon Korea's code of conduct
Stars: ✭ 24 (-84%)
Mutual labels:  coc
nvim-metals
A Metals plugin for Neovim
Stars: ✭ 265 (+76.67%)
Mutual labels:  lsp
sublime-reason
Official Reason plugin for Sublime Text
Stars: ✭ 42 (-72%)
Mutual labels:  lsp
vis-lspc
language server protocol client for the vis editor
Stars: ✭ 24 (-84%)
Mutual labels:  lsp
coc-rime
Rime input method source for coc.nvim
Stars: ✭ 22 (-85.33%)
Mutual labels:  coc
code-of-conduct
The rule of St. Benedict as your Code of Conduct
Stars: ✭ 21 (-86%)
Mutual labels:  coc
tower-lsp
Language Server Protocol implementation written in Rust
Stars: ✭ 455 (+203.33%)
Mutual labels:  lsp
nvim-lsp-ts-utils
Utilities to improve the TypeScript development experience for Neovim's built-in LSP client.
Stars: ✭ 437 (+191.33%)
Mutual labels:  lsp
dotfiles
Current dotfiles and scripts
Stars: ✭ 35 (-76.67%)
Mutual labels:  lsp
coc-toml
Toml extension for coc-nvim, using taplo for lsp engine
Stars: ✭ 52 (-65.33%)
Mutual labels:  coc
vscode
The Visual Studio Code Extension for the Erlang Language Server
Stars: ✭ 62 (-58.67%)
Mutual labels:  lsp
py lsp.nvim
Lsp Plugin for working with Python virtual environments
Stars: ✭ 58 (-61.33%)
Mutual labels:  lsp
glsp-examples
Example diagram editors built with Eclipse GLSP
Stars: ✭ 28 (-81.33%)
Mutual labels:  lsp
coc-svelte
svelte support for (Neo)Vim
Stars: ✭ 156 (+4%)
Mutual labels:  lsp
glsp-server
Java-based server framework of the graphical language server platform
Stars: ✭ 25 (-83.33%)
Mutual labels:  lsp

coc-elixir

Elixir language server extension based on elixir-ls for coc.nvim.

Install

CocInstall

  1. Make sure you've got elixir and mix available in $PATH.

  2. Inside (neo)vim run this command:

:CocInstall coc-elixir

vim-plug

  1. Make sure you've got elixir, mix and yarn available in $PATH.

  2. Inside your plug#begin/end block in your .vimrc (vim) or init.vim (neovim) file, after coc.nvim add:

Plug 'elixir-lsp/coc-elixir', {'do': 'yarn install && yarn prepack'}
  1. Get the latest elixir-ls release from here and unzip it into ~/.vim/plugged/coc-elixir/els-release (unzip elixir-ls.zip -d ~/.vim/plugged/coc-elixir/els-release).

Features

  • Go to definition support
  • Code completion
  • Inline diagnostic (Build errors and warning)
  • Documentation on hover
  • Smart closing of code blocks
  • Code formatter

Dialyzer integration

Coc-elixir will automatically analyze your project with Dialyzer 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 at section "Warning options".

To disable Dialyzer completely add setting:

{
  "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.

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

{
  "elixirLS.mixEnv": "dev",
  "elixirLS.mixTarget": "test"
}

Troubleshooting

Server fails to start

Upon upgrading coc-elixir it is possible that the binary files were compiled using an OTP or Elixir version that differ from the ones you have installed. When this happens, the language server will fail to start.

You can build ElixirLS yourself to solve this:

Start by building a binary of ElixirLS from its source:

git clone https://github.com/elixir-lsp/elixir-ls.git ~/.elixir-ls
cd ~/.elixir-ls
mix deps.get && mix compile && mix elixir_ls.release -o release

Afterwards, create or update your coc-settings file and add this line:

{
  "elixir.pathToElixirLS": "~/.elixir-ls/release/language_server.sh"
}

To open your coc-settings file directly from Vim or Nvim, you can use this command:

:CocConfig

Doing these steps should make this plugin work with CoC.

coc-elixir is installed correctly but doesn't work

Make sure filetype is set to elixir, or install vim-elixir which sets up file extension associations and syntax highlighting.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].