mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
vim-patch:9.1.0547: No way to get the arity of a Vim function (#29638)
Problem: No way to get the arity of a Vim function
(Austin Ziegler)
Solution: Enhance get() Vim script function to return the function
argument info using get(func, "arity") (LemonBoy)
fixes: vim/vim#15097
closes: vim/vim#15109
48b7d05a4f
Co-authored-by: LemonBoy <thatlemon@gmail.com>
This commit is contained in:
23
runtime/lua/vim/_meta/vimfn.lua
generated
23
runtime/lua/vim/_meta/vimfn.lua
generated
@@ -2523,12 +2523,25 @@ function vim.fn.get(blob, idx, default) end
|
||||
--- @return any
|
||||
function vim.fn.get(dict, key, default) end
|
||||
|
||||
--- Get item {what} from Funcref {func}. Possible values for
|
||||
--- Get item {what} from |Funcref| {func}. Possible values for
|
||||
--- {what} are:
|
||||
--- "name" The function name
|
||||
--- "func" The function
|
||||
--- "dict" The dictionary
|
||||
--- "args" The list with arguments
|
||||
--- "name" The function name
|
||||
--- "func" The function
|
||||
--- "dict" The dictionary
|
||||
--- "args" The list with arguments
|
||||
--- "arity" A dictionary with information about the number of
|
||||
--- arguments accepted by the function (minus the
|
||||
--- {arglist}) with the following fields:
|
||||
--- required the number of positional arguments
|
||||
--- optional the number of optional arguments,
|
||||
--- in addition to the required ones
|
||||
--- varargs |TRUE| if the function accepts a
|
||||
--- variable number of arguments |...|
|
||||
---
|
||||
--- Note: There is no error, if the {arglist} of
|
||||
--- the Funcref contains more arguments than the
|
||||
--- Funcref expects, it's not validated.
|
||||
---
|
||||
--- Returns zero on error.
|
||||
---
|
||||
--- @param func function
|
||||
|
||||
Reference in New Issue
Block a user