aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorLander Lopez <lander.lopez@gmail.com>2020-06-07 21:37:19 +0100
committerLander Lopez <lander.lopez@gmail.com>2020-06-08 10:08:46 +0100
commit9279c43b5eb4596e4a90fafe4a4f2cc84b51aaee (patch)
tree206d44ed13b076c75e3c543684b870dbc6bceff4 /lua
parentMerge pull request #249 from neovim/healthcheck (diff)
downloadnvim-lspconfig-9279c43b5eb4596e4a90fafe4a4f2cc84b51aaee.tar
nvim-lspconfig-9279c43b5eb4596e4a90fafe4a4f2cc84b51aaee.tar.gz
nvim-lspconfig-9279c43b5eb4596e4a90fafe4a4f2cc84b51aaee.tar.bz2
nvim-lspconfig-9279c43b5eb4596e4a90fafe4a4f2cc84b51aaee.tar.lz
nvim-lspconfig-9279c43b5eb4596e4a90fafe4a4f2cc84b51aaee.tar.xz
nvim-lspconfig-9279c43b5eb4596e4a90fafe4a4f2cc84b51aaee.tar.zst
nvim-lspconfig-9279c43b5eb4596e4a90fafe4a4f2cc84b51aaee.zip
Add coursier candidate, fix folder creation when empty
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim_lsp/metals.lua19
1 files changed, 12 insertions, 7 deletions
diff --git a/lua/nvim_lsp/metals.lua b/lua/nvim_lsp/metals.lua
index 803ebfa7..35b1fe5b 100644
--- a/lua/nvim_lsp/metals.lua
+++ b/lua/nvim_lsp/metals.lua
@@ -27,17 +27,23 @@ local function make_installer()
error('Need "JDK" to install this.')
return
end
- local coursier_exe
- if not (util.has_bins("cs")) then
+
+ local coursier_exe = nil
+ if util.has_bins("cs") then
+ coursier_exe = "cs"
+ elseif util.has_bins("coursier") then
+ coursier_exe = "coursier"
+ end
+ if not coursier_exe then
coursier_exe = install_dir .. "/coursier"
local download_cmd = string.format("curl -fLo %s --create-dirs https://git.io/coursier-cli", coursier_exe)
local chmod_cmd = string.format("chmod +x %s", coursier_exe)
vim.fn.system(download_cmd)
vim.fn.system(chmod_cmd)
else
- os.execute("mkdir " .. install_dir)
- coursier_exe = "cs"
+ os.execute("mkdir -p " .. install_dir)
end
+
local install_cmd = string.format("%s bootstrap --java-opt -Xss4m --java-opt -Xms100m org.scalameta:metals_2.12:%s -r bintray:scalacenter/releases -r sonatype:snapshots -o %s -f", coursier_exe, server_version, metals_bin)
vim.fn.system(install_cmd)
end
@@ -78,7 +84,7 @@ configs[server_name] = {
end;
docs = {
package_json = "https://raw.githubusercontent.com/scalameta/metals-vscode/master/package.json";
- description = [[
+ description = [[
https://scalameta.org/metals/
To target a specific version on Metals, set the following.
@@ -96,6 +102,5 @@ Scala language server with rich IDE features.
};
};
-configs[server_name].install = installer.install
+configs[server_name].install = installer.install
configs[server_name].install_info = installer.info
--- vim:et ts=2 sw=2