mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-22 00:49:01 +02:00
enc: move lsp config to auto-lsp.nvim
This commit is contained in:
parent
5f766a5717
commit
c09e320633
22 changed files with 253 additions and 293 deletions
|
@ -1,34 +1,34 @@
|
|||
local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- local servers = { "jsonls", "sumneko_lua","html","cssls","tsserver"}
|
||||
-- local servers = { "jdtls", "yamlls" }
|
||||
local servers = {}
|
||||
local installer = pcode.lsp_installer or {}
|
||||
for _, client in pairs(installer) do
|
||||
table.insert(servers, client)
|
||||
end
|
||||
|
||||
lsp_installer.setup({
|
||||
ensure_installed = servers,
|
||||
})
|
||||
|
||||
for _, server in pairs(servers) do
|
||||
local opts = {
|
||||
on_attach = require("user.lsp.handlers").on_attach,
|
||||
capabilities = require("user.lsp.handlers").capabilities,
|
||||
}
|
||||
local has_custom_opts, server_custom_opts = pcall(require, "user.lsp.settings." .. server)
|
||||
if has_custom_opts then
|
||||
opts = vim.tbl_deep_extend("force", opts, server_custom_opts)
|
||||
end
|
||||
lspconfig[server].setup(opts)
|
||||
end
|
||||
|
||||
-- lspconfig.yamlls.setup({
|
||||
-- fletype = { "yaml", "yaml.docker-compose" },
|
||||
-- local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer")
|
||||
-- if not status_ok then
|
||||
-- return
|
||||
-- end
|
||||
--
|
||||
-- local lspconfig = require("lspconfig")
|
||||
--
|
||||
-- -- local servers = { "jsonls", "sumneko_lua","html","cssls","tsserver"}
|
||||
-- -- local servers = { "jdtls", "yamlls" }
|
||||
-- local servers = {}
|
||||
-- local installer = pcode.lsp_installer or {}
|
||||
-- for _, client in pairs(installer) do
|
||||
-- table.insert(servers, client)
|
||||
-- end
|
||||
--
|
||||
-- lsp_installer.setup({
|
||||
-- ensure_installed = servers,
|
||||
-- })
|
||||
--
|
||||
-- for _, server in pairs(servers) do
|
||||
-- local opts = {
|
||||
-- on_attach = require("user.lsp.handlers").on_attach,
|
||||
-- capabilities = require("user.lsp.handlers").capabilities,
|
||||
-- }
|
||||
-- local has_custom_opts, server_custom_opts = pcall(require, "user.lsp.settings." .. server)
|
||||
-- if has_custom_opts then
|
||||
-- opts = vim.tbl_deep_extend("force", opts, server_custom_opts)
|
||||
-- end
|
||||
-- lspconfig[server].setup(opts)
|
||||
-- end
|
||||
--
|
||||
-- -- lspconfig.yamlls.setup({
|
||||
-- -- fletype = { "yaml", "yaml.docker-compose" },
|
||||
-- -- })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue