Is the "merging LSP capabilities" config step necessary on nvim 0.11? #1802
|
As per the title, I can't really understand from the docs whether this step is necessary on neovim 0.11. I see the previous step is not, but can't tell for this one. |
Replies: 2 comments 2 replies
|
Hi @baggiponte, Regarding "merging LSP capabilities," I don't think it's directly related to the Neovim version (including 0.11). Rather, this process is about how you want to configure or extend your LSP client capabilities. It's not strictly required—it's more about activating or customizing certain features according to your needs. The section titled "Merging LSP capabilities" basically refers to how you can reassign or extend a variable like capabilities. For example, you can start with your own capabilities table and then merge it with the capabilities provided by blink.cmp (or any other plugin). This is commonly done like this: local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('blink.cmp').get_lsp_capabilities(capabilities)or using local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = vim.tbl_deep_extend('force', capabilities, require('blink.cmp').get_lsp_capabilities({}, false))You can also modify it like this to add your own features (for example, foldingRange): local capabilities = require('blink.cmp').get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
capabilities = vim.tbl_deep_extend('force', capabilities, {
textDocument = {
foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true
}
}
})
This merging step allows you to include the features you want, such as foldingRange, but it’s not mandatory unless you specifically need those features. So, it’s more about how you want to customize your LSP client, not something required by Neovim 0.11 itself. If you want to enable certain features, you can merge or extend the capabilities as shown, but if you don’t need them, you can skip this step. |
|
If you're using the new |
If you're using the new
vim.lsp.configAPI, you no longer need to merge the capabilities through the method described. You can instead set your capabilities invim.lsp.configand they'll override the defaults that blink.cmp sets automatically.