Skip to content

Feature: EmmyLua-like metamethod documenting #1188

@Feez

Description

@Feez

It would be awesome if we included some type of EmmyLua documentation extension to support metamethods (particularly the Mathematic Operators).

I'd like to be able to code something like this:

---@class MyClass
---@metamethod add fun:(self: MyClass, other: MyClass) : MyClass
---@metamethod subtract fun:(self: MyClass, other: MyClass) : MyClass
local x = {}

---@type MyClass
local a

---@type MyClass
local b

--- Ideally, `c` would be inferred to be MyClass off of the annotations
local c = a + b

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsenhancementNew feature or requestfeat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions