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

Write backends for documentation and lua language server formats #248

Open
Tracked by #245
makspll opened this issue Feb 2, 2025 · 2 comments
Open
Tracked by #245

Write backends for documentation and lua language server formats #248

makspll opened this issue Feb 2, 2025 · 2 comments
Milestone

Comments

@makspll
Copy link
Owner

makspll commented Feb 2, 2025

Given a standard format for declaring what function and types are available, we should be then able to generate documentation and any other file format we require

@Joakker
Copy link
Contributor

Joakker commented Feb 5, 2025

Here's my idea

When a method is registered, you would run a method on the arg type which returns a list of the types of the arguments in the scripting language side. Stuff like FunctionContext gets skipped because it's handled by bms, but would mark the function as impure if the caller cares about it (since we likely want it to get the world). Same for the return type

An arg named self_ would correspond to the receiver, which means this is an instance function. If there is none, it's a static method.

Going one step above, namespaces would add to a global resource that contains all this metadata (namespaces/classes and their methods) since they already have access to the world

One step further, world would have a method that would generate the declaration files, passing the metadata through a function provided by the specific language plugin to make it into readable code

For example, LuaScriptingPlugin would provide a function that generates lua class/method declarations given the data generated above

@Joakker
Copy link
Contributor

Joakker commented Feb 5, 2025

Sorry if it's all over the place, I'm at work writing this 🙃

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

No branches or pull requests

2 participants