diff options
Diffstat (limited to 'lua/nvim-lsp-installer/servers/rust_analyzer/init.lua')
| -rw-r--r-- | lua/nvim-lsp-installer/servers/rust_analyzer/init.lua | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua b/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua index c5592be8..8fe0c740 100644 --- a/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua +++ b/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua @@ -4,8 +4,6 @@ local platform = require "nvim-lsp-installer.platform" local std = require "nvim-lsp-installer.installers.std" local Data = require "nvim-lsp-installer.data" -local root_dir = server.get_server_root_path "rust" - local VERSION = "2021-06-28" local target = Data.coalesce( @@ -17,7 +15,7 @@ local target = Data.coalesce( ) ), Data.when( - platform.is_unix, + platform.is_linux, Data.coalesce( Data.when(platform.arch == "arm64", "rust-analyzer-aarch64-unknown-linux-gnu.gz"), Data.when(platform.arch == "x64", "rust-analyzer-x86_64-unknown-linux-gnu.gz") @@ -32,17 +30,19 @@ local target = Data.coalesce( ) ) -return server.Server:new { - name = "rust_analyzer", - root_dir = root_dir, - installer = { - std.gunzip_remote( - ("https://github.com/rust-analyzer/rust-analyzer/releases/download/%s/%s"):format(VERSION, target), - platform.is_win and "rust-analyzer.exe" or "rust-analyzer" - ), - std.chmod("+x", { "rust-analyzer" }), - }, - default_options = { - cmd = { path.concat { root_dir, "rust-analyzer" } }, - }, -} +return function(name, root_dir) + return server.Server:new { + name = name, + root_dir = root_dir, + installer = { + std.gunzip_remote( + ("https://github.com/rust-analyzer/rust-analyzer/releases/download/%s/%s"):format(VERSION, target), + platform.is_win and "rust-analyzer.exe" or "rust-analyzer" + ), + std.chmod("+x", { "rust-analyzer" }), + }, + default_options = { + cmd = { path.concat { root_dir, "rust-analyzer" } }, + }, + } +end |
