diff options
| author | Hirokazu Hata <h.hata.ai.t@gmail.com> | 2020-09-06 17:49:21 +0900 |
|---|---|---|
| committer | Hirokazu Hata <h.hata.ai.t@gmail.com> | 2020-09-06 17:49:21 +0900 |
| commit | ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de (patch) | |
| tree | c301c7a765535dcb5387d76cc71e28d845dcce23 /lua/nvim_lsp/elixirls.lua | |
| parent | Merge pull request #238 from steelsojka/angular-ls (diff) | |
| download | nvim-lspconfig-ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de.tar nvim-lspconfig-ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de.tar.gz nvim-lspconfig-ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de.tar.bz2 nvim-lspconfig-ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de.tar.lz nvim-lspconfig-ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de.tar.xz nvim-lspconfig-ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de.tar.zst nvim-lspconfig-ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de.zip | |
Rename nvim_lsp to lspconfig
Diffstat (limited to 'lua/nvim_lsp/elixirls.lua')
| -rw-r--r-- | lua/nvim_lsp/elixirls.lua | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/lua/nvim_lsp/elixirls.lua b/lua/nvim_lsp/elixirls.lua deleted file mode 100644 index d0a2fbd6..00000000 --- a/lua/nvim_lsp/elixirls.lua +++ /dev/null @@ -1,110 +0,0 @@ -local configs = require 'nvim_lsp/configs' -local util = require 'nvim_lsp/util' - -local server_name = "elixirls" -local bin_name = "elixir-ls" -local cmd = "language_server" - -if vim.fn.has('mac') == 1 or vim.fn.has('unix') == 1 then - cmd = cmd..".sh" -elseif vim.fn.has('win32') == 1 or vim.fn.has('win64') == 1 then - cmd = cmd..".bat" -else - error("System is not supported, try to install manually.") - return -end - -local function make_installer() - local P = util.path.join - local install_dir = P{util.base_install_dir, server_name} - local cmd_path = P{install_dir, bin_name, "release", cmd} - - local X = {} - function X.install() - local install_info = X.info() - if install_info.is_installed then - print(server_name, "is already installed.") - return - end - - if not (util.has_bins("elixir") and util.has_bins("erl")) then - error("Need elixir and erl to install this") - return - end - - local script = [=[ - set -e - - # clone project - git clone https://github.com/elixir-lsp/elixir-ls - cd elixir-ls - - # fetch dependencies and compile - mix deps.get && mix compile - - # install executable - mix elixir_ls.release -o release - ]=] - vim.fn.mkdir(install_info.install_dir, "p") - util.sh(script, install_info.install_dir) - end - - function X.info() - return { - is_installed = util.path.exists(cmd_path); - install_dir = install_dir; - cmd = { cmd_path }; - } - end - - function X.configure(config) - local install_info = X.info() - if install_info.is_installed then - config.cmd = install_info.cmd - end - end - return X -end - -local installer = make_installer() - -configs[server_name] = { - default_config = { - cmd = { cmd }; - filetypes = {"elixir", "eelixir"}; - root_dir = function(fname) - return util.root_pattern("mix.exs", ".git")(fname) or vim.loop.os_homedir() - end; - }; - on_new_config = function(config) - installer.configure(config) - end; - docs = { - package_json = "https://raw.githubusercontent.com/JakeBecker/vscode-elixir-ls/master/package.json"; - description = [[ -https://github.com/elixir-lsp/elixir-ls - -`elixir-ls` can be installed via `:LspInstall elixirls` or by yourself by following the instructions [here](https://github.com/elixir-lsp/elixir-ls#building-and-running). - -This language server does not provide a global binary, but must be installed manually. The command `:LspInstaller elixirls` makes an attempt at installing the binary by -Fetching the elixir-ls repository from GitHub, compiling it and then installing it. - -```lua -require'nvim_lsp'.elixirls.setup{ - -- Unix - cmd = { "path/to/language_server.sh" }; - -- Windows - cmd = { "path/to/language_server.bat" }; - ... -} -``` -]]; - default_config = { - root_dir = [[root_pattern("mix.exs", ".git") or vim.loop.os_homedir()]]; - }; - }; -} - -configs[server_name].install = installer.install -configs[server_name].install_info = installer.info --- vim:et ts=2 sw=2 |
