Comments (11)
cmp_nvim_lsp.update_capabilities is deprecated #36
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
↓↓↓
local capabilities = require("cmp_nvim_lsp").default_capabilities()
from cmp-nvim-lsp.
I love having random breaking changes for no reason at all
from cmp-nvim-lsp.
I think a big part of the benefit of an announcements thread like this is being able to subscribe and hear when you need to look into changes. If it turns into a support thread, fewer people will subscribe and get that valuable information. May I suggest that the thread be locked so that only contributors can post changes, and other questions or problems be raised in new issues? Similar to the pinned nvim-cmp issue that was linked above.
from cmp-nvim-lsp.
I would suggest, one should actually do in your config like:
local capabilities = vim.tbl_deep_extend("force",
vim.lsp.protocol.make_client_capabilities(),
require('cmp_nvim_lsp').default_capabilities()
)
This will be a more general approach. No need to rely on the implementation detail that cmp_nvim_lsp.default_capabilities()
will return a single-field table textDocument = { completion = ... }
.
Explanation: cmp_nvim_lsp.default_capabilities(capablities)
does not "extend" capabilities
; it just returns a table that is needed by cmp_nvim_lsp. So any existing fields in capabilities
will be lost as @cdimitroulas said. This is because why one would need to merge tables with tbl_deep_extend
.
vim.lsp.protocol.make_client_capabilities().textDocument.completion
-- As of neovim 0.10 nightly
{
completionItem = {
commitCharactersSupport = false,
deprecatedSupport = false,
documentationFormat = { "markdown", "plaintext" },
preselectSupport = false,
snippetSupport = false
},
completionItemKind = {
valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }
},
contextSupport = false,
dynamicRegistration = false
}
require('cmp_nvim_lsp').default_capabilities()
{
textDocument = {
completion = {
completionItem = {
commitCharactersSupport = true,
deprecatedSupport = true,
insertReplaceSupport = true,
insertTextModeSupport = {
valueSet = { 1, 2 }
},
labelDetailsSupport = true,
preselectSupport = true,
resolveSupport = {
properties = { "documentation", "detail", "additionalTextEdits", "sortText", "filterText", "insertText", "textEdit", "insertTextF
ormat", "insertTextMode" }
},
snippetSupport = true,
tagSupport = {
valueSet = { 1 }
}
},
completionList = {
itemDefaults = { "commitCharacters", "editRange", "insertTextFormat", "insertTextMode", "data" }
},
contextSupport = true,
dynamicRegistration = false,
insertTextMode = 1
}
}
}
from cmp-nvim-lsp.
cmp_nvim_lsp.update_capabilities is deprecated #36
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())↓↓↓
local capabilities = require("cmp_nvim_lsp").default_capabilities()
This worked for me and removed the warning
from cmp-nvim-lsp.
cmp_nvim_lsp.update_capabilities is deprecated #36
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())↓↓↓
local capabilities = require("cmp_nvim_lsp").default_capabilities()
This solution doesn't work for me. It provides an incomplete list of capabilities which causes problems with some LSPs like tsserver.
This works better:
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion = require('cmp_nvim_lsp').default_capabilities().textDocument.completion
from cmp-nvim-lsp.
local capabilities = vim.tbl_deep_extend("force", vim.lsp.protocol.make_client_capabilities(), require('cmp_nvim_lsp').default_capabilities() )
When I do this the lua lsp complains about setting capabilities.offsetEncoding
:
Lua Diagnostics.: Fields cannot be injected into the reference of `lsp.ClientCapabilities` for `offsetEncoding`. To do so, use `---@class` for `capabilities`. [inject-field]
from cmp-nvim-lsp.
this still seems breaking the cmp
from cmp-nvim-lsp.
this still seems breaking the cmp
I don't have any issue on 0.8.
from cmp-nvim-lsp.
i just upgrade to 0.8 this seem to break all my typescript lsp lol
from cmp-nvim-lsp.
After upgrading today to the latest Neovim version (v0.9.0-dev nightly), and the latest plugins (managed by packer.nvim
), including to the latest cmp-nvim-lsp
version; and after changing update_capabilities
to default_capabilities
, my TypeScript completions stopped working. I noticed that this only happened when the Neovim filetype
was set to typescriptreact
, file extension .tsx
. If the filetype
was set to typescript
, file extension .ts
, then things seemed to work as normal. I realized that I had only specified require('cmp').setup.filetype("typescript", ...)
in my Neovim config. That used to work for typescriptreact
files, but stopped for some reason. After I added a new line with require('cmp').setup.filetype("typescriptreact", ...)
, my completions started working again.
from cmp-nvim-lsp.
Related Issues (20)
- Filter some suggestions provided by cmp-nvim-lsp HOT 1
- Cause lags / delay with Telescope & UI
- Hide warning and error show on editor HOT 3
- LSP suggestions don't appear in certain files, although LS loaded
- migrate to Lazy.nvim and module 'cmp_nvim_lsp' not found HOT 1
- Filter out suggestion based on current typing characters HOT 1
- Error thrown when using omnicompletion HOT 1
- How to show "Auto import from ..." in the documentation window?
- Won't send more requests if **one** character no completions. HOT 7
- lsp completion items not updating unless I restart the server HOT 7
- `#` symbol doesn't start the cmp menu in a CSS property
- Option to exclude a client completely
- How to install cmp-nvim-lsp HOT 2
- Use of after directory, antipattern.
- entry_filter has no effect
- Confirmation behavior `Insert` does not work
- HTML & CSS LSP Autocompletion isn't working
- Can't stop suggestion box from closing when entering whitespace
- cmp_nvim_lsp not found HOT 3
- Disable JSX snippets HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmp-nvim-lsp.