aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-07-04 22:45:26 +0200
committerGitHub <noreply@github.com>2021-07-04 22:45:26 +0200
commitd0e0f6812c8f0689315212406e5433eb70b9639a (patch)
tree4d674419fdc485889b3cb1139ed3b80e8155e662 /lua
parentadd fortls (fortan) (#32) (diff)
downloadmason-d0e0f6812c8f0689315212406e5433eb70b9639a.tar
mason-d0e0f6812c8f0689315212406e5433eb70b9639a.tar.gz
mason-d0e0f6812c8f0689315212406e5433eb70b9639a.tar.bz2
mason-d0e0f6812c8f0689315212406e5433eb70b9639a.tar.lz
mason-d0e0f6812c8f0689315212406e5433eb70b9639a.tar.xz
mason-d0e0f6812c8f0689315212406e5433eb70b9639a.tar.zst
mason-d0e0f6812c8f0689315212406e5433eb70b9639a.zip
add hls (haskell) (#33)
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-lsp-installer/server.lua1
-rw-r--r--lua/nvim-lsp-installer/servers/hls/init.lua14
-rw-r--r--lua/nvim-lsp-installer/servers/hls/install.mjs21
3 files changed, 36 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/server.lua b/lua/nvim-lsp-installer/server.lua
index 8625e2bb..f907f99c 100644
--- a/lua/nvim-lsp-installer/server.lua
+++ b/lua/nvim-lsp-installer/server.lua
@@ -19,6 +19,7 @@ local _SERVERS = {
"fortls",
"gopls",
"graphql",
+ "hls",
"html",
"jsonls",
"omnisharp",
diff --git a/lua/nvim-lsp-installer/servers/hls/init.lua b/lua/nvim-lsp-installer/servers/hls/init.lua
new file mode 100644
index 00000000..1629fd47
--- /dev/null
+++ b/lua/nvim-lsp-installer/servers/hls/init.lua
@@ -0,0 +1,14 @@
+local server = require("nvim-lsp-installer.server")
+local path = require("nvim-lsp-installer.path")
+local zx = require("nvim-lsp-installer.installers.zx")
+
+local root_dir = server.get_server_root_path("haskell")
+
+return server.Server:new {
+ name = "hls",
+ root_dir = root_dir,
+ installer = zx.file("./install.mjs"),
+ default_options = {
+ cmd = { path.concat { root_dir, "hls" }, "--lsp" },
+ },
+}
diff --git a/lua/nvim-lsp-installer/servers/hls/install.mjs b/lua/nvim-lsp-installer/servers/hls/install.mjs
new file mode 100644
index 00000000..be239614
--- /dev/null
+++ b/lua/nvim-lsp-installer/servers/hls/install.mjs
@@ -0,0 +1,21 @@
+const VERSION = "1.2.0";
+
+const target = (() => {
+ const platform = os.platform();
+ switch (platform) {
+ case "win32": {
+ console.error(chalk.red(`${platform} is not yet supported.`));
+ process.exit(1);
+ }
+ case "darwin":
+ return `haskell-language-server-wrapper-macOS.gz`;
+ default:
+ return `haskell-language-server-wrapper-Linux.gz`;
+ }
+})();
+
+const downloadUrl = `https://github.com/haskell/haskell-language-server/releases/download/${VERSION}/${target}`;
+
+await $`wget -O hls.gz ${downloadUrl}`;
+await $`gunzip hls.gz`;
+await $`chmod +x hls`