elixirls

URL: https://github.com/elixir-lsp/elixir-ls

plugins.lsp.servers.elixirls.enable

Whether to enable https://github.com/elixir-lsp/elixir-ls

elixir-ls can be installed by following the instructions here.

  1. Download the zip from https://github.com/elixir-lsp/elixir-ls/releases/latest/

  2. Unzip it and make it executable.

    unzip elixir-ls.zip -d /path/to/elixir-ls
    # Unix
    chmod +x /path/to/elixir-ls/language_server.sh
    

By default, elixir-ls doesn’t have a cmd set. This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set cmd to the absolute path ($HOME and ~ are not expanded) of your unzipped elixir-ls.

require'lspconfig'.elixirls.setup{
    -- Unix
    cmd = { "/path/to/elixir-ls/language_server.sh" };
    -- Windows
    cmd = { "/path/to/elixir-ls/language_server.bat" };
    ...
}

‘root_dir’ is chosen like this: if two or more directories containing mix.exs were found when searching directories upward, the second one (higher up) is chosen, with the assumption that it is the root of an umbrella app. Otherwise the directory containing the single mix.exs that was found is chosen. .

Type: boolean

Default: false

Example: true

Declared by:

plugins.lsp.servers.elixirls.package

The elixirls package to use.

Type: null or package

Default: pkgs.elixir-ls

Declared by:

plugins.lsp.servers.elixirls.autostart

Controls if the FileType autocommand that launches a language server is created. If false, allows for deferring language servers until manually launched with :LspStart (|lspconfig-commands|).

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.lsp.servers.elixirls.cmd

A list where each entry corresponds to the blankspace delimited part of the command that launches the server.

The first entry is the binary used to run the language server. Additional entries are passed as arguments.

Type: null or (list of string)

Default:

[
  "elixir-ls"
]

Declared by:

plugins.lsp.servers.elixirls.extraOptions

Extra options for the elixirls language server.

Type: attribute set of anything

Default: { }

Declared by:

plugins.lsp.servers.elixirls.filetypes

Set of filetypes for which to attempt to resolve {root_dir}. May be empty, or server may specify a default value.

Type: null or (list of string)

Default: null

Declared by:

plugins.lsp.servers.elixirls.rootDir

A function (or function handle) which returns the root of the project used to determine if lspconfig should launch a new language server, or attach a previously launched server when you open a new buffer matching the filetype of the server.

Type: null or lua function string

Default: null

Plugin default: "nil"

Declared by:

plugins.lsp.servers.elixirls.settings

The settings for this LSP.

Type: attribute set of anything

Default: { }

Example:

{
  callback = {
    __raw = ''
      function()
        print('nixvim')
      end
    '';
  };
  foo_bar = 42;
  hostname = "localhost:8080";
}

Declared by: