Skip to content

Commit

Permalink
refactor(lsp)!: move servers to lspconfig plugin spec
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 7, 2023
1 parent 8f78270 commit ef78153
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
20 changes: 17 additions & 3 deletions lua/lazyvim/plugins/lsp/init.lua
Expand Up @@ -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)
Expand All @@ -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) })
Expand Down
26 changes: 0 additions & 26 deletions lua/lazyvim/plugins/lsp/servers.lua

This file was deleted.

0 comments on commit ef78153

Please sign in to comment.