From a513485311fbacf3ae3a9f7301faf44da00d2c21 Mon Sep 17 00:00:00 2001 From: ray-x Date: Mon, 2 Jan 2023 20:50:17 +1100 Subject: [PATCH] =?UTF-8?q?issue=20#256=20do=20not=20load=20mason=20when?= =?UTF-8?q?=20false=20=F0=9F=8E=84=F0=9F=8E=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/navigator/lspclient/clients.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lua/navigator/lspclient/clients.lua b/lua/navigator/lspclient/clients.lua index 0d0d75d..f8e4a13 100644 --- a/lua/navigator/lspclient/clients.lua +++ b/lua/navigator/lspclient/clients.lua @@ -377,18 +377,19 @@ local function lsp_startup(ft, retry, user_lsp_opts) end return false end - - has_mason, _ = pcall(require, 'mason-lspconfig') - if has_mason then - local srvs=require'mason-lspconfig'.get_installed_servers() - if #srvs > 0 then - lsp_mason_servers = srvs + if _NgConfigValues.mason then + has_mason, _ = pcall(require, 'mason-lspconfig') + if has_mason then + local srvs=require'mason-lspconfig'.get_installed_servers() + if #srvs > 0 then + lsp_mason_servers = srvs + end end end log("lsp mason:", lsp_mason_servers) - if has_mason and _NgConfigValues.mason and not mason_disabled_for(lspconfig[lspclient].name) then - local servers = require'mason-lspconfig'.get_installed_servers() - if not vim.tbl_contains(servers, lspconfig[lspclient].name) then + if has_mason and not mason_disabled_for(lspconfig[lspclient].name) then + local mason_servers = require'mason-lspconfig'.get_installed_servers() + if not vim.tbl_contains(mason_servers, lspconfig[lspclient].name) then log('mason server not installed', lspconfig[lspclient].name) -- return end