Closed aquinjay closed 1 year ago
I can't do any pushing here (first time ever trying to work on anyone else's repo). Seems like you will need something like this in the mason.lua file:
local status_ok, lsp_installer = pcall(require, "mason")
if not status_ok then
return
end
local status_ok, lsp_config= pcall(require, "mason-lspconfig")
if not status_ok then
return
end
lsp_installer.setup()
local lspconfig = require("lspconfig")
local servers = { "jsonls", "sumneko_lua", "pyright" }
lsp_config.setup({
ensure_installed = servers,
})
for _, server in pairs(servers) do
local opts = {
on_attach = require("lsp.handlers").on_attach,
capabilities = require("lsp.handlers").capabilities,
}
local has_custom_opts, server_custom_opts = pcall(require, "lsp.settings." .. server)
if has_custom_opts then
opts = vim.tbl_deep_extend("force", opts, server_custom_opts)
end
lspconfig[server].setup(opts)
end
Thanks for bringing this up. Should be fixed now.
Seems like the fix is causing messages to appear when you start up neovim. It says mason-lspconfig is automatically installing the specified servers in the mason file. Setting automatic_installation to false seems to fix it. There may be a better way to suppress those messages though.
On my machine, mason does not function because it is not being called by require. It seems that replacing user/lsp/mason.lua line 1 from "nvim-lsp-installer" to "mason" will fix the issue. It seems that "nvim-lsp-installer" should not be used at all since the repo is no longer maintained.Will look into how to make a pr tonight.