diff options
| author | William Boman <william@redwill.se> | 2022-04-21 12:09:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-21 12:09:59 +0200 |
| commit | b68fcc6bb2c770495ff8e2508c06dfdd49abcc80 (patch) | |
| tree | df7c71efb59958deb21a18eeccf3e3c43c4cd704 /lua/nvim-lsp-installer/servers/elixirls/init.lua | |
| parent | run autogen_metadata.lua (diff) | |
| download | mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.gz mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.bz2 mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.lz mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.xz mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.zst mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.zip | |
chore: refactor remaining installers to async impl (#616)
Diffstat (limited to 'lua/nvim-lsp-installer/servers/elixirls/init.lua')
| -rw-r--r-- | lua/nvim-lsp-installer/servers/elixirls/init.lua | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/lua/nvim-lsp-installer/servers/elixirls/init.lua b/lua/nvim-lsp-installer/servers/elixirls/init.lua index 7a8f8bea..006c0222 100644 --- a/lua/nvim-lsp-installer/servers/elixirls/init.lua +++ b/lua/nvim-lsp-installer/servers/elixirls/init.lua @@ -1,8 +1,8 @@ local server = require "nvim-lsp-installer.server" local path = require "nvim-lsp-installer.path" -local std = require "nvim-lsp-installer.installers.std" -local context = require "nvim-lsp-installer.installers.context" local platform = require "nvim-lsp-installer.platform" +local github = require "nvim-lsp-installer.core.managers.github" +local std = require "nvim-lsp-installer.core.managers.std" return function(name, root_dir) return server.Server:new { @@ -10,16 +10,19 @@ return function(name, root_dir) root_dir = root_dir, homepage = "https://github.com/elixir-lsp/elixir-ls", languages = { "elixir" }, - installer = { - context.use_github_release_file("elixir-lsp/elixir-ls", "elixir-ls.zip"), - context.capture(function(ctx) - return std.unzip_remote(ctx.github_release_file, "elixir-ls") - end), - std.chmod("+x", { "elixir-ls/language_server.sh" }), - context.receipt(function(receipt, ctx) - receipt:with_primary_source(receipt.github_release_file(ctx)) - end), - }, + async = true, + ---@param ctx InstallContext + installer = function(ctx) + -- We write to the elixir-ls directory for backwards compatibility reasons + ctx.fs:mkdir "elixir-ls" + ctx:chdir("elixir-ls", function() + github.unzip_release_file({ + repo = "elixir-lsp/elixir-ls", + asset_file = "elixir-ls.zip", + }).with_receipt() + std.chmod("+x", { "language_server.sh" }) + end) + end, default_options = { cmd = { path.concat { |
