aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/installers/npm.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-09-07 02:44:09 +0200
committerGitHub <noreply@github.com>2021-09-07 02:44:09 +0200
commit00294b84031711013a385f18c0fb0e8db84ebaf9 (patch)
treee45de668229c6b41643c5d1fa0fdb5beb0ff60fa /lua/nvim-lsp-installer/installers/npm.lua
parentlazily require servers for faster startup times (#77) (diff)
downloadmason-00294b84031711013a385f18c0fb0e8db84ebaf9.tar
mason-00294b84031711013a385f18c0fb0e8db84ebaf9.tar.gz
mason-00294b84031711013a385f18c0fb0e8db84ebaf9.tar.bz2
mason-00294b84031711013a385f18c0fb0e8db84ebaf9.tar.lz
mason-00294b84031711013a385f18c0fb0e8db84ebaf9.tar.xz
mason-00294b84031711013a385f18c0fb0e8db84ebaf9.tar.zst
mason-00294b84031711013a385f18c0fb0e8db84ebaf9.zip
add direct integration with libuv instead of going through termopen, also implement a UI (#79)
* add direct integration with libuv instead of going through termopen, also implement a UI * alleged free perf boosts yo that's free cycles
Diffstat (limited to 'lua/nvim-lsp-installer/installers/npm.lua')
-rw-r--r--lua/nvim-lsp-installer/installers/npm.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/lua/nvim-lsp-installer/installers/npm.lua b/lua/nvim-lsp-installer/installers/npm.lua
index 6b6b820e..d3c8167f 100644
--- a/lua/nvim-lsp-installer/installers/npm.lua
+++ b/lua/nvim-lsp-installer/installers/npm.lua
@@ -1,11 +1,17 @@
local path = require "nvim-lsp-installer.path"
local platform = require "nvim-lsp-installer.platform"
-local shell = require "nvim-lsp-installer.installers.shell"
+local process = require "nvim-lsp-installer.process"
local M = {}
function M.packages(packages)
- return shell.polyshell(("npm install %s"):format(table.concat(packages, " ")))
+ return function(server, callback, context)
+ process.spawn(platform.is_win() and "npm.cmd" or "npm", {
+ args = vim.list_extend({ "install" }, packages),
+ cwd = server.root_dir,
+ stdio_sink = context.stdio_sink,
+ }, callback)
+ end
end
function M.executable(root_dir, executable)