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

feat: support deep access #67

Merged
merged 1 commit into from
Dec 11, 2022
Merged

feat: support deep access #67

merged 1 commit into from
Dec 11, 2022

Conversation

numToStr
Copy link
Owner

This adds support for parsing deep-access objects. Previously, following code

local U = {}

---Foo
---@type table
U.foo = {}

---Bar
---@return table
function U.foo:bar()
    self.__index = self
    return setmetatable({}, self)
end

---Baz
---@return table
function U.foo.baz()
    return U.foo:bar()
end

return U

Was rendered as the following, look how bar() and baz() methods are missing.

U.foo                                                                    *U.foo*
    Foo

    Type: ~
        (table)


U.foo()                                                                  *U.foo*
    Bar

    Returns: ~
        (table)


U.foo()                                                                  *U.foo*
    Baz

    Returns: ~
        (table)

Now with this PR, it is rendered as expected

U.foo                                                                    *U.foo*
    Foo

    Type: ~
        (table)


U.foo:bar()                                                          *U.foo:bar*
    Bar

    Returns: ~
        (table)


U.foo.baz()                                                          *U.foo.baz*
    Baz

    Returns: ~
        (table)

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.

1 participant