From a2719a8723e503f1be89d9b1c334846de405eb23 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Wed, 1 Dec 2021 09:03:10 +0100 Subject: fix(npm): resolve the command correctly on windows --- lua/lspconfig/server_configurations/bashls.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lua/lspconfig/server_configurations/bashls.lua') diff --git a/lua/lspconfig/server_configurations/bashls.lua b/lua/lspconfig/server_configurations/bashls.lua index 6aa8780e..bae4318b 100644 --- a/lua/lspconfig/server_configurations/bashls.lua +++ b/lua/lspconfig/server_configurations/bashls.lua @@ -1,8 +1,15 @@ local util = require 'lspconfig.util' +local bin_name = 'bash-language-server' +local cmd = { bin_name, 'start' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, 'start' } +end + return { default_config = { - cmd = { 'bash-language-server', 'start' }, + cmd = cmd, cmd_env = { -- Prevent recursive scanning which will cause issues when opening a file -- directly in the home directory (e.g. ~/foo.sh). -- cgit v1.2.3-70-g09d2