refactor(lsp)!: move servers to lspconfig plugin spec
This commit is contained in:
2 files changed
+17
-29
No files matched your search
@@ -11,7 +11,21 @@ return {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
---@type lspconfig.options
|
||||
servers = nil,
|
||||
servers = {
|
||||
jsonls = {},
|
||||
sumneko_lua = {
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(plugin)
|
||||
-- setup formatting and keymaps
|
||||
require("lazyvim.util").on_attach(function(client, buffer)
|
||||
@@ -31,8 +45,8 @@ return {
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
-- lspconfig
|
||||
local servers = plugin.servers or require("lazyvim.plugins.lsp.servers")
|
||||
---@type lspconfig.options
|
||||
local servers = plugin.servers or {}
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
require("mason-lspconfig").setup({ ensure_installed = vim.tbl_keys(servers) })
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
-- Add any servers here together with their settings
|
||||
---@type lspconfig.options
|
||||
local servers = {
|
||||
bashls = {},
|
||||
clangd = {},
|
||||
cssls = {},
|
||||
tsserver = {},
|
||||
html = {},
|
||||
jsonls = {},
|
||||
pyright = {},
|
||||
yamlls = {},
|
||||
sumneko_lua = {
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return servers
|
||||
Reference in new issue
Block a user