aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/installers
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-01-29 18:03:44 +0100
committerGitHub <noreply@github.com>2022-01-29 18:03:44 +0100
commitc2bde3911892a51323219f7cfc9bb50b49afd29f (patch)
tree3ff017cde60b4ada34351171b7e3c745acc340aa /lua/nvim-lsp-installer/installers
parentactions: simplify run-autogen workflow (diff)
downloadmason-c2bde3911892a51323219f7cfc9bb50b49afd29f.tar
mason-c2bde3911892a51323219f7cfc9bb50b49afd29f.tar.gz
mason-c2bde3911892a51323219f7cfc9bb50b49afd29f.tar.bz2
mason-c2bde3911892a51323219f7cfc9bb50b49afd29f.tar.lz
mason-c2bde3911892a51323219f7cfc9bb50b49afd29f.tar.xz
mason-c2bde3911892a51323219f7cfc9bb50b49afd29f.tar.zst
mason-c2bde3911892a51323219f7cfc9bb50b49afd29f.zip
add nickel_ls (#452)
Diffstat (limited to 'lua/nvim-lsp-installer/installers')
-rw-r--r--lua/nvim-lsp-installer/installers/cargo.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/installers/cargo.lua b/lua/nvim-lsp-installer/installers/cargo.lua
index fe48404e..c4f11854 100644
--- a/lua/nvim-lsp-installer/installers/cargo.lua
+++ b/lua/nvim-lsp-installer/installers/cargo.lua
@@ -21,8 +21,25 @@ function M.crate(crate, opts)
ctx.receipt:with_primary_source(ctx.receipt.cargo(crate))
process.spawn("cargo", {
+ args = args,
cwd = ctx.install_dir,
+ stdio_sink = ctx.stdio_sink,
+ }, callback)
+ end
+end
+
+---@param opts {path:string|nil}
+function M.install(opts)
+ ---@type ServerInstallerFunction
+ return function(_, callback, ctx)
+ opts = opts or {}
+ local args = { "install", "--root", "." }
+ if opts.path then
+ vim.list_extend(args, { "--path", opts.path })
+ end
+ process.spawn("cargo", {
args = args,
+ cwd = ctx.install_dir,
stdio_sink = ctx.stdio_sink,
}, callback)
end