Skip to content

[Req] Middleclass support #1172

Closed
Closed
@FlashHit

Description

@FlashHit

Hey, I want to define classes properly.
We use this middleclass to create classes in lua.
However if I define a class that takes parameters like this:

---@class CustomClass
CustomClass = class("CustomClass")

function CustomClass:initialize(sometable)
    self.sometable = sometable
end

local s_SomeTable = { test = 2 }
--- this shows as unknown instead of CustomClass
local s_CustomClass = CustomClass(s_SomeTable)

It doesn't work. Also CustomClass.static etc. would be unknown.
Is this something I can do? or do you need to add support for it? I want this since really long time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)questionUser has a question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions