diff options
Diffstat (limited to 'lua/pi/lsp/mason.lua')
| -rw-r--r-- | lua/pi/lsp/mason.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lua/pi/lsp/mason.lua b/lua/pi/lsp/mason.lua new file mode 100644 index 0000000..91d0c2b --- /dev/null +++ b/lua/pi/lsp/mason.lua @@ -0,0 +1,23 @@ +local mason_lspconfig = require "mason-lspconfig" +local servers = require "pi.lsp.servers" +local lspconfig = require "lspconfig" + +local mason_servers = {} + +for server, _ in pairs(servers) do + local cmd = lspconfig[server].cmd[1] + if vim.fn.executable(cmd) == 0 then + table.insert(mason_servers, server) + end +end + +mason_lspconfig.setup { + -- ensure_installed = mason_servers, +} + +-- filter the list for the ones not globally installed +-- require("mason-tool-installer").setup { +-- ensure_installed = vim.tbl_filter(function (tool) +-- return vim.fn.executable(tool) == 0 +-- end, require "pi.lsp.tools"), +-- } |