Skip to content

feat: add ---@export - #30

Merged
numToStr merged 1 commit into
masterfrom
meta-mitigate
Jul 8, 2022
Merged

numToStr merged 1 commit into
masterfrom
meta-mitigate

Conversation

@numToStr

@numToStr numToStr commented Jul 8, 2022

Copy link
Copy Markdown
Owner

This tag allows us to manually tag the exported object. As the parser is unable to parse some return cases, such as return setmetatable(...)

Emmylua

---@mod module.config Configuration

local Config = {}

---Get the config
---@return number
function Config:get()
    return 3.14
end

---@export Config
return setmetatable(Config, {
    __index = function(this, k)
        return this.state[k]
    end,
    __newindex = function(this, k, v)
        this.state[k] = v
    end,
})

Help

================================================================================
Configuration                                                    *module.config*

Config:get()                                                        *Config:get*
    Get the config

    Returns: ~
        {number}

This tag allows us to manually tag the exported object. As the parser
is unable to parse some cases, such as `return setmetatable(...)`
@numToStr
numToStr merged commit f66ff82 into master Jul 8, 2022
@numToStr
numToStr deleted the meta-mitigate branch July 8, 2022 06:38
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