-
Notifications
You must be signed in to change notification settings - Fork 2
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
Show return table fields #1
Comments
It's possible by adding a new But it's also useful to understand how to fix this in the original documentation from which this one is generated. Now we have a set of some patches, for which thank you, but how not to lose them after the update... |
Now it's possible by adding new classes to known_classes: config.known_classes = {
....
sys_info = {
system_name = 'string',
...
} And adding corresponding param_type_replacements: config.param_type_replacements = {
...
{
element_name = 'sys.get_sys_info'
original = 'table',
replacement = 'sys_info',
}
} |
Nice looks good! I will try to get my issues sorted in the Defold repo first from now on 👍 Is the only reason items will be in |
Using But using Now the structure of the return table is written in the function description as plain text. Somewhere it's there, somewhere it's not, but it doesn't look like a some kind of protocol that we can rely on. I'm not sure that parsing of the plain comments is a good and stable way to create the table structures. That's why I think it's easier to just add the class to |
But if Defold defines some protocol that describes the structure of the returned tables as an additional object in the documentation structure rather than in plain description, then of course parsing this meta information would be the obvious solution. |
Looked carefully at the documentation, thought again, it might make sense to parse it. At the moment output format included to the description of the return value looks like this:
It may not be a protocol yet, but it is something 🤔 I'll try to implement it someday. |
Updated the release 1.7.0. Feel free to touch if I missed something. |
For the future: it's impossible to parse the table structure from the documentation because it's not a protocol. It looks more like just copy-paste with one style. |
https://github.com/astrochili/defold-vscode-guide/blob/master/.defold_api/system.lua#L60
https://defold.com/ref/beta/sys/#sys.get_engine_info
This is missing the
version
,version_sha1
andis_debug
fields. Looks like other docstrings are too.I'm not sure of the best way to format these extra fields when they do get added in.
The text was updated successfully, but these errors were encountered: