Add deprecation notice

This commit is contained in:
hrsh7th
2022-04-13 23:58:50 +09:00
parent fae808a2bc
commit 4f1358e659

View File

@@ -154,7 +154,7 @@ config.is_native_menu = function()
end end
---Normalize mapping key ---Normalize mapping key
---@param c cmp.ConfigSchema ---@param c any
---@return cmp.ConfigSchema ---@return cmp.ConfigSchema
config.normalize = function(c) config.normalize = function(c)
-- make sure c is not 'nil' -- make sure c is not 'nil'
@@ -184,6 +184,20 @@ config.normalize = function(c)
c.view.entries = c.view.entries or 'native' c.view.entries = c.view.entries or 'native'
end end
-- Notice documentation.
if c.documentation ~= nil then
vim.api.nvim_echo({
{ '[nvim-cmp] ', 'Normal' },
{ 'documentation', 'WarningMsg' },
{ ' is deprecated.\n', 'Normal' },
{ '[nvim-cmp] Please use ', 'Normal' },
{ 'window.documentation= "native"', 'WarningMsg' },
{ ' instead.', 'Normal' },
}, true, {})
c.window = c.window or {}
c.window.documentation = c.documentation
end
-- Notice sources.[n].opts -- Notice sources.[n].opts
if c.sources then if c.sources then
for _, s in ipairs(c.sources) do for _, s in ipairs(c.sources) do