aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedro Castro <pdesacastro@gmail.com>2021-09-03 07:16:04 -0300
committerGitHub <noreply@github.com>2021-09-03 12:16:04 +0200
commit4a1dbdc548375952a16501b37828f5cb2a99ba76 (patch)
tree2943dbc2fcff442d7e245dbcffd7bec8566e247b
parentvscode-langservers-extracted: use correct root dir when producing cmd path (#75) (diff)
downloadmason-4a1dbdc548375952a16501b37828f5cb2a99ba76.tar
mason-4a1dbdc548375952a16501b37828f5cb2a99ba76.tar.gz
mason-4a1dbdc548375952a16501b37828f5cb2a99ba76.tar.bz2
mason-4a1dbdc548375952a16501b37828f5cb2a99ba76.tar.lz
mason-4a1dbdc548375952a16501b37828f5cb2a99ba76.tar.xz
mason-4a1dbdc548375952a16501b37828f5cb2a99ba76.tar.zst
mason-4a1dbdc548375952a16501b37828f5cb2a99ba76.zip
add rescriptls (#73)
-rw-r--r--README.md1
-rw-r--r--lua/nvim-lsp-installer.lua1
-rw-r--r--lua/nvim-lsp-installer/servers/rescriptls/init.lua24
3 files changed, 26 insertions, 0 deletions
diff --git a/README.md b/README.md
index ab787f6c..7efeebe9 100644
--- a/README.md
+++ b/README.md
@@ -123,6 +123,7 @@ end
| PureScript | `purescriptls` |
| Python | `pylsp` |
| Python | `pyright` |
+| ReScript | `rescriptls` |
| Rome | `rome` |
| Ruby | `solargraph` |
| Rust | `rust_analyzer` |
diff --git a/lua/nvim-lsp-installer.lua b/lua/nvim-lsp-installer.lua
index f992bbef..756b9695 100644
--- a/lua/nvim-lsp-installer.lua
+++ b/lua/nvim-lsp-installer.lua
@@ -34,6 +34,7 @@ local _SERVERS = {
["purescriptls"] = require "nvim-lsp-installer.servers.purescriptls",
["pylsp"] = require "nvim-lsp-installer.servers.pylsp",
["pyright"] = require "nvim-lsp-installer.servers.pyright",
+ ["rescriptls"] = require "nvim-lsp-installer.servers.rescriptls",
["rome"] = require "nvim-lsp-installer.servers.rome",
["rust_analyzer"] = require "nvim-lsp-installer.servers.rust_analyzer",
["solargraph"] = require "nvim-lsp-installer.servers.solargraph",
diff --git a/lua/nvim-lsp-installer/servers/rescriptls/init.lua b/lua/nvim-lsp-installer/servers/rescriptls/init.lua
new file mode 100644
index 00000000..fc9dc6f5
--- /dev/null
+++ b/lua/nvim-lsp-installer/servers/rescriptls/init.lua
@@ -0,0 +1,24 @@
+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 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;
+ ]],
+ },
+ default_options = {
+ cmd = { "node", path.concat { root_dir, "extension", "server", "out", "server.js" }, "--stdio" },
+ },
+}