Skip to content

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)

@numToStr numToStr merged commit 8894074 into master Dec 11, 2022
@numToStr numToStr deleted the deep-op branch December 11, 2022 12:39
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