-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about default_capabilities #44
Comments
Following. I'm also not sure how to migrate properly, because before the breaking change, I was using
|
I just followed what was commented on #38 (comment) |
#42 (comment) looks like better advice. The suggestion at the previous comment - and currently in the README - goes wrong exactly as this issue reports: it throws away all the capabilities declared by the the core neovim client. |
After some research I can confirm that this works at the moment. Extending the default capabilities with the specified new capabilities. local lsp = require("lspconfig")
lsp.util.default_config = vim.tbl_deep_extend("force", lsp.util.default_config, {
capabilities = require("cmp_nvim_lsp").default_capabilities(),
}) But hrsh7th/nvim-cmp#1265 is open, I think it also needs documentation in README as well. |
Using `require('cmp_nvim_lsp').default_capabilities()` alone will be not enough. We have to merge with the default LSP capabilities producced by `vim.lsp.protocol.make_client_capabilities()`. See hrsh7th#42 and hrsh7th#44.
I don't think this is a problem. nvim-lspconfig internally performs |
This seems like the closes issue to the root cause of a problem I've spent a day and night chasing down. The symptom was rust-analyzer hanging for a long time at the startup in a large directory, saying "Roots Scanned". At the same time Not sure of the specific interaction of plugins, but using In my case, the key setting was As far as I can tell, the default is local lspconfig = require("lspconfig")
local mason_lspconfig = require("mason-lspconfig")
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local capabilities = cmp_nvim_lsp.default_capabilities()
mason_lspconfig.setup_handlers({
function(server_name)
lspconfig[server_name].setup({
capabilities = capabilities,
})
end,
}) it ends up being set to local capabilities = cmp_nvim_lsp.default_capabilities()
capabilities.workspace = { didChangeWatchedFiles = { dynamicRegistration = true } } -- <- addded line Not sure if This is as far as I got, being new to neovim, I'm not sure how to trace and debug the configuration values for definitive proof, but hopefully it helps. |
Ah, upon further investigation, default for |
RA hangs for a long time on "Roots scanned" Ref: hrsh7th/cmp-nvim-lsp#44 (comment)
Previous merge was not needed, see hrsh7th/cmp-nvim-lsp#44 (comment)
Hello 👋 Just upgraded my setup and found the change about client capabilities.
All examples look like this:
Doesn't that mean that I not consider all other capabilities, that nvim has?
Maybe something like this would be better:
The text was updated successfully, but these errors were encountered: