diff options
| author | William Boman <william@redwill.se> | 2021-07-04 19:55:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-04 19:55:20 +0200 |
| commit | db8d88688e6709eacdf5caffda7ed50bb9248363 (patch) | |
| tree | f250c973b599840dd9f8e7e1c872d6674483cb2b /lua | |
| parent | angularls: fix rootpath (diff) | |
| download | mason-db8d88688e6709eacdf5caffda7ed50bb9248363.tar mason-db8d88688e6709eacdf5caffda7ed50bb9248363.tar.gz mason-db8d88688e6709eacdf5caffda7ed50bb9248363.tar.bz2 mason-db8d88688e6709eacdf5caffda7ed50bb9248363.tar.lz mason-db8d88688e6709eacdf5caffda7ed50bb9248363.tar.xz mason-db8d88688e6709eacdf5caffda7ed50bb9248363.tar.zst mason-db8d88688e6709eacdf5caffda7ed50bb9248363.zip | |
add clojure_lsp (#28)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-lsp-installer/server.lua | 1 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/servers/clojure_lsp/init.lua | 14 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/servers/clojure_lsp/install.mjs | 28 |
3 files changed, 43 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/server.lua b/lua/nvim-lsp-installer/server.lua index a0b1e877..55b39d89 100644 --- a/lua/nvim-lsp-installer/server.lua +++ b/lua/nvim-lsp-installer/server.lua @@ -8,6 +8,7 @@ local _SERVERS = { "angularls", "bashls", "clangd", + "clojure_lsp", "cssls", "denols", "dockerls", diff --git a/lua/nvim-lsp-installer/servers/clojure_lsp/init.lua b/lua/nvim-lsp-installer/servers/clojure_lsp/init.lua new file mode 100644 index 00000000..9a235a2d --- /dev/null +++ b/lua/nvim-lsp-installer/servers/clojure_lsp/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("clojure_lsp") + +return server.Server:new { + name = "clojure_lsp", + root_dir = root_dir, + installer = zx.file("./install.mjs"), + 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 new file mode 100644 index 00000000..29cbb77b --- /dev/null +++ b/lua/nvim-lsp-installer/servers/clojure_lsp/install.mjs @@ -0,0 +1,28 @@ +const VERSION = "2021.07.01-19.49.02"; + +const exitNotSupported = () => { + console.error( + chalk.red(`${os.platform()} ${os.arch()} is currently not supported.`) + ); + process.exit(1); +}; + +const target = (() => { + switch (os.platform()) { + case "darwin": + return "clojure-lsp-native-macos-amd64.zip"; + case "win32": { + exitNotSupported(); + break; + } + 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}`; |
