mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-12-25 12:14:19 +01:00
fix(lsp): properly register capabilities with new vim.lsp.config. Not needed for blink
This commit is contained in:
@@ -25,6 +25,9 @@ return {
|
||||
-- }
|
||||
-- ```
|
||||
opts = function()
|
||||
-- Register nvim-cmp lsp capabilities
|
||||
vim.lsp.config("*", { capabilities = require("cmp_nvim_lsp").default_capabilities() })
|
||||
|
||||
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
||||
local cmp = require("cmp")
|
||||
local defaults = require("cmp.config.default")()
|
||||
|
||||
@@ -63,7 +63,7 @@ return {
|
||||
timeout_ms = nil,
|
||||
},
|
||||
-- LSP Server Settings
|
||||
---@type table<string, vim.lsp.Config>
|
||||
---@type table<string, vim.lsp.Config|{mason?:boolean, enabled?:boolean}|boolean>
|
||||
servers = {
|
||||
lua_ls = {
|
||||
-- mason = false, -- set to false if you don't want this server to be installed with mason
|
||||
@@ -163,14 +163,9 @@ return {
|
||||
end
|
||||
vim.diagnostic.config(vim.deepcopy(opts.diagnostics))
|
||||
|
||||
local capabilities = vim.tbl_deep_extend(
|
||||
"force",
|
||||
{},
|
||||
vim.lsp.protocol.make_client_capabilities(),
|
||||
LazyVim.has("nvim-cmp") and require("cmp_nvim_lsp").default_capabilities() or {},
|
||||
LazyVim.has("blink.nvim") and require("blink.cmp").get_lsp_capabilities() or {},
|
||||
opts.capabilities or {}
|
||||
)
|
||||
if opts.capabilities then
|
||||
vim.lsp.config("*", { capabilities = opts.capabilities })
|
||||
end
|
||||
|
||||
-- get all the servers that are available through mason-lspconfig
|
||||
local have_mason = LazyVim.has("mason-lspconfig.nvim")
|
||||
@@ -181,9 +176,7 @@ return {
|
||||
local exclude_automatic_enable = {} ---@type string[]
|
||||
|
||||
local function configure(server)
|
||||
local server_opts = vim.tbl_deep_extend("force", {
|
||||
capabilities = vim.deepcopy(capabilities),
|
||||
}, opts.servers[server] or {})
|
||||
local server_opts = opts.servers[server] or {}
|
||||
|
||||
local setup = opts.setup[server] or opts.setup["*"]
|
||||
if setup and setup(server, server_opts) then
|
||||
|
||||
Reference in New Issue
Block a user