custom on_server_ready server:setup #9
Answered
by
VonHeikemen
Lite5h4dow
asked this question in
Q&A
-
hi, im trying to run a custom server:setup function would lsp zero stop that in the reccommended setup? --lsp zero
local lsp=require('lsp-zero')
lsp.preset("recommended")
lsp.nvim_workspace()
lsp.setup()
-- lsp install
local lsp_installer = require("nvim-lsp-installer")
lsp_installer.settings({
install_root_dir = string.gsub((vim.fn.system("echo $HOME") .. "/.config/nvim/.lsp_servers"), "\n", "")
})
lsp_installer.on_server_ready(function(server)
local opts={
on_attach = require("lsp.handlers").on_attach,
capabilities = require("lsp.handlers").capabilities
}
local opts_exist, server_opts = pcall(require, "lsp.settings.".. server.name)
if opts_exist then
opts = vim.tbl_deep_extend("force", server_opts, opts)
end
server:setup(opts)
end |
Beta Was this translation helpful? Give feedback.
Answered by
VonHeikemen
Apr 14, 2022
Replies: 1 comment
-
The Change the preset from |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Lite5h4dow
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
recommended
preset already uses.on_server_ready
, so weird things are going to happen if you do that.Change the preset from
recommended
tomanual-setup
.