mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-23 09:18:51 +02:00
refactor(lsp)!: move servers to lspconfig plugin spec
This commit is contained in:
parent
8f782709d8
commit
ef78153afa
2 changed files with 17 additions and 29 deletions
|
@ -11,7 +11,21 @@ return {
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
},
|
},
|
||||||
---@type lspconfig.options
|
---@type lspconfig.options
|
||||||
servers = nil,
|
servers = {
|
||||||
|
jsonls = {},
|
||||||
|
sumneko_lua = {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
},
|
||||||
|
completion = {
|
||||||
|
callSnippet = "Replace",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
config = function(plugin)
|
config = function(plugin)
|
||||||
-- setup formatting and keymaps
|
-- setup formatting and keymaps
|
||||||
require("lazyvim.util").on_attach(function(client, buffer)
|
require("lazyvim.util").on_attach(function(client, buffer)
|
||||||
|
@ -31,8 +45,8 @@ return {
|
||||||
severity_sort = true,
|
severity_sort = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- lspconfig
|
---@type lspconfig.options
|
||||||
local servers = plugin.servers or require("lazyvim.plugins.lsp.servers")
|
local servers = plugin.servers or {}
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
|
|
||||||
require("mason-lspconfig").setup({ ensure_installed = vim.tbl_keys(servers) })
|
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
|
|
Loading…
Add table
Add a link
Reference in a new issue