aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/servers')
-rw-r--r--lua/nvim-lsp-installer/servers/ansiblels/init.lua16
-rw-r--r--lua/nvim-lsp-installer/servers/clangd/init.lua21
-rw-r--r--lua/nvim-lsp-installer/servers/clangd/install.mjs18
-rw-r--r--lua/nvim-lsp-installer/servers/clojure_lsp/init.lua18
-rw-r--r--lua/nvim-lsp-installer/servers/clojure_lsp/install.mjs17
-rw-r--r--lua/nvim-lsp-installer/servers/elixirls/init.lua13
-rw-r--r--lua/nvim-lsp-installer/servers/groovyls/init.lua17
-rw-r--r--lua/nvim-lsp-installer/servers/hls/init.lua28
-rw-r--r--lua/nvim-lsp-installer/servers/hls/install.mjs26
-rw-r--r--lua/nvim-lsp-installer/servers/kotlin_language_server/init.lua12
-rw-r--r--lua/nvim-lsp-installer/servers/omnisharp/common.mjs35
-rw-r--r--lua/nvim-lsp-installer/servers/omnisharp/init.lua27
-rw-r--r--lua/nvim-lsp-installer/servers/omnisharp/install.mjs6
-rw-r--r--lua/nvim-lsp-installer/servers/omnisharp/install.win.mjs10
-rw-r--r--lua/nvim-lsp-installer/servers/rescriptls/init.lua15
-rw-r--r--lua/nvim-lsp-installer/servers/rust_analyzer/common.mjs41
-rw-r--r--lua/nvim-lsp-installer/servers/rust_analyzer/init.lua40
-rw-r--r--lua/nvim-lsp-installer/servers/rust_analyzer/install.mjs5
-rw-r--r--lua/nvim-lsp-installer/servers/rust_analyzer/install.win.mjs9
-rw-r--r--lua/nvim-lsp-installer/servers/solargraph/init.lua18
-rw-r--r--lua/nvim-lsp-installer/servers/solargraph/install.mjs14
-rw-r--r--lua/nvim-lsp-installer/servers/sumneko_lua/init.lua35
-rw-r--r--lua/nvim-lsp-installer/servers/sumneko_lua/install.mjs17
-rw-r--r--lua/nvim-lsp-installer/servers/tailwindcss/init.lua16
-rw-r--r--lua/nvim-lsp-installer/servers/tailwindcss/install.mjs7
-rw-r--r--lua/nvim-lsp-installer/servers/terraformls/init.lua33
-rw-r--r--lua/nvim-lsp-installer/servers/terraformls/install.mjs35
-rw-r--r--lua/nvim-lsp-installer/servers/texlab/init.lua25
-rw-r--r--lua/nvim-lsp-installer/servers/texlab/install.mjs16
29 files changed, 200 insertions, 390 deletions
diff --git a/lua/nvim-lsp-installer/servers/ansiblels/init.lua b/lua/nvim-lsp-installer/servers/ansiblels/init.lua
index b6899b70..8a997fea 100644
--- a/lua/nvim-lsp-installer/servers/ansiblels/init.lua
+++ b/lua/nvim-lsp-installer/servers/ansiblels/init.lua
@@ -1,20 +1,18 @@
local server = require "nvim-lsp-installer.server"
local path = require "nvim-lsp-installer.path"
-local installers = require "nvim-lsp-installer.installers"
-local shell = require "nvim-lsp-installer.installers.shell"
+local std = require "nvim-lsp-installer.installers.std"
+local npm = require "nvim-lsp-installer.installers.npm"
local root_dir = server.get_server_root_path "ansiblels"
return server.Server:new {
name = "ansiblels",
root_dir = root_dir,
- installer = installers.when {
- unix = shell.bash [[
- git clone --depth 1 https://github.com/ansible/ansible-language-server .;
- npm install;
- npm run build;
- npm install --production;
- ]],
+ installer = {
+ std.git_clone "https://github.com/ansible/ansible-language-server",
+ npm.install(),
+ npm.run "compile",
+ npm.install(true),
},
default_options = {
filetypes = { "yaml", "yaml.ansible" },
diff --git a/lua/nvim-lsp-installer/servers/clangd/init.lua b/lua/nvim-lsp-installer/servers/clangd/init.lua
index 6028af24..d5bba9f8 100644
--- a/lua/nvim-lsp-installer/servers/clangd/init.lua
+++ b/lua/nvim-lsp-installer/servers/clangd/init.lua
@@ -1,17 +1,24 @@
local server = require "nvim-lsp-installer.server"
-local installers = require "nvim-lsp-installer.installers"
local path = require "nvim-lsp-installer.path"
-local zx = require "nvim-lsp-installer.installers.zx"
+local platform = require "nvim-lsp-installer.platform"
+local Data = require "nvim-lsp-installer.data"
+local std = require "nvim-lsp-installer.installers.std"
-local root_dir = server.get_server_root_path "c-family"
+local root_dir = server.get_server_root_path "clangd"
+
+local VERSION = "12.0.1"
+
+local target = Data.coalesce(
+ Data.when(platform.is_mac, "clangd-mac-%s.zip"),
+ Data.when(platform.is_unix, "clangd-linux-%s.zip"),
+ Data.when(platform.is_win, "clangd-windows-%s.zip")
+):format(VERSION)
return server.Server:new {
name = "clangd",
root_dir = root_dir,
- installer = installers.when {
- unix = zx.file "./install.mjs",
- },
+ installer = std.unzip_remote(("https://github.com/clangd/clangd/releases/download/%s/%s"):format(VERSION, target)),
default_options = {
- cmd = { path.concat { root_dir, "clangd", "bin", "clangd" } },
+ cmd = { path.concat { root_dir, ("clangd_%s"):format(VERSION), "bin", "clangd" } },
},
}
diff --git a/lua/nvim-lsp-installer/servers/clangd/install.mjs b/lua/nvim-lsp-installer/servers/clangd/install.mjs
deleted file mode 100644
index 048a33c2..00000000
--- a/lua/nvim-lsp-installer/servers/clangd/install.mjs
+++ /dev/null
@@ -1,18 +0,0 @@
-const VERSION = "12.0.0";
-
-const target = (() => {
- const platform = os.platform();
- switch (platform) {
- case "darwin":
- return `clangd-mac-${VERSION}.zip`;
- default:
- return `clangd-linux-${VERSION}.zip`;
- }
-})();
-
-const downloadUrl = `https://github.com/clangd/clangd/releases/download/${VERSION}/${target}`;
-
-await $`wget -O clangd.zip ${downloadUrl}`;
-await $`unzip clangd.zip`;
-await $`rm clangd.zip`;
-await $`mv clangd_${VERSION} clangd`;
diff --git a/lua/nvim-lsp-installer/servers/clojure_lsp/init.lua b/lua/nvim-lsp-installer/servers/clojure_lsp/init.lua
index 8f22b676..a1331309 100644
--- a/lua/nvim-lsp-installer/servers/clojure_lsp/init.lua
+++ b/lua/nvim-lsp-installer/servers/clojure_lsp/init.lua
@@ -1,15 +1,25 @@
local server = require "nvim-lsp-installer.server"
-local installers = require "nvim-lsp-installer.installers"
local path = require "nvim-lsp-installer.path"
-local zx = require "nvim-lsp-installer.installers.zx"
+local std = require "nvim-lsp-installer.installers.std"
+local Data = require "nvim-lsp-installer.data"
+local platform = require "nvim-lsp-installer.platform"
local root_dir = server.get_server_root_path "clojure_lsp"
+local VERSION = "2021.07.01-19.49.02"
+
+local target = Data.coalesce(
+ Data.when(platform.is_mac, "clojure-lsp-native-macos-amd64.zip"),
+ Data.when(platform.is_unix, "clojure-lsp-native-linux-amd64.zip"),
+ Data.when(platform.is_win, "clojure-lsp-native-windows-amd64.zip")
+)
+
return server.Server:new {
name = "clojure_lsp",
root_dir = root_dir,
- installer = installers.when {
- unix = zx.file "./install.mjs",
+ installer = {
+ std.unzip_remote(("https://github.com/clojure-lsp/clojure-lsp/releases/download/%s/%s"):format(VERSION, target)),
+ std.chmod("+x", { "clojure-lsp" }),
},
default_options = {
cmd = { path.concat { root_dir, "clojure-lsp" } },
diff --git a/lua/nvim-lsp-installer/servers/clojure_lsp/install.mjs b/lua/nvim-lsp-installer/servers/clojure_lsp/install.mjs
deleted file mode 100644
index 049e983c..00000000
--- a/lua/nvim-lsp-installer/servers/clojure_lsp/install.mjs
+++ /dev/null
@@ -1,17 +0,0 @@
-const VERSION = "2021.07.01-19.49.02";
-
-const target = (() => {
- switch (os.platform()) {
- case "darwin":
- return "clojure-lsp-native-macos-amd64.zip";
- default:
- return "clojure-lsp-native-linux-amd64.zip";
- }
-})();
-
-const downloadUrl = `https://github.com/clojure-lsp/clojure-lsp/releases/download/${VERSION}/${target}`;
-
-await $`wget ${downloadUrl}`;
-await $`unzip -o ${target}`;
-await $`chmod +x clojure-lsp`;
-await $`rm ${target}`;
diff --git a/lua/nvim-lsp-installer/servers/elixirls/init.lua b/lua/nvim-lsp-installer/servers/elixirls/init.lua
index 5c6c2040..cc98f5c6 100644
--- a/lua/nvim-lsp-installer/servers/elixirls/init.lua
+++ b/lua/nvim-lsp-installer/servers/elixirls/init.lua
@@ -1,20 +1,15 @@
local server = require "nvim-lsp-installer.server"
local path = require "nvim-lsp-installer.path"
-local installers = require "nvim-lsp-installer.installers"
-local shell = require "nvim-lsp-installer.installers.shell"
+local std = require "nvim-lsp-installer.installers.std"
local root_dir = server.get_server_root_path "elixir"
return server.Server:new {
name = "elixirls",
root_dir = root_dir,
- installer = installers.when {
- unix = shell.bash [[
- wget -O elixir-ls.zip https://github.com/elixir-lsp/elixir-ls/releases/download/v0.8.1/elixir-ls.zip;
- unzip elixir-ls.zip -d elixir-ls;
- rm elixir-ls.zip;
- chmod +x elixir-ls/language_server.sh;
- ]],
+ installer = {
+ std.unzip_remote("https://github.com/elixir-lsp/elixir-ls/releases/download/v0.8.1/elixir-ls.zip", "elixir-ls"),
+ std.chmod("+x", { "elixir-ls/language_server.sh" }),
},
default_options = {
cmd = { path.concat { root_dir, "elixir-ls", "language_server.sh" } },
diff --git a/lua/nvim-lsp-installer/servers/groovyls/init.lua b/lua/nvim-lsp-installer/servers/groovyls/init.lua
index f885d933..1b492c4d 100644
--- a/lua/nvim-lsp-installer/servers/groovyls/init.lua
+++ b/lua/nvim-lsp-installer/servers/groovyls/init.lua
@@ -1,21 +1,18 @@
local server = require "nvim-lsp-installer.server"
local path = require "nvim-lsp-installer.path"
-local installers = require "nvim-lsp-installer.installers"
-local shell = require "nvim-lsp-installer.installers.shell"
+local std = require "nvim-lsp-installer.installers.std"
local root_dir = server.get_server_root_path "groovyls"
return server.Server:new {
name = "groovyls",
root_dir = root_dir,
- pre_install_check = function()
- if vim.fn.executable "javac" ~= 1 then
- error "Missing a Javac installation."
- end
- end,
- installer = installers.when {
- unix = shell.bash [[ git clone --depth 1 https://github.com/GroovyLanguageServer/groovy-language-server . && ./gradlew build ]],
- win = shell.cmd [[ git clone --depth 1 https://github.com/GroovyLanguageServer/groovy-language-server . && .\gradlew build ]],
+ installer = {
+ std.ensure_executables { "javac" },
+ std.git_clone "https://github.com/GroovyLanguageServer/groovy-language-server",
+ std.gradlew {
+ args = { "build" },
+ },
},
default_options = {
cmd = { "java", "-jar", path.concat { root_dir, "build", "libs", "groovyls-all.jar" } },
diff --git a/lua/nvim-lsp-installer/servers/hls/init.lua b/lua/nvim-lsp-installer/servers/hls/init.lua
index 2ce227f9..88b48e99 100644
--- a/lua/nvim-lsp-installer/servers/hls/init.lua
+++ b/lua/nvim-lsp-installer/servers/hls/init.lua
@@ -1,17 +1,37 @@
local server = require "nvim-lsp-installer.server"
+local platform = require "nvim-lsp-installer.platform"
local installers = require "nvim-lsp-installer.installers"
local path = require "nvim-lsp-installer.path"
-local zx = require "nvim-lsp-installer.installers.zx"
+local std = require "nvim-lsp-installer.installers.std"
+local shell = require "nvim-lsp-installer.installers.shell"
+local Data = require "nvim-lsp-installer.data"
local root_dir = server.get_server_root_path "haskell"
+local VERSION = "1.3.0"
+
+local target = Data.coalesce(
+ Data.when(platform.is_mac, "haskell-language-server-macOS-%s.tar.gz"),
+ Data.when(platform.is_unix, "haskell-language-server-Linux-%s.tar.gz"),
+ Data.when(platform.is_win, "haskell-language-server-Windows-%s.tar.gz")
+):format(VERSION)
+
return server.Server:new {
name = "hls",
root_dir = root_dir,
- installer = installers.when {
- unix = zx.file "./install.mjs",
+ installer = {
+ std.untargz_remote(
+ ("https://github.com/haskell/haskell-language-server/releases/download/%s/%s"):format(VERSION, target)
+ ),
+ installers.on {
+ -- we can't use std.chmod because of shell wildcard expansion
+ unix = shell.bash [[ chmod +x haskell*]],
+ },
},
default_options = {
- cmd = { path.concat { root_dir, "hls" } },
+ cmd = { path.concat { root_dir, "haskell-language-server-wrapper", "--lsp" } },
+ cmd_env = {
+ PATH = table.concat({ root_dir, vim.env.PATH }, platform.path_sep),
+ },
},
}
diff --git a/lua/nvim-lsp-installer/servers/hls/install.mjs b/lua/nvim-lsp-installer/servers/hls/install.mjs
deleted file mode 100644
index c9460e7c..00000000
--- a/lua/nvim-lsp-installer/servers/hls/install.mjs
+++ /dev/null
@@ -1,26 +0,0 @@
-const VERSION = "1.3.0";
-
-const target = (() => {
- const platform = os.platform();
- switch (platform) {
- case "darwin":
- return `haskell-language-server-macOS-${VERSION}.tar.gz`;
- default:
- return `haskell-language-server-Linux-${VERSION}.tar.gz`;
- }
-})();
-
-const downloadUrl = `https://github.com/haskell/haskell-language-server/releases/download/${VERSION}/${target}`;
-
-await $`wget -O hls.tar.gz ${downloadUrl}`;
-await $`tar -xf hls.tar.gz`;
-await $`rm hls.tar.gz`;
-await $`chmod +x haskell*`;
-
-const scriptContent = `#!/usr/bin/env bash
-HLS_DIR=$(dirname "$0")
-export PATH=$PATH:$HLS_DIR
-haskell-language-server-wrapper --lsp`;
-
-await fs.writeFile("./hls", scriptContent);
-await $`chmod +x hls`
diff --git a/lua/nvim-lsp-installer/servers/kotlin_language_server/init.lua b/lua/nvim-lsp-installer/servers/kotlin_language_server/init.lua
index 7b4a481d..45c4d9e1 100644
--- a/lua/nvim-lsp-installer/servers/kotlin_language_server/init.lua
+++ b/lua/nvim-lsp-installer/servers/kotlin_language_server/init.lua
@@ -1,22 +1,14 @@
local server = require "nvim-lsp-installer.server"
local path = require "nvim-lsp-installer.path"
-local installers = require "nvim-lsp-installer.installers"
local platform = require "nvim-lsp-installer.platform"
-local shell = require "nvim-lsp-installer.installers.shell"
+local std = require "nvim-lsp-installer.installers.std"
local root_dir = server.get_server_root_path "kotlin"
return server.Server:new {
name = "kotlin_language_server",
root_dir = root_dir,
- installer = installers.when {
- unix = shell.bash [[
- wget -O server.zip https://github.com/fwcd/kotlin-language-server/releases/latest/download/server.zip;
- unzip server.zip;
- rm server.zip;
- ]],
- win = shell.cmd [[ curl -fLo server.zip https://github.com/fwcd/kotlin-language-server/releases/latest/download/server.zip && tar -xvf server.zip && del /f server.zip ]],
- },
+ installer = std.unzip_remote "https://github.com/fwcd/kotlin-language-server/releases/latest/download/server.zip",
default_options = {
cmd = {
path.concat {
diff --git a/lua/nvim-lsp-installer/servers/omnisharp/common.mjs b/lua/nvim-lsp-installer/servers/omnisharp/common.mjs
deleted file mode 100644
index cd41b089..00000000
--- a/lua/nvim-lsp-installer/servers/omnisharp/common.mjs
+++ /dev/null
@@ -1,35 +0,0 @@
-const VERSION = "v1.37.11";
-
-const exitNotSupported = () => {
- console.error(chalk.red(`${os.platform()} ${os.arch()} is currently not supported.`));
- process.exit(1);
-};
-
-export const getDownloadUrl = () => {
- const target = (() => {
- switch (os.platform()) {
- case "darwin":
- return "omnisharp-osx.zip";
- case "win32":
- switch (os.arch()) {
- case "arm64":
- return "omnisharp-win-arm64.zip";
- case "x64":
- return "omnisharp-win-x64.zip";
- default:
- return exitNotSupported();
- }
- default:
- switch (os.arch()) {
- case "arm64":
- return exitNotSupported();
- case "x64":
- return "omnisharp-linux-x64.zip";
- default:
- return exitNotSupported();
- }
- }
- })();
-
- return `https://github.com/OmniSharp/omnisharp-roslyn/releases/download/${VERSION}/${target}`;
-};
diff --git a/lua/nvim-lsp-installer/servers/omnisharp/init.lua b/lua/nvim-lsp-installer/servers/omnisharp/init.lua
index 825ba811..4bb2a7ec 100644
--- a/lua/nvim-lsp-installer/servers/omnisharp/init.lua
+++ b/lua/nvim-lsp-installer/servers/omnisharp/init.lua
@@ -1,17 +1,34 @@
local server = require "nvim-lsp-installer.server"
-local installers = require "nvim-lsp-installer.installers"
local platform = require "nvim-lsp-installer.platform"
local path = require "nvim-lsp-installer.path"
-local zx = require "nvim-lsp-installer.installers.zx"
+local Data = require "nvim-lsp-installer.data"
+local std = require "nvim-lsp-installer.installers.std"
local root_dir = server.get_server_root_path "omnisharp"
+local VERSION = "v1.37.15"
+
+local target = Data.coalesce(
+ Data.when(platform.is_mac, "omnisharp-osx.zip"),
+ Data.when(platform.is_unix and platform.arch == "x64", "omnisharp-linux-x64.zip"),
+ Data.when(
+ platform.is_win,
+ Data.coalesce(
+ Data.when(platform.arch == "x64", "omnisharp-win-x64.zip"),
+ Data.when(platform.arch == "arm64", "omnisharp-win-arm64.zip")
+ )
+ )
+)
+
return server.Server:new {
name = "omnisharp",
root_dir = root_dir,
- installer = installers.when {
- unix = zx.file "./install.mjs",
- win = zx.file "./install.win.mjs",
+ installer = {
+ std.unzip_remote(
+ ("https://github.com/OmniSharp/omnisharp-roslyn/releases/download/%s/%s"):format(VERSION, target),
+ "omnisharp"
+ ),
+ std.chmod("+x", { "omnisharp/run" }),
},
default_options = {
cmd = {
diff --git a/lua/nvim-lsp-installer/servers/omnisharp/install.mjs b/lua/nvim-lsp-installer/servers/omnisharp/install.mjs
deleted file mode 100644
index 14d705b3..00000000
--- a/lua/nvim-lsp-installer/servers/omnisharp/install.mjs
+++ /dev/null
@@ -1,6 +0,0 @@
-import { getDownloadUrl } from "./common.mjs";
-
-await $`wget -O omnisharp.zip ${getDownloadUrl()}`;
-await $`unzip omnisharp.zip -d omnisharp`;
-await $`chmod +x omnisharp/run`;
-await $`rm omnisharp.zip`;
diff --git a/lua/nvim-lsp-installer/servers/omnisharp/install.win.mjs b/lua/nvim-lsp-installer/servers/omnisharp/install.win.mjs
deleted file mode 100644
index 286c60f5..00000000
--- a/lua/nvim-lsp-installer/servers/omnisharp/install.win.mjs
+++ /dev/null
@@ -1,10 +0,0 @@
-import { getDownloadUrl } from "./common.mjs";
-
-// TODO: can this be... less hacky?
-$.shell = "powershell.exe";
-$.prefix = "";
-$.quote = (a) => a;
-
-await $`wget -O omnisharp.zip ${getDownloadUrl()}`;
-await $`tar -xvf omnisharp.zip`;
-await $`rm omnisharp.zip`;
diff --git a/lua/nvim-lsp-installer/servers/rescriptls/init.lua b/lua/nvim-lsp-installer/servers/rescriptls/init.lua
index f7aad87a..f61ff241 100644
--- a/lua/nvim-lsp-installer/servers/rescriptls/init.lua
+++ b/lua/nvim-lsp-installer/servers/rescriptls/init.lua
@@ -1,24 +1,13 @@
local server = require "nvim-lsp-installer.server"
local path = require "nvim-lsp-installer.path"
-local installers = require "nvim-lsp-installer.installers"
-local shell = require "nvim-lsp-installer.installers.shell"
+local std = require "nvim-lsp-installer.installers.std"
local root_dir = server.get_server_root_path "rescriptls"
return server.Server:new {
name = "rescriptls",
root_dir = root_dir,
- installer = installers.when {
- unix = shell.bash [[
- curl -fs https://api.github.com/repos/rescript-lang/rescript-vscode/releases/latest \
- | grep "browser_download_url.*vsix" \
- | cut -d : -f 2,3 \
- | tr -d '"' \
- | wget -i - -O vscode-rescript.vsix;
- unzip -q -o vscode-rescript.vsix;
- rm -f vscode-rescript.vsix;
- ]],
- },
+ installer = std.unzip_remote "https://github.com/rescript-lang/rescript-vscode/releases/download/1.1.3/rescript-vscode-1.1.3.vsix",
default_options = {
cmd = { "node", path.concat { root_dir, "extension", "server", "out", "server.js" }, "--stdio" },
},
diff --git a/lua/nvim-lsp-installer/servers/rust_analyzer/common.mjs b/lua/nvim-lsp-installer/servers/rust_analyzer/common.mjs
deleted file mode 100644
index 0f54a71e..00000000
--- a/lua/nvim-lsp-installer/servers/rust_analyzer/common.mjs
+++ /dev/null
@@ -1,41 +0,0 @@
-export const VERSION = "2021-06-28";
-
-const exitNotSupported = () => {
- console.error(chalk.red(`${os.platform()} ${os.arch()} is currently not supported.`));
- process.exit(1);
-};
-
-export const getDownloadUrl = () => {
- const target = (() => {
- switch (os.platform()) {
- case "win32": {
- switch (os.arch()) {
- case "arm64":
- return "rust-analyzer-aarch64-pc-windows-msvc.gz";
- case "x64":
- return "rust-analyzer-x86_64-pc-windows-msvc.gz";
- default:
- return exitNotSupported();
- }
- }
- case "darwin":
- switch (os.arch()) {
- case "arm64":
- return "rust-analyzer-aarch64-apple-darwin.gz";
- case "x64":
- return "rust-analyzer-x86_64-apple-darwin.gz";
- default:
- return exitNotSupported();
- }
- default:
- switch (os.arch()) {
- case "arm64":
- return "rust-analyzer-aarch64-unknown-linux-gnu.gz";
- default:
- return "rust-analyzer-x86_64-unknown-linux-gnu.gz";
- }
- }
- })();
-
- return `https://github.com/rust-analyzer/rust-analyzer/releases/download/${VERSION}/${target}`;
-};
diff --git a/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua b/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua
index 58cb53e2..c5592be8 100644
--- a/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua
+++ b/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua
@@ -1,16 +1,46 @@
local server = require "nvim-lsp-installer.server"
-local installers = require "nvim-lsp-installer.installers"
local path = require "nvim-lsp-installer.path"
-local zx = require "nvim-lsp-installer.installers.zx"
+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(
+ Data.when(
+ platform.is_mac,
+ Data.coalesce(
+ Data.when(platform.arch == "arm64", "rust-analyzer-aarch64-apple-darwin.gz"),
+ Data.when(platform.arch == "x64", "rust-analyzer-x86_64-apple-darwin.gz")
+ )
+ ),
+ Data.when(
+ platform.is_unix,
+ 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")
+ )
+ ),
+ Data.when(
+ platform.is_win,
+ Data.coalesce(
+ Data.when(platform.arch == "arm64", "rust-analyzer-aarch64-pc-windows-msvc.gz"),
+ Data.when(platform.arch == "x64", "rust-analyzer-x86_64-pc-windows-msvc.gz")
+ )
+ )
+)
+
return server.Server:new {
name = "rust_analyzer",
root_dir = root_dir,
- installer = installers.when {
- unix = zx.file "./install.mjs",
- win = zx.file "./install.win.mjs",
+ 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" } },
diff --git a/lua/nvim-lsp-installer/servers/rust_analyzer/install.mjs b/lua/nvim-lsp-installer/servers/rust_analyzer/install.mjs
deleted file mode 100644
index 4d3fec85..00000000
--- a/lua/nvim-lsp-installer/servers/rust_analyzer/install.mjs
+++ /dev/null
@@ -1,5 +0,0 @@
-import { getDownloadUrl } from "./common.mjs";
-
-await $`wget -O rust-analyzer.gz ${getDownloadUrl()}`;
-await $`gzip -fd rust-analyzer.gz`;
-await $`chmod +x rust-analyzer`;
diff --git a/lua/nvim-lsp-installer/servers/rust_analyzer/install.win.mjs b/lua/nvim-lsp-installer/servers/rust_analyzer/install.win.mjs
deleted file mode 100644
index 22ad75f7..00000000
--- a/lua/nvim-lsp-installer/servers/rust_analyzer/install.win.mjs
+++ /dev/null
@@ -1,9 +0,0 @@
-import { getDownloadUrl } from "./common.mjs";
-
-// TODO: can this be... less hacky?
-$.shell = "powershell.exe";
-$.prefix = "";
-$.quote = (a) => a;
-
-await $`wget -O rust-analyzer.exe.gz ${getDownloadUrl()}`;
-await $`gzip -fd rust-analyzer.exe.gz`;
diff --git a/lua/nvim-lsp-installer/servers/solargraph/init.lua b/lua/nvim-lsp-installer/servers/solargraph/init.lua
index d23b029e..458bb7ea 100644
--- a/lua/nvim-lsp-installer/servers/solargraph/init.lua
+++ b/lua/nvim-lsp-installer/servers/solargraph/init.lua
@@ -1,22 +1,14 @@
local server = require "nvim-lsp-installer.server"
-local installers = require "nvim-lsp-installer.installers"
-local path = require "nvim-lsp-installer.path"
-local zx = require "nvim-lsp-installer.installers.zx"
+local gem = require "nvim-lsp-installer.installers.gem"
-local root_dir = server.get_server_root_path "ruby"
+local root_dir = server.get_server_root_path "solargraph"
return server.Server:new {
name = "solargraph",
root_dir = root_dir,
- installer = installers.when {
- unix = zx.file "./install.mjs",
- },
- pre_install_check = function()
- if vim.fn.executable "bundle" ~= 1 then
- error "bundle not installed"
- end
- end,
+ installer = gem.packages { "solargraph" },
default_options = {
- cmd = { path.concat { root_dir, "solargraph", "solargraph" }, "stdio" },
+ cmd = { gem.executable(root_dir, "solargraph"), "stdio" },
+ cmd_env = gem.env(root_dir),
},
}
diff --git a/lua/nvim-lsp-installer/servers/solargraph/install.mjs b/lua/nvim-lsp-installer/servers/solargraph/install.mjs
deleted file mode 100644
index 94db0bc8..00000000
--- a/lua/nvim-lsp-installer/servers/solargraph/install.mjs
+++ /dev/null
@@ -1,14 +0,0 @@
-await $`git clone --depth 1 https://github.com/castwide/solargraph.git .`;
-
-await $`bundle config set --local without 'development'`;
-await $`bundle config set --local path 'vendor/bundle'`;
-await $`bundle install`;
-
-await fs.writeFile(
- "./solargraph",
- `#!/usr/bin/env bash
-cd "$(dirname "$0")" || exit 1
-bundle exec solargraph $*`
-);
-
-await $`chmod +x solargraph`;
diff --git a/lua/nvim-lsp-installer/servers/sumneko_lua/init.lua b/lua/nvim-lsp-installer/servers/sumneko_lua/init.lua
index 7ad00ebe..696679b0 100644
--- a/lua/nvim-lsp-installer/servers/sumneko_lua/init.lua
+++ b/lua/nvim-lsp-installer/servers/sumneko_lua/init.lua
@@ -1,32 +1,33 @@
local server = require "nvim-lsp-installer.server"
-local installers = require "nvim-lsp-installer.installers"
local path = require "nvim-lsp-installer.path"
-local zx = require "nvim-lsp-installer.installers.zx"
+local platform = require "nvim-lsp-installer.platform"
+local Data = require "nvim-lsp-installer.data"
+local std = require "nvim-lsp-installer.installers.std"
-local root_dir = server.get_server_root_path "lua"
+local root_dir = server.get_server_root_path "sumneko_lua"
-local uname_alias = {
- Darwin = "macOS",
-}
-local uname = vim.fn.system("uname"):gsub("%s+", "")
-local bin_dir = uname_alias[uname] or uname
+local bin_dir = Data.coalesce(
+ Data.when(platform.is_mac, "macOS"),
+ Data.when(platform.is_unix, "Linux"),
+ Data.when(platform.is_win, "Windows")
+)
return server.Server:new {
name = "sumneko_lua",
root_dir = root_dir,
- installer = installers.when {
- unix = zx.file "./install.mjs",
+ installer = {
+ std.unzip_remote "https://github.com/sumneko/vscode-lua/releases/download/v2.3.6/lua-2.3.6.vsix",
+ -- see https://github.com/sumneko/vscode-lua/pull/43
+ std.chmod(
+ "+x",
+ { "extension/server/bin/macOS/lua-language-server", "extension/server/bin/Linux/lua-language-server" }
+ ),
},
- pre_install_check = function()
- if vim.fn.executable "ninja" ~= 1 then
- error "ninja not installed (see https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages)"
- end
- end,
default_options = {
cmd = {
- path.concat { root_dir, "bin", bin_dir, "lua-language-server" },
+ path.concat { root_dir, "extension", "server", "bin", bin_dir, "lua-language-server" },
"-E",
- path.concat { root_dir, "main.lua" },
+ path.concat { root_dir, "extension", "server", "main.lua" },
},
settings = {
Lua = {
diff --git a/lua/nvim-lsp-installer/servers/sumneko_lua/install.mjs b/lua/nvim-lsp-installer/servers/sumneko_lua/install.mjs
deleted file mode 100644
index 3f2d20e0..00000000
--- a/lua/nvim-lsp-installer/servers/sumneko_lua/install.mjs
+++ /dev/null
@@ -1,17 +0,0 @@
-await $`git clone --depth 1 https://github.com/sumneko/lua-language-server.git .`;
-await $`git submodule update --init --recursive`;
-
-cd("3rd/luamake");
-switch (os.platform()) {
- case "darwin": {
- await $`ninja -f compile/ninja/macos.ninja`;
- break;
- }
- default: {
- await $`ninja -f compile/ninja/linux.ninja`;
- break;
- }
-}
-
-cd(".");
-await $`./3rd/luamake/luamake rebuild &> /dev/null`;
diff --git a/lua/nvim-lsp-installer/servers/tailwindcss/init.lua b/lua/nvim-lsp-installer/servers/tailwindcss/init.lua
index cf76d0b0..c674f11c 100644
--- a/lua/nvim-lsp-installer/servers/tailwindcss/init.lua
+++ b/lua/nvim-lsp-installer/servers/tailwindcss/init.lua
@@ -1,21 +1,13 @@
local server = require "nvim-lsp-installer.server"
-local installers = require "nvim-lsp-installer.installers"
-local path = require "nvim-lsp-installer.path"
-local zx = require "nvim-lsp-installer.installers.zx"
+local npm = require "nvim-lsp-installer.installers.npm"
-local root_dir = server.get_server_root_path "tailwindcss"
+local root_dir = server.get_server_root_path "tailwindcss_npm"
return server.Server:new {
name = "tailwindcss",
root_dir = root_dir,
- installer = installers.when {
- unix = zx.file "./install.mjs",
- },
+ installer = npm.packages { "@tailwindcss/language-server" },
default_options = {
- cmd = {
- "node",
- path.concat { root_dir, "tailwindcss", "extension", "dist", "server", "tailwindServer.js" },
- "--stdio",
- },
+ cmd = { npm.executable(root_dir, "tailwindcss-language-server"), "--stdio" },
},
}
diff --git a/lua/nvim-lsp-installer/servers/tailwindcss/install.mjs b/lua/nvim-lsp-installer/servers/tailwindcss/install.mjs
deleted file mode 100644
index 31d9083d..00000000
--- a/lua/nvim-lsp-installer/servers/tailwindcss/install.mjs
+++ /dev/null
@@ -1,7 +0,0 @@
-const VERSION = "v0.6.12"
-
-const downloadUrl = `https://github.com/tailwindlabs/tailwindcss-intellisense/releases/download/${VERSION}/vscode-tailwindcss-${VERSION.replace(/^v/, "")}.vsix`
-
-await $`wget -O tailwindcss-intellisense.vsix ${downloadUrl}`
-await $`unzip tailwindcss-intellisense.vsix -d tailwindcss`
-await $`rm tailwindcss-intellisense.vsix`
diff --git a/lua/nvim-lsp-installer/servers/terraformls/init.lua b/lua/nvim-lsp-installer/servers/terraformls/init.lua
index 5df3cecc..17aa0859 100644
--- a/lua/nvim-lsp-installer/servers/terraformls/init.lua
+++ b/lua/nvim-lsp-installer/servers/terraformls/init.lua
@@ -1,16 +1,39 @@
local server = require "nvim-lsp-installer.server"
-local installers = require "nvim-lsp-installer.installers"
local path = require "nvim-lsp-installer.path"
-local zx = require "nvim-lsp-installer.installers.zx"
+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 "terraform"
+local VERSION = "0.21.0"
+
+local target = Data.coalesce(
+ Data.when(
+ platform.is_mac,
+ Data.coalesce(
+ Data.when(platform.arch == "arm64", "terraform-ls_%s_darwin_arm64.zip"),
+ Data.when(platform.arch == "x64", "terraform-ls_%s_darwin_amd64.zip")
+ )
+ ),
+ Data.when(
+ platform.is_unix,
+ Data.coalesce(
+ Data.when(platform.arch == "arm64", "terraform-ls_%s_linux_arm64.zip"),
+ Data.when(platform.arch == "arm", "terraform-ls_%s_linux_arm.zip"),
+ Data.when(platform.arch == "x64", "terraform-ls_%s_linux_amd64.zip")
+ )
+ ),
+ Data.when(platform.is_win, Data.coalesce(Data.when(platform.arch == "x64", "terraform-ls_%s_windows_amd64.zip")))
+):format(VERSION)
+
return server.Server:new {
name = "terraformls",
root_dir = root_dir,
- installer = installers.when {
- unix = zx.file "./install.mjs",
- },
+ installer = std.unzip_remote(
+ ("https://github.com/hashicorp/terraform-ls/releases/download/v%s/%s"):format(VERSION, target),
+ "terraform-ls"
+ ),
default_options = {
cmd = { path.concat { root_dir, "terraform-ls", "terraform-ls" }, "serve" },
},
diff --git a/lua/nvim-lsp-installer/servers/terraformls/install.mjs b/lua/nvim-lsp-installer/servers/terraformls/install.mjs
deleted file mode 100644
index 04efc288..00000000
--- a/lua/nvim-lsp-installer/servers/terraformls/install.mjs
+++ /dev/null
@@ -1,35 +0,0 @@
-const VERSION = "v0.18.3";
-
-const exitNotSupported = () => {
- console.error(chalk.red(`${os.platform()} ${os.arch()} is currently not supported.`));
- process.exit(1);
-};
-
-const target = (() => {
- switch (os.platform()) {
- case "darwin":
- switch (os.arch()) {
- case "arm64":
- return "terraform-ls_0.18.3_darwin_arm64.zip";
- case "x64":
- return "terraform-ls_0.18.3_darwin_amd64.zip";
- default: {
- exitNotSupported();
- break;
- }
- }
- default:
- switch (os.arch()) {
- case "arm64":
- return "terraform-ls_0.18.3_linux_arm64.zip";
- default:
- return "terraform-ls_0.18.3_linux_amd64.zip";
- }
- }
-})();
-
-const downloadUrl = `https://github.com/hashicorp/terraform-ls/releases/download/${VERSION}/${target}`;
-
-await $`wget -O terraform-ls.zip ${downloadUrl}`;
-await $`unzip terraform-ls.zip -d terraform-ls`;
-await $`rm terraform-ls.zip`;
diff --git a/lua/nvim-lsp-installer/servers/texlab/init.lua b/lua/nvim-lsp-installer/servers/texlab/init.lua
index c669806b..a28b4273 100644
--- a/lua/nvim-lsp-installer/servers/texlab/init.lua
+++ b/lua/nvim-lsp-installer/servers/texlab/init.lua
@@ -1,23 +1,26 @@
local server = require "nvim-lsp-installer.server"
-local installers = require "nvim-lsp-installer.installers"
local path = require "nvim-lsp-installer.path"
-local zx = require "nvim-lsp-installer.installers.zx"
+local std = require "nvim-lsp-installer.installers.std"
+local Data = require "nvim-lsp-installer.data"
+local platform = require "nvim-lsp-installer.platform"
local root_dir = server.get_server_root_path "latex"
+local VERSION = "v3.2.0"
+
+local target = Data.coalesce(
+ Data.when(platform.is_mac, "texlab-x86_64-macos.tar.gz"),
+ Data.when(platform.is_unix, "texlab-x86_64-linux.tar.gz"),
+ Data.when(platform.is_win, "texlab-x86_64-windows.tar.gz")
+)
+
return server.Server:new {
name = "texlab",
root_dir = root_dir,
- installer = installers.when {
- unix = zx.file "./install.mjs",
+ installer = {
+ std.ensure_executables { "pdflatex" },
+ std.untargz_remote(("https://github.com/latex-lsp/texlab/releases/download/%s/%s"):format(VERSION, target)),
},
- pre_install_check = function()
- if vim.fn.executable "wget" ~= 1 then
- error "Missing wget. Please, refer to https://www.gnu.org/software/wget/ to install it."
- elseif vim.fn.executable "pdflatex" ~= 1 then
- error "The program pdflatex wasn't found. Please install a TeX distribution: https://www.latex-project.org/get/#tex-distributions"
- end
- end,
default_options = {
cmd = { path.concat { root_dir, "texlab" } },
},
diff --git a/lua/nvim-lsp-installer/servers/texlab/install.mjs b/lua/nvim-lsp-installer/servers/texlab/install.mjs
deleted file mode 100644
index bc7fefe1..00000000
--- a/lua/nvim-lsp-installer/servers/texlab/install.mjs
+++ /dev/null
@@ -1,16 +0,0 @@
-const VERSION = "v3.2.0";
-
-const platform = os.platform();
-
-const target = (() => {
- switch (platform) {
- case "darwin":
- return `https://github.com/latex-lsp/texlab/releases/download/${VERSION}/texlab-x86_64-macos.tar.gz`;
- default:
- return `https://github.com/latex-lsp/texlab/releases/download/${VERSION}/texlab-x86_64-linux.tar.gz`;
- }
-})();
-
-await $`wget -O texlab.tar.gz ${target}`;
-await $`tar xf texlab.tar.gz`;
-await $`rm texlab.tar.gz`;