diff --git a/lua/cmp/config.lua b/lua/cmp/config.lua index 12f3211..ed1034f 100644 --- a/lua/cmp/config.lua +++ b/lua/cmp/config.lua @@ -154,7 +154,7 @@ config.is_native_menu = function() end ---Normalize mapping key ----@param c cmp.ConfigSchema +---@param c any ---@return cmp.ConfigSchema config.normalize = function(c) -- make sure c is not 'nil' @@ -184,6 +184,20 @@ config.normalize = function(c) c.view.entries = c.view.entries or 'native' 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 if c.sources then for _, s in ipairs(c.sources) do