From c425ab9f384ef643ea6a669b5f546ac186ab2dd1 Mon Sep 17 00:00:00 2001 From: William Boman Date: Thu, 11 Nov 2021 16:17:06 +0100 Subject: fsautocomplete: don't use shell as an intermediary (#258) --- .../servers/fsautocomplete/init.lua | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'lua') diff --git a/lua/nvim-lsp-installer/servers/fsautocomplete/init.lua b/lua/nvim-lsp-installer/servers/fsautocomplete/init.lua index 303ebec8..0b8176fb 100644 --- a/lua/nvim-lsp-installer/servers/fsautocomplete/init.lua +++ b/lua/nvim-lsp-installer/servers/fsautocomplete/init.lua @@ -1,7 +1,7 @@ local server = require "nvim-lsp-installer.server" local path = require "nvim-lsp-installer.path" +local process = require "nvim-lsp-installer.process" local std = require "nvim-lsp-installer.installers.std" -local shell = require "nvim-lsp-installer.installers.shell" return function(name, root_dir) return server.Server:new { @@ -11,9 +11,26 @@ return function(name, root_dir) homepage = "https://github.com/fsharp/FsAutoComplete", installer = { std.ensure_executables { - { "dotnet", "dotnet was not found in path." }, + { + "dotnet", + "dotnet was not found in path. Refer to https://dotnet.microsoft.com/download for installation instructions.", + }, }, - shell.polyshell [[dotnet tool update --tool-path . fsautocomplete]], + ---@type ServerInstallerFunction + function(_, callback, ctx) + process.spawn("dotnet", { + args = { "tool", "update", "--tool-path", ".", "fsautocomplete" }, + cwd = ctx.install_dir, + stdio_sink = ctx.stdio_sink, + }, function(success) + if not success then + ctx.stdio_sink.stderr "Failed to install fsautocomplete.\n" + callback(false) + else + callback(true) + end + end) + end, }, default_options = { cmd = { -- cgit v1.2.3-70-g09d2