feat(lua): vim.deprecate() #18320

This is primarily intended to act as documentation for the developer so
they know exactly when and what to remove. This will help prevent the
situation of deprecated code lingering for far too long as developers
don't have to worry if a function is safe to remove.
This commit is contained in:
dundargoc
2022-05-03 15:42:41 +02:00
committed by GitHub
parent 4fb48c5654
commit 73741e9486
3 changed files with 48 additions and 21 deletions

View File

@@ -1326,6 +1326,17 @@ defer_fn({fn}, {timeout}) *vim.defer_fn()*
Return: ~
timer luv timer object
deprecate({name}, {alternative}, {version}, {plugin}) *vim.deprecate()*
Display a deprecation notification to the user.
Parameters: ~
{name} string Deprecated function.
{alternative} string|nil Preferred alternative function.
{version} string Version in which the deprecated
function will be removed.
{plugin} string|nil Plugin name that the function
will be removed from. Defaults to "Nvim".
inspect({object}, {options}) *vim.inspect()*
Return a human-readable representation of the given object.