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 Script Handler signatures to API documentation #379

Open
Meorawr opened this issue Jan 3, 2023 · 0 comments
Open

Add Script Handler signatures to API documentation #379

Meorawr opened this issue Jan 3, 2023 · 0 comments
Labels
Feature Request Requests for features

Comments

@Meorawr
Copy link
Collaborator

Meorawr commented Jan 3, 2023

With 10.0 giving us the gift of automated API documentation for script object APIs, it'd be helpful if this were additionally extended to also document the signatures of script handlers such as OnHyperlinkEnter or OnTextChanged.

Currently, the only reliable way for us to determine what arguments are supplied to script handlers is through inspection of an debuglocals dump within a replaced global error handler.

As an example, given the following XML and Lua fragments we can use the debuglocals API to determine the names of the parameters generated for an OnHyperlinkEnter XML script handler chunk. While this will get us the magic names of parameters within generated XML script handlers, we can't automatically infer typing information for the individual parameters.

<Frame name="TestFrame">
    <Scripts>
        <OnHyperlinkEnter>error()</OnHyperlinkEnter>
    </Scripts>
</Frame>
local eh = geterrorhandler()
seterrorhandler(function(e) print(debuglocals(4)) end)
securecall(TestFrame:GetScript("OnHyperlinkEnter"))
seterrorhandler(eh)

This would output the following:

self = nil
link = nil
text = nil
region = nil
left = nil
bottom = nil
width = nil
height = nil
@Meorawr Meorawr added the Feature Request Requests for features label Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Requests for features
Projects
None yet
Development

No branches or pull requests

1 participant