IntelliJ-EmmyLua
IntelliJ-EmmyLua copied to clipboard
[FR] Optional variable args type
I've skipped the template because I dont use IntelliJ but since this is the main repo for EmmyLua, as I understand it, any feature requests should go here since rest of the forks and ports will pick it up from upstream.
Description
Right now EL offers typehint @varags that only allows you to specify one type for it and mostly intended to be used in tandem with return values. I have a C binding that accepts optional arguments in a form like (string, string = default, bool = default) and there is no way for me to use a typehint that allows to specify multiple bool | string for kwargs
My proposal is to add @optional that looks for ... in the associative index and allows you to define a multiple input types a-la
---@param ... optional string,bool,number
the vscode plugin lua-language-server support ---@param fff? number Other requirements can also be mentioned to the author。
@CppCXY
---@param fff? number
Where is the documentation for that?
Also:
Does not work, it ignores fff?
I had the same issue. Then reading the annotation docs found the @overload which worked great for me.
