From e81f31dd9d2fd12dc6442df900513b78d67d5099 Mon Sep 17 00:00:00 2001 From: klooj <57016271+klooj@users.noreply.github.com> Date: Mon, 8 Feb 2021 00:53:47 -0500 Subject: [PATCH 1/3] correct name and case for macOS I didn't test this yet, but the sumneko bin folder for Macs is "macos" and jit.os() returns OSX. For case-sensitivity linux situations, this also corrects the output of jit.os() to match the sumneko name. --- lua/nlua/lsp/nvim.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/nlua/lsp/nvim.lua b/lua/nlua/lsp/nvim.lua index 0925c7d..d5e0aad 100644 --- a/lua/nlua/lsp/nvim.lua +++ b/lua/nlua/lsp/nvim.lua @@ -1,5 +1,12 @@ local cache_location = vim.fn.stdpath('cache') -local bin_folder = jit.os +local bin_folder = function() + local sumneko_label = jit.os:lower() + if sumneko_label == 'osx' then + return 'macos' + else + return sumneko_label + end +end local nlua_nvim_lsp = { base_directory = string.format( @@ -10,7 +17,7 @@ local nlua_nvim_lsp = { bin_location = string.format( "%s/nlua/sumneko_lua/lua-language-server/bin/%s/lua-language-server", cache_location, - bin_folder + bin_folder() ), } From d6f62cb6eb065c6b3bddcbc672c0dd31d530555a Mon Sep 17 00:00:00 2001 From: klooj <57016271+klooj@users.noreply.github.com> Date: Mon, 8 Feb 2021 13:44:01 -0500 Subject: [PATCH 2/3] Update nvim.lua --- lua/nlua/lsp/nvim.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/nlua/lsp/nvim.lua b/lua/nlua/lsp/nvim.lua index d5e0aad..d7a0925 100644 --- a/lua/nlua/lsp/nvim.lua +++ b/lua/nlua/lsp/nvim.lua @@ -1,8 +1,8 @@ local cache_location = vim.fn.stdpath('cache') local bin_folder = function() - local sumneko_label = jit.os:lower() - if sumneko_label == 'osx' then - return 'macos' + local sumneko_label = jit.os() + if sumneko_label == 'OSX' then + return 'macOS' else return sumneko_label end From 1ae5e3f0193527672c659987319bf7c475d1361c Mon Sep 17 00:00:00 2001 From: klooj <57016271+klooj@users.noreply.github.com> Date: Mon, 8 Feb 2021 14:29:35 -0500 Subject: [PATCH 3/3] Update nvim.lua --- lua/nlua/lsp/nvim.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nlua/lsp/nvim.lua b/lua/nlua/lsp/nvim.lua index d7a0925..5e38f0e 100644 --- a/lua/nlua/lsp/nvim.lua +++ b/lua/nlua/lsp/nvim.lua @@ -1,6 +1,6 @@ local cache_location = vim.fn.stdpath('cache') local bin_folder = function() - local sumneko_label = jit.os() + local sumneko_label = jit.os if sumneko_label == 'OSX' then return 'macOS' else