Skip to content
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

Add support for generating LuaCATS definitions for the Lua API #3755

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kalimag
Copy link
Contributor

@kalimag kalimag commented Aug 21, 2023

Adds the ability to generate API definitions in the LuaCATS format to the Lua Console.

LuaCATS is primarily the annotation format of Lua Language Server, which drives the most popular VS Code Lua extension and can be used in other editors with language server support.

LuaCATS is an extension/fork of the annotation format used by EmmyLua, but I'm not sure what the status of the latter is. These definitions might be compatible with EmmyLua, but the only spec of its format I could find is sparse and partially in Chinese.

The generated definitions could be further improved, e.g. enumerating valid values for surfaceName parameters, specifying the structure of certain table values, and callback function signatures. But that would require extending the API metadata and I wanted to get some feedback first.

Current output

Check if completed:

will resolve #3860

@YoshiRulz YoshiRulz self-requested a review August 21, 2023 07:49
@kalimag
Copy link
Contributor Author

kalimag commented Aug 21, 2023

Just for example, some issues LuaLS can detect in the bundled scripts using these definitions:

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output Lua annotations for editors
1 participant