issue #256 do not load mason when false 🎄🎆

pull/268/head
ray-x 1 year ago
parent 5a289ac77d
commit a513485311

@ -377,18 +377,19 @@ local function lsp_startup(ft, retry, user_lsp_opts)
end end
return false return false
end end
if _NgConfigValues.mason then
has_mason, _ = pcall(require, 'mason-lspconfig') has_mason, _ = pcall(require, 'mason-lspconfig')
if has_mason then if has_mason then
local srvs=require'mason-lspconfig'.get_installed_servers() local srvs=require'mason-lspconfig'.get_installed_servers()
if #srvs > 0 then if #srvs > 0 then
lsp_mason_servers = srvs lsp_mason_servers = srvs
end
end end
end end
log("lsp mason:", lsp_mason_servers) log("lsp mason:", lsp_mason_servers)
if has_mason and _NgConfigValues.mason and not mason_disabled_for(lspconfig[lspclient].name) then if has_mason and not mason_disabled_for(lspconfig[lspclient].name) then
local servers = require'mason-lspconfig'.get_installed_servers() local mason_servers = require'mason-lspconfig'.get_installed_servers()
if not vim.tbl_contains(servers, lspconfig[lspclient].name) then if not vim.tbl_contains(mason_servers, lspconfig[lspclient].name) then
log('mason server not installed', lspconfig[lspclient].name) log('mason server not installed', lspconfig[lspclient].name)
-- return -- return
end end

Loading…
Cancel
Save