Skip to content

Commit 4f1358e

Browse files
author
hrsh7th
committed
Add deprecation notice
1 parent fae808a commit 4f1358e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lua/cmp/config.lua

+15-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ config.is_native_menu = function()
154154
end
155155

156156
---Normalize mapping key
157-
---@param c cmp.ConfigSchema
157+
---@param c any
158158
---@return cmp.ConfigSchema
159159
config.normalize = function(c)
160160
-- make sure c is not 'nil'
@@ -184,6 +184,20 @@ config.normalize = function(c)
184184
c.view.entries = c.view.entries or 'native'
185185
end
186186

187+
-- Notice documentation.
188+
if c.documentation ~= nil then
189+
vim.api.nvim_echo({
190+
{ '[nvim-cmp] ', 'Normal' },
191+
{ 'documentation', 'WarningMsg' },
192+
{ ' is deprecated.\n', 'Normal' },
193+
{ '[nvim-cmp] Please use ', 'Normal' },
194+
{ 'window.documentation= "native"', 'WarningMsg' },
195+
{ ' instead.', 'Normal' },
196+
}, true, {})
197+
c.window = c.window or {}
198+
c.window.documentation = c.documentation
199+
end
200+
187201
-- Notice sources.[n].opts
188202
if c.sources then
189203
for _, s in ipairs(c.sources) do

0 commit comments

Comments
 (0)