Skip to content

Classes, and aliases whose visibility is restricted by current Lua file #294

@SilverIce

Description

@SilverIce

Would be nice to have this feature - i.e. have something that marks classes, and/or aliases to have a restricted visibility. Other Lua files won't be able to see these types.

Why?

To reduce potential name collisions. Example: Imagine you got several dozens (43+) of "aura"-entry types. (In total I got ~120 ---@class annotations).

-- public API:
---@class AuraEntry : GenericEntry
---@field root_entry RootEntry
---@field updater? TimerEntry
---@field _stage_id? string|integer only for staged aura.
---@field [string] any

-- Some concrete type in some Lua file, one of the many:

---@class Weight2SpeedAuraEntry : AuraEntry -- Using structure from v3
---@field actual_weight number
---@field adapted_weight number
---@field uncommitted_gain number

-- Yet another type in Lua file, one of the many:

---@class ShaderFxAuraEntry : AuraEntry
---@field effect_shader Form

So, instead of cluttering global scope with all those very-local type names, is it possible to make it visible only in current Lua file?

---@class local.ShaderFxAuraEntry : AuraEntry
---@field effect_shader Form

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions