Skip to content

return vararg #773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lua-rocks opened this issue Oct 30, 2021 · 1 comment
Closed

return vararg #773

lua-rocks opened this issue Oct 30, 2021 · 1 comment
Labels
enhancement New feature or request feat/LuaCats Annotations Related to Lua Language Server Annotations (LuaCats)

Comments

@lua-rocks
Copy link

lua-rocks commented Oct 30, 2021

It looks like no possible to describe type of returned vararg

When I'm trying to do it editor highlight this type in orange color:

screenshot

Looks like the orange color represents optional name of the returned variable.
Probably the most simple solution to this problem would be to check - if the name is "...", then it is vararg.

Like this:

screenshot

And in my opinion, we don't need the @vararg tag at all. It would be simplier to use ---@param ... instead.

Sorry for oftopic, just want to share one last thought - I believe that decreasing number of ---@ tags when possible is always good idea, especially combining similar functionality. So I also think that we actually no need ---@field tag too!
Would be better to use ---@param tag for both - table fields and function arguments.

Thank you for taking the time to read this! 😺

@sumneko sumneko added feat/LuaCats Annotations Related to Lua Language Server Annotations (LuaCats) enhancement New feature or request labels Nov 1, 2021
@sumneko
Copy link
Collaborator

sumneko commented Jun 15, 2022

Discuss in #1207

@sumneko sumneko closed this as completed Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feat/LuaCats Annotations Related to Lua Language Server Annotations (LuaCats)
Projects
None yet
Development

No branches or pull requests

2 participants