How do I enable blink.cmp lsp capabilities while using lsp-zero? #419
Answered
by
VonHeikemen
allengueco
asked this question in
Q&A
-
When using blink.cmp instead of nvim-cmp, they suggest doing something like this: {
'neovim/nvim-lspconfig',
dependencies = { 'saghen/blink.cmp' },
config = function(_, opts)
local lspconfig = require('lspconfig')
for server, config in pairs(opts.servers) do
config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
lspconfig[server].setup(config)
end
end
} How would I do this in lsp-zero? |
Beta Was this translation helpful? Give feedback.
Answered by
VonHeikemen
Nov 1, 2024
Replies: 1 comment 2 replies
-
In this case you just do it. Since To use Option 1: add capabilities manually. Get the local lsp_capabilities = require('blink.cmp').get_lsp_capabilities()
--- these are just example language servers
--- replace them with the ones you actually have installed
require('lspconfig').gleam.setup({
capabilities = lsp_capabilities,
})
require('lspconfig').gopls.setup({
capabilities = lsp_capabilities,
}) Option 2: add the capabilities to -- Add blink.cmp capabilities settings to lspconfig
-- This should be executed before you configure any language server
local lspconfig_defaults = require('lspconfig').util.default_config
lspconfig_defaults.capabilities = vim.tbl_deep_extend(
'force',
lspconfig_defaults.capabilities,
require('blink.cmp').get_lsp_capabilities()
) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
allengueco
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this case you just do it. Since
version 4
lsp-zero doesn't have any effect on the plugins you use. You don't integrate plugins with lsp-zero anymore.To use
blink.cmp
withlspconfig
there are a couple of options:Option 1: add capabilities manually.
Get the
capabilities
fromblink.cmp
and put them in the setup of each language server.Op…