where is the on_server_ready
?
#40
-
Try to migrate from installer. My old codes are: require('nvim-lsp-installer').on_server_ready(
function (server)
local has_config, config = pcall(require, 'lsp_config.'..server.name)
if not has_config then
server:setup(require('lsp_config.default')) return end
server:setup(config)
end
) how should I do the same using mason? |
Beta Was this translation helpful? Give feedback.
Answered by
williamboman
Jul 10, 2022
Replies: 1 comment 8 replies
-
Hello! The require("mason").setup()
require("mason-lspconfig").setup()
-- the above is enough, but if you want to replicate the "on_server_ready" behaviour
-- where your installed servers are setup "automatically" you can do the following
require("mason-lspconfig").setup_handlers {
-- default handler - setup with default settings
function (server_name)
lspconfig[server_name].setup {}
end,
-- you can override the default handler by providing custom handlers per server
["jdtls"] = function ()
// do something with the nvim-jdtls plugin instead
end
} Note that the |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
williamboman
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello! The
on_server_ready
function was deprecated a while back, mostly due to how it wrapped lspconfig and was causing confusion. There is a similar alternative in themason-lspconfig
extension (to be documented), try this: