Open adriweb opened 5 years ago
Would anyway be a nice feature to suppress or have an option to suppress LuaDoc errors in the PROBLEMS pane in VS Code. It is very "noisy" when you need to work with a LUA file that already is tagged with lua doc directives.
This would be great
Not an issue but a feature suggestion:
As we can see in https://github.com/EmmyLua/IntelliJ-EmmyLua/blob/68e6d6e/src/main/resources/std/Lua51/table.lua#L22-L24 it's possible to annotate optional parameters with the
@overload
annotation (BTW, it's not mentioned in the docs, only in the changelogs).The issue is that it's not possible to indicate if such optional parameters have a default value. This is actually very useful when reading code (and writing, with autocompletion...) so that we don't have to actually go look at the source of said function.
LDoc handles that with
-- @tparam[opt="MyDefaultStringValue"] string fooVar the name of my foo
.Could we have something like this in EmmyLua?
What about supporting
name:type=value
in the syntax, like the following:This was an all-at-once definition, but we could also imagine supporting one-by-one, like closer to the current impl. However in Lua it's totally possible to have a default argument not only at the end, the function itself would just check if the value of the nth arg is nil (and give it the default value) while the nth+1 one could be non-nil... So I'd prefer writing docs in the former fashion rather than the following one:
As you can see, this one is quite verbose and basically quite uselessly too long, compared to the "all-at-once" syntax proposal.